recce-nightly 1.10.0.20250625__py3-none-any.whl → 1.30.0.20251221__py3-none-any.whl

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.

Potentially problematic release.


This version of recce-nightly might be problematic. Click here for more details.

Files changed (229) hide show
  1. recce/VERSION +1 -1
  2. recce/__init__.py +5 -0
  3. recce/adapter/dbt_adapter/__init__.py +343 -245
  4. recce/apis/check_api.py +20 -14
  5. recce/apis/check_events_api.py +353 -0
  6. recce/apis/check_func.py +5 -5
  7. recce/apis/run_func.py +32 -3
  8. recce/artifact.py +76 -3
  9. recce/cli.py +705 -82
  10. recce/config.py +2 -2
  11. recce/connect_to_cloud.py +1 -1
  12. recce/core.py +3 -3
  13. recce/data/404/index.html +2 -0
  14. recce/data/404.html +2 -22
  15. recce/data/__next.@lineage.!KHNsb3Qp.__PAGE__.txt +7 -0
  16. recce/data/__next.@lineage.!KHNsb3Qp.txt +4 -0
  17. recce/data/__next.__PAGE__.txt +6 -0
  18. recce/data/__next._full.txt +32 -0
  19. recce/data/__next._head.txt +8 -0
  20. recce/data/__next._index.txt +14 -0
  21. recce/data/__next._tree.txt +8 -0
  22. recce/data/_next/static/chunks/025a7e3e3f9f40ae.js +1 -0
  23. recce/data/_next/static/chunks/0ce56d67ef5779ca.js +4 -0
  24. recce/data/_next/static/chunks/1a6a78780155dac7.js +48 -0
  25. recce/data/_next/static/chunks/1de8485918b9182a.css +2 -0
  26. recce/data/_next/static/chunks/1e4b1b50d1e34993.js +1 -0
  27. recce/data/_next/static/chunks/206d5d181e4c738e.js +1 -0
  28. recce/data/_next/static/chunks/2c357efc34c5b859.js +25 -0
  29. recce/data/_next/static/chunks/2e9d95d2d48c479c.js +1 -0
  30. recce/data/_next/static/chunks/2f016dc4a3edad2e.js +2 -0
  31. recce/data/_next/static/chunks/313251962d698f7c.js +1 -0
  32. recce/data/_next/static/chunks/3a9f021f38eb5574.css +1 -0
  33. recce/data/_next/static/chunks/40079da8d2b8f651.js +1 -0
  34. recce/data/_next/static/chunks/4599182bffb64661.js +38 -0
  35. recce/data/_next/static/chunks/4e62f6e184173580.js +1 -0
  36. recce/data/_next/static/chunks/5c4dfb0d09eaa401.js +1 -0
  37. recce/data/_next/static/chunks/69e4f06ccfdfc3ac.js +1 -0
  38. recce/data/_next/static/chunks/6b206cb4707d6bee.js +1 -0
  39. recce/data/_next/static/chunks/6d8557f062aa4386.css +1 -0
  40. recce/data/_next/static/chunks/7fbe3650bd83b6b5.js +1 -0
  41. recce/data/_next/static/chunks/83fa823a825674f6.js +1 -0
  42. recce/data/_next/static/chunks/848a6c9b5f55f7ed.js +1 -0
  43. recce/data/_next/static/chunks/859462b0858aef88.css +2 -0
  44. recce/data/_next/static/chunks/923964f18c87d0f1.css +1 -0
  45. recce/data/_next/static/chunks/939390f911895d7c.js +48 -0
  46. recce/data/_next/static/chunks/99a9817237a07f43.js +1 -0
  47. recce/data/_next/static/chunks/9fed8b4b2b924054.js +5 -0
  48. recce/data/_next/static/chunks/b6949f6c5892110c.js +1 -0
  49. recce/data/_next/static/chunks/b851a1d3f8149828.js +1 -0
  50. recce/data/_next/static/chunks/c734f9ad957de0b4.js +1 -0
  51. recce/data/_next/static/chunks/cdde321b0ec75717.js +2 -0
  52. recce/data/_next/static/chunks/d0f91117d77ff844.css +1 -0
  53. recce/data/_next/static/chunks/d6c8667911c2500f.js +1 -0
  54. recce/data/_next/static/chunks/da8dab68c02752cf.js +74 -0
  55. recce/data/_next/static/chunks/dc074049c9d12d97.js +109 -0
  56. recce/data/_next/static/chunks/ee7f1a8227342421.js +1 -0
  57. recce/data/_next/static/chunks/fa2f4e56c2fccc73.js +1 -0
  58. recce/data/_next/static/chunks/turbopack-1fad664f62979b93.js +3 -0
  59. recce/data/_next/static/media/favicon.a8d38d84.ico +0 -0
  60. recce/data/_next/static/media/montserrat-cyrillic-800-normal.d80d830d.woff2 +0 -0
  61. recce/data/_next/static/media/{montserrat-cyrillic-800-normal.bd5c9f50.woff → montserrat-cyrillic-800-normal.f9d58125.woff} +0 -0
  62. recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.076c2a93.woff2 +0 -0
  63. recce/data/_next/static/media/montserrat-latin-800-normal.cde454cc.woff2 +0 -0
  64. recce/data/_next/static/media/{montserrat-latin-800-normal.fc315020.woff → montserrat-latin-800-normal.d5761935.woff} +0 -0
  65. recce/data/_next/static/media/montserrat-latin-ext-800-normal.40ec0659.woff2 +0 -0
  66. recce/data/_next/static/media/{montserrat-latin-ext-800-normal.2e5381b2.woff → montserrat-latin-ext-800-normal.b671449b.woff} +0 -0
  67. recce/data/_next/static/media/{montserrat-vietnamese-800-normal.20c545e6.woff → montserrat-vietnamese-800-normal.9f7b8541.woff} +0 -0
  68. recce/data/_next/static/media/montserrat-vietnamese-800-normal.f9eb854e.woff2 +0 -0
  69. recce/data/_next/static/nX-Uz0AH6Tc6hIQUFGqaB/_buildManifest.js +11 -0
  70. recce/data/_next/static/nX-Uz0AH6Tc6hIQUFGqaB/_clientMiddlewareManifest.json +1 -0
  71. recce/data/_not-found/__next._full.txt +24 -0
  72. recce/data/_not-found/__next._head.txt +8 -0
  73. recce/data/_not-found/__next._index.txt +13 -0
  74. recce/data/_not-found/__next._not-found.__PAGE__.txt +5 -0
  75. recce/data/_not-found/__next._not-found.txt +4 -0
  76. recce/data/_not-found/__next._tree.txt +6 -0
  77. recce/data/_not-found/index.html +2 -0
  78. recce/data/_not-found/index.txt +24 -0
  79. recce/data/auth_callback.html +1 -1
  80. recce/data/checks/__next.@lineage.__DEFAULT__.txt +7 -0
  81. recce/data/checks/__next._full.txt +39 -0
  82. recce/data/checks/__next._head.txt +8 -0
  83. recce/data/checks/__next._index.txt +14 -0
  84. recce/data/checks/__next._tree.txt +8 -0
  85. recce/data/checks/__next.checks.__PAGE__.txt +10 -0
  86. recce/data/checks/__next.checks.txt +4 -0
  87. recce/data/checks/index.html +2 -0
  88. recce/data/checks/index.txt +39 -0
  89. recce/data/index.html +2 -27
  90. recce/data/index.txt +32 -8
  91. recce/data/lineage/__next.@lineage.__DEFAULT__.txt +7 -0
  92. recce/data/lineage/__next._full.txt +39 -0
  93. recce/data/lineage/__next._head.txt +8 -0
  94. recce/data/lineage/__next._index.txt +14 -0
  95. recce/data/lineage/__next._tree.txt +8 -0
  96. recce/data/lineage/__next.lineage.__PAGE__.txt +10 -0
  97. recce/data/lineage/__next.lineage.txt +4 -0
  98. recce/data/lineage/index.html +2 -0
  99. recce/data/lineage/index.txt +39 -0
  100. recce/data/query/__next.@lineage.__DEFAULT__.txt +7 -0
  101. recce/data/query/__next._full.txt +37 -0
  102. recce/data/query/__next._head.txt +8 -0
  103. recce/data/query/__next._index.txt +14 -0
  104. recce/data/query/__next._tree.txt +8 -0
  105. recce/data/query/__next.query.__PAGE__.txt +9 -0
  106. recce/data/query/__next.query.txt +4 -0
  107. recce/data/query/index.html +2 -0
  108. recce/data/query/index.txt +37 -0
  109. recce/event/CONFIG.bak +1 -0
  110. recce/event/__init__.py +9 -8
  111. recce/event/collector.py +6 -2
  112. recce/event/track.py +10 -0
  113. recce/github.py +1 -1
  114. recce/mcp_server.py +725 -0
  115. recce/models/check.py +433 -15
  116. recce/models/types.py +61 -2
  117. recce/pull_request.py +1 -1
  118. recce/run.py +37 -17
  119. recce/server.py +216 -21
  120. recce/state/__init__.py +31 -0
  121. recce/state/cloud.py +644 -0
  122. recce/state/const.py +26 -0
  123. recce/state/local.py +56 -0
  124. recce/state/state.py +119 -0
  125. recce/state/state_loader.py +174 -0
  126. recce/summary.py +25 -3
  127. recce/tasks/dataframe.py +63 -1
  128. recce/tasks/query.py +40 -3
  129. recce/tasks/rowcount.py +4 -1
  130. recce/tasks/schema.py +4 -1
  131. recce/tasks/utils.py +147 -0
  132. recce/tasks/valuediff.py +85 -57
  133. recce/util/api_token.py +11 -2
  134. recce/util/breaking.py +10 -1
  135. recce/util/cll.py +1 -2
  136. recce/util/cloud/__init__.py +15 -0
  137. recce/util/cloud/base.py +115 -0
  138. recce/util/cloud/check_events.py +190 -0
  139. recce/util/cloud/checks.py +242 -0
  140. recce/util/io.py +2 -2
  141. recce/util/lineage.py +19 -18
  142. recce/util/perf_tracking.py +85 -0
  143. recce/util/recce_cloud.py +254 -5
  144. recce/util/startup_perf.py +121 -0
  145. recce/yaml/__init__.py +2 -2
  146. {recce_nightly-1.10.0.20250625.dist-info → recce_nightly-1.30.0.20251221.dist-info}/METADATA +91 -71
  147. recce_nightly-1.30.0.20251221.dist-info/RECORD +183 -0
  148. {recce_nightly-1.10.0.20250625.dist-info → recce_nightly-1.30.0.20251221.dist-info}/WHEEL +1 -2
  149. recce/data/_next/static/abCX3x3UoIdRLEDWxx4xd/_buildManifest.js +0 -1
  150. recce/data/_next/static/chunks/181-acc61ddada3bc0ca.js +0 -43
  151. recce/data/_next/static/chunks/1bff33f1-1ef85cf5e658a751.js +0 -1
  152. recce/data/_next/static/chunks/217-879a84d70f7a907c.js +0 -2
  153. recce/data/_next/static/chunks/29e3cc0d-60045b2e47aa3916.js +0 -1
  154. recce/data/_next/static/chunks/36e1c10d-8e7be4a6c1f6ab2d.js +0 -1
  155. recce/data/_next/static/chunks/3998a672-03adacad07b346ac.js +0 -1
  156. recce/data/_next/static/chunks/3a92ee20-1081c360214f9602.js +0 -1
  157. recce/data/_next/static/chunks/42-cd3c06533f5fd47c.js +0 -9
  158. recce/data/_next/static/chunks/450c323b-fd94e7ffaa4a5efa.js +0 -1
  159. recce/data/_next/static/chunks/47d8844f-929aed9b1c73a905.js +0 -1
  160. recce/data/_next/static/chunks/608-3b079b544e5d5f5e.js +0 -15
  161. recce/data/_next/static/chunks/6dc81886-adbfa45836061d79.js +0 -1
  162. recce/data/_next/static/chunks/7a8a3e83-edf6dc64b5d5f0a5.js +0 -1
  163. recce/data/_next/static/chunks/7f27ae6c-d5f0438edd5c2a5b.js +0 -1
  164. recce/data/_next/static/chunks/86730205-cfb14e3f051bab35.js +0 -1
  165. recce/data/_next/static/chunks/8d700b6a.8bb140898499c512.js +0 -1
  166. recce/data/_next/static/chunks/92-607cd1af83c41f43.js +0 -1
  167. recce/data/_next/static/chunks/9746af58-a42b7d169cacadf0.js +0 -1
  168. recce/data/_next/static/chunks/a30376cd-de84559016d7e133.js +0 -1
  169. recce/data/_next/static/chunks/app/_not-found/page-01ed58b7f971d311.js +0 -1
  170. recce/data/_next/static/chunks/app/layout-177a410a97e0d018.js +0 -1
  171. recce/data/_next/static/chunks/app/page-da6e046a8235dbfc.js +0 -1
  172. recce/data/_next/static/chunks/b63b1b3f-4282bdcf459e075c.js +0 -1
  173. recce/data/_next/static/chunks/bbda5537-9ec25eb1dd62348a.js +0 -1
  174. recce/data/_next/static/chunks/c132bf7d-08cb668a789d6afd.js +0 -1
  175. recce/data/_next/static/chunks/ce84277d-2e5d1d46910cf052.js +0 -1
  176. recce/data/_next/static/chunks/febdd86e-c6b525341634b860.js +0 -54
  177. recce/data/_next/static/chunks/fee69bc6-2dbccaf9b90474e6.js +0 -1
  178. recce/data/_next/static/chunks/framework-ded83d71b51ce901.js +0 -1
  179. recce/data/_next/static/chunks/main-app-39061b0166c47f55.js +0 -1
  180. recce/data/_next/static/chunks/main-b5b3ae20a1405261.js +0 -1
  181. recce/data/_next/static/chunks/pages/_app-437c455677d62394.js +0 -1
  182. recce/data/_next/static/chunks/pages/_error-e7650df18ca04bde.js +0 -1
  183. recce/data/_next/static/chunks/webpack-7b49d5ba7e3a434d.js +0 -1
  184. recce/data/_next/static/css/17a96168e3a9db13.css +0 -1
  185. recce/data/_next/static/css/1b121dc4d36aeb4d.css +0 -3
  186. recce/data/_next/static/css/35c6679a098e1e34.css +0 -1
  187. recce/data/_next/static/css/951e2e0eea2d4a5b.css +0 -14
  188. recce/data/_next/static/media/montserrat-cyrillic-800-normal.22628180.woff2 +0 -0
  189. recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.94a63aea.woff2 +0 -0
  190. recce/data/_next/static/media/montserrat-latin-800-normal.6f8fa298.woff2 +0 -0
  191. recce/data/_next/static/media/montserrat-latin-ext-800-normal.013b84f9.woff2 +0 -0
  192. recce/data/_next/static/media/montserrat-vietnamese-800-normal.c0035377.woff2 +0 -0
  193. recce/data/_next/static/media/reload-image.79aabb7d.svg +0 -4
  194. recce/state.py +0 -786
  195. recce_nightly-1.10.0.20250625.dist-info/RECORD +0 -154
  196. recce_nightly-1.10.0.20250625.dist-info/top_level.txt +0 -2
  197. tests/__init__.py +0 -0
  198. tests/adapter/__init__.py +0 -0
  199. tests/adapter/dbt_adapter/__init__.py +0 -0
  200. tests/adapter/dbt_adapter/conftest.py +0 -17
  201. tests/adapter/dbt_adapter/dbt_test_helper.py +0 -298
  202. tests/adapter/dbt_adapter/test_dbt_adapter.py +0 -25
  203. tests/adapter/dbt_adapter/test_dbt_cll.py +0 -384
  204. tests/adapter/dbt_adapter/test_selector.py +0 -202
  205. tests/tasks/__init__.py +0 -0
  206. tests/tasks/conftest.py +0 -4
  207. tests/tasks/test_histogram.py +0 -129
  208. tests/tasks/test_lineage.py +0 -55
  209. tests/tasks/test_preset_checks.py +0 -64
  210. tests/tasks/test_profile.py +0 -397
  211. tests/tasks/test_query.py +0 -151
  212. tests/tasks/test_row_count.py +0 -135
  213. tests/tasks/test_schema.py +0 -122
  214. tests/tasks/test_top_k.py +0 -77
  215. tests/tasks/test_valuediff.py +0 -85
  216. tests/test_cli.py +0 -133
  217. tests/test_config.py +0 -43
  218. tests/test_connect_to_cloud.py +0 -82
  219. tests/test_core.py +0 -29
  220. tests/test_dbt.py +0 -36
  221. tests/test_pull_request.py +0 -130
  222. tests/test_server.py +0 -104
  223. tests/test_state.py +0 -134
  224. tests/test_summary.py +0 -65
  225. /recce/data/_next/static/chunks/{polyfills-42372ed130431b0a.js → a6dad97d9634a72d.js} +0 -0
  226. /recce/data/_next/static/media/{montserrat-cyrillic-ext-800-normal.e6e0d8d0.woff → montserrat-cyrillic-ext-800-normal.a4fa76b5.woff} +0 -0
  227. /recce/data/_next/static/{abCX3x3UoIdRLEDWxx4xd → nX-Uz0AH6Tc6hIQUFGqaB}/_ssgManifest.js +0 -0
  228. {recce_nightly-1.10.0.20250625.dist-info → recce_nightly-1.30.0.20251221.dist-info}/entry_points.txt +0 -0
  229. {recce_nightly-1.10.0.20250625.dist-info → recce_nightly-1.30.0.20251221.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,5 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63257,e=>{"use strict";var t=e.i(187725),n=e.i(19483),r=t.createContext(void 0),i=e=>{let n=t.useContext(r);if(e)return e;if(!n)throw Error("No QueryClient set, use QueryClientProvider to set one");return n},o=({client:e,children:i})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,n.jsx)(r.Provider,{value:e,children:i}));e.s(["QueryClientProvider",()=>o,"useQueryClient",()=>i])},358102,e=>{"use strict";var t=e.i(187725),n=e.i(19483);let r=t.createContext();e.s(["default",0,function({value:e,...t}){return(0,n.jsx)(r.Provider,{value:e??!0,...t})},"useRtl",0,()=>t.useContext(r)??!1])},960247,e=>{"use strict";var t=e.i(397020);let n={iochmara:{50:"#EAF3FB",100:"#C4DDF3",200:"#9EC6EB",300:"#79B0E2",400:"#5599D8",500:"#3182CE",600:"#2A6CA7",700:"#225581",800:"#193E5C",900:"#102638",950:"#060E14"},cyan:{50:"#ECFEFF",100:"#CFFAFE",200:"#A5F3FC",300:"#67E8F9",400:"#22D3EE",500:"#06B6D4",600:"#0891B2",700:"#0E7490",800:"#155E75",900:"#164E63",950:"#083344"},neutral:{50:"#FAFAFA",100:"#F5F5F5",200:"#E5E5E5",300:"#D4D4D4",400:"#A3A3A3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0A0A0A"},amber:{50:"#FFFBEB",100:"#FEF3C7",200:"#FDE68A",300:"#FCD34D",400:"#FBBF24",500:"#F59E0B",600:"#D97706",700:"#B45309",800:"#92400E",900:"#78350F",950:"#431407"},green:{50:"#F0FDF4",100:"#DCFCE7",200:"#BBF7D0",300:"#86EFAC",400:"#4ADE80",500:"#22C55E",600:"#16A34A",700:"#15803D",800:"#166534",900:"#14532D",950:"#052E16"},red:{50:"#FEF2F2",100:"#FEE2E2",200:"#FECACA",300:"#FCA5A5",400:"#F87171",500:"#EF4444",600:"#DC2626",700:"#B91C1C",800:"#991B1B",900:"#7F1D1D",950:"#450A0A"},rose:{50:"#FFF1F2",100:"#FFE4E6",200:"#FECDD3",300:"#FDA4AF",400:"#FB7185",500:"#F43F5E",600:"#E11D48",700:"#BE123C",800:"#9F1239",900:"#881337",950:"#4C0519"},fuchsia:{50:"#FDF4FF",100:"#FAE8FF",200:"#F5D0FE",300:"#F0ABFC",400:"#E879F9",500:"#D946EF",600:"#C026D3",700:"#A21CAF",800:"#86198F",900:"#701A75",950:"#4A044E"},brand:{50:"#FFDED5",100:"#FFC1B0",200:"#FFA58C",300:"#FF8967",400:"#FF6E42",500:"#FD541E",600:"#F04104",700:"#C93A06",800:"#A23206",900:"#7C2906",950:"#571E05"}},r={envBase:n.amber[500],envCurrent:n.iochmara[500]};function i(e,t){return[{props:{color:e,variant:"contained"},style:{backgroundColor:t[500],color:"#FFFFFF","&:hover":{backgroundColor:t[600]}}},{props:{color:e,variant:"outlined"},style:{borderColor:t[500],color:t[600],"&:hover":{borderColor:t[600],backgroundColor:`${t[50]}80`}}},{props:{color:e,variant:"text"},style:{color:t[600],"&:hover":{backgroundColor:`${t[50]}80`}}}]}function o(e,t){return{props:{color:e},style:{color:t[500]}}}function s(e,t){return{props:{color:e},style:{"& .MuiBadge-badge":{backgroundColor:t[500],color:"#FFFFFF"}}}}function a(e,t){return[{props:{color:e,variant:"filled"},style:{backgroundColor:t[500],color:"#FFFFFF","&:hover":{backgroundColor:t[600]}}},{props:{color:e,variant:"outlined"},style:{borderColor:t[500],color:t[600]}}]}let l=[...i("iochmara",n.iochmara),...i("cyan",n.cyan),...i("amber",n.amber),...i("green",n.green),...i("red",n.red),...i("rose",n.rose),...i("fuchsia",n.fuchsia),...i("brand",n.brand),{props:{color:"neutral",variant:"contained"},style:{backgroundColor:n.neutral[700],color:"#FFFFFF","&:hover":{backgroundColor:n.neutral[800]}}},{props:{color:"neutral",variant:"outlined"},style:{borderColor:n.neutral[300],color:n.neutral[900],"&:hover":{borderColor:n.neutral[400],backgroundColor:n.neutral[100]}}},{props:{color:"neutral",variant:"text"},style:{color:n.neutral[700],"&:hover":{backgroundColor:n.neutral[100]}}}],u=[o("iochmara",n.iochmara),o("cyan",n.cyan),o("amber",n.amber),o("green",n.green),o("red",n.red),o("rose",n.rose),o("fuchsia",n.fuchsia),o("brand",n.brand),o("neutral",n.neutral)],c=[s("iochmara",n.iochmara),s("cyan",n.cyan),s("amber",n.amber),s("green",n.green),s("red",n.red),s("rose",n.rose),s("fuchsia",n.fuchsia),s("brand",n.brand),s("neutral",n.neutral)],d=[...a("iochmara",n.iochmara),...a("cyan",n.cyan),...a("amber",n.amber),...a("green",n.green),...a("red",n.red),...a("rose",n.rose),...a("fuchsia",n.fuchsia),...a("brand",n.brand),...a("neutral",n.neutral)],h={MuiButton:{defaultProps:{disableElevation:!0},variants:[{props:{size:"xsmall"},style:{padding:"0 0.5rem",fontSize:"0.75rem",fontWeight:500,borderRadius:4,minHeight:"unset",lineHeight:1.5}},...l],styleOverrides:{root:{textTransform:"none",fontWeight:500,borderRadius:6},sizeSmall:{padding:"0.25rem 0.75rem",fontSize:"0.875rem"},sizeMedium:{padding:"0.5rem 1rem",fontSize:"1rem"},sizeLarge:{padding:"0.75rem 1.5rem",fontSize:"1.125rem"},contained:{"&:hover":{boxShadow:"none"}},outlined:{borderWidth:"1px","&:hover":{borderWidth:"1px"}},text:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}}}},MuiIconButton:{styleOverrides:{root:{borderRadius:6},sizeSmall:{padding:4},sizeMedium:{padding:8},sizeLarge:{padding:12}}},MuiTextField:{defaultProps:{variant:"outlined",size:"small"},styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:6}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:6,"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:n.iochmara[400]},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:n.iochmara[500],borderWidth:2}},notchedOutline:{borderColor:n.neutral[300]}}},MuiCheckbox:{defaultProps:{color:"primary"},styleOverrides:{root:{borderRadius:4}}},MuiSwitch:{defaultProps:{color:"primary"}},MuiDialog:{styleOverrides:{paper:{borderRadius:8}}},MuiDialogTitle:{styleOverrides:{root:{fontWeight:600,fontSize:"1.125rem"}}},MuiMenu:{styleOverrides:{paper:({theme:e})=>({borderRadius:8,boxShadow:e.shadows[3]})}},MuiMenuItem:{styleOverrides:{root:{fontSize:"0.875rem",padding:"0.5rem 0.75rem","&:hover":{backgroundColor:n.neutral[100]},"&.Mui-selected":{backgroundColor:n.iochmara[50],"&:hover":{backgroundColor:n.iochmara[100]}}}}},MuiChip:{variants:[{props:{size:"xsmall"},style:{height:20,fontSize:"0.625rem"}},...d],styleOverrides:{root:{borderRadius:6,fontWeight:500},sizeSmall:{height:24,fontSize:"0.75rem"},sizeMedium:{height:32,fontSize:"0.875rem"}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:n.neutral[800],fontSize:"0.75rem",padding:"0.25rem 0.5rem",borderRadius:4},arrow:{color:n.neutral[800]}}},MuiAlert:{styleOverrides:{root:{borderRadius:6},standardSuccess:{backgroundColor:n.green[50],color:n.green[800]},standardWarning:{backgroundColor:n.amber[50],color:n.amber[800]},standardError:{backgroundColor:n.red[50],color:n.red[800]},standardInfo:{backgroundColor:n.iochmara[50],color:n.iochmara[800]}}},MuiTabs:{styleOverrides:{indicator:{height:2}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontWeight:500,minHeight:48}}},MuiAvatar:{styleOverrides:{root:{fontWeight:500}}},MuiBadge:{variants:c,styleOverrides:{badge:{fontWeight:500,fontSize:"0.75rem"}}},MuiCircularProgress:{defaultProps:{color:"primary"},variants:u},MuiLink:{defaultProps:{underline:"hover",fontWeight:500},styleOverrides:{root:{color:n.iochmara[600],textDecorationColor:n.iochmara[300],"&:hover":{color:n.iochmara[700]}}}},MuiPaper:{styleOverrides:{rounded:{borderRadius:8}}},MuiPopover:{styleOverrides:{paper:({theme:e})=>({borderRadius:8,boxShadow:e.shadows[3]})}},MuiDivider:{styleOverrides:{root:{borderColor:n.neutral[200]}}},MuiBreadcrumbs:{styleOverrides:{separator:{color:n.neutral[400]}}}},f={palette:{primary:{main:n.iochmara[500],light:n.iochmara[300],dark:n.iochmara[600],contrastText:"#FFFFFF"},secondary:{main:n.cyan[500],light:n.cyan[400],dark:n.cyan[600],contrastText:"#FFFFFF"},success:{main:n.green[500],light:n.green[400],dark:n.green[600],contrastText:"#FFFFFF"},warning:{main:n.amber[500],light:n.amber[400],dark:n.amber[600],contrastText:"#FFFFFF"},error:{main:n.red[500],light:n.red[400],dark:n.red[600],contrastText:"#FFFFFF"},grey:{50:n.neutral[50],100:n.neutral[100],200:n.neutral[200],300:n.neutral[300],400:n.neutral[400],500:n.neutral[500],600:n.neutral[600],700:n.neutral[700],800:n.neutral[800],900:n.neutral[900]}},typography:{fontFamily:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700,h1:{fontWeight:700,fontSize:"2.25rem",lineHeight:1.2},h2:{fontWeight:700,fontSize:"1.875rem",lineHeight:1.2},h3:{fontWeight:600,fontSize:"1.5rem",lineHeight:1.3},h4:{fontWeight:600,fontSize:"1.25rem",lineHeight:1.4},h5:{fontWeight:600,fontSize:"1.125rem",lineHeight:1.4},h6:{fontWeight:600,fontSize:"1rem",lineHeight:1.5},body1:{fontSize:"0.875rem",lineHeight:1.5},body2:{fontSize:"0.75rem",lineHeight:1.5},button:{textTransform:"none",fontWeight:500}},shape:{borderRadius:6},spacing:4,components:h},p={...f,palette:{...f.palette,mode:"light",background:{default:"#FFFFFF",paper:"#FFFFFF"},text:{primary:n.neutral[900],secondary:n.neutral[600]}}},g={...f,palette:{...f.palette,mode:"dark",background:{default:n.neutral[900],paper:n.neutral[800]},text:{primary:n.neutral[50],secondary:n.neutral[400]}}},m=(0,t.createTheme)(p),v=(0,t.createTheme)(g);function y(e){return{main:e[500],light:e[300],dark:e[600],contrastText:"#FFFFFF"}}let b={brand:y(n.brand),iochmara:{main:n.iochmara[500],light:n.iochmara[50],dark:n.iochmara[700],contrastText:"#FFFFFF"},cyan:y(n.cyan),amber:y(n.amber),green:y(n.green),red:y(n.red),rose:y(n.rose),fuchsia:y(n.fuchsia),neutral:{main:n.neutral[500],light:n.neutral[300],dark:n.neutral[600],contrastText:"#FFFFFF"},envBase:r.envBase,envCurrent:r.envCurrent};Object.assign(m.palette,b),Object.assign(v.palette,b);let x={solid:600,subtle:50,muted:200,emphasized:500,focusRing:400,light:300},w={orange:"amber",gray:"neutral"};function _(e){let t=e.split(".");if("colors"===t[0]&&t.length>=3){let e=t[1],i=t[2];if(e in w&&(e=w[e]),"white"===e)return"#FFFFFF";if("black"===e)return"#000000";if(e in r){let t=r[e];if("object"==typeof t&&i in t)return t[i]}if(e in n){let t=n[e];if("object"==typeof t&&i in t)return t[i];if(i in x){let e=x[i];if("object"==typeof t&&e in t)return t[e]}}}}e.s(["colors",()=>n,"darkTheme",0,v,"lightTheme",0,m,"token",()=>_])},577950,427447,345058,752754,803913,749661,e=>{"use strict";var t=e.i(995044);let n=function(e){return"string"==typeof e};e.s(["default",0,n],427447);let r=function(e,t,r){return void 0===e||n(e)?t:{...t,ownerState:{...t.ownerState,...r}}};e.s(["default",0,r],345058);let i=function(e,t,n){return"function"==typeof e?e(t,n):e};e.s(["default",0,i],752754);var o=e.i(7284);let s=function(e,t=[]){if(void 0===e)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n};e.s(["default",0,s],803913);let a=function(e){if(void 0===e)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t},l=function(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:l}=e;if(!t){let e=(0,o.default)(n?.className,l,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},s={...n,...i,...r};return e.length>0&&(s.className=e),Object.keys(t).length>0&&(s.style=t),{props:s,internalRef:void 0}}let u=s({...i,...r}),c=a(r),d=a(i),h=t(u),f=(0,o.default)(h?.className,n?.className,l,i?.className,r?.className),p={...h?.style,...n?.style,...i?.style,...r?.style},g={...h,...n,...d,...c};return f.length>0&&(g.className=f),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:h.ref}};function u(e,n){let{className:o,elementType:s,ownerState:a,externalForwardedProps:u,internalForwardedProps:c,shouldForwardComponentProp:d=!1,...h}=n,{component:f,slots:p={[e]:void 0},slotProps:g={[e]:void 0},...m}=u,v=p[e]||s,y=i(g[e],a),{props:{component:b,...x},internalRef:w}=l({className:o,...h,externalForwardedProps:"root"===e?m:void 0,externalSlotProps:y}),_=(0,t.default)(w,y?.ref,n.ref),k="root"===e?b||f:b,S=r(v,{..."root"===e&&!f&&!p[e]&&c,..."root"!==e&&!p[e]&&c,...x,...k&&!d&&{as:k},...k&&d&&{component:k},ref:_},a);return[v,S]}e.s(["default",0,l],749661),e.s(["default",()=>u],577950)},811347,e=>{"use strict";var t=e.i(345053);e.s(["useTheme",()=>t.default])},966196,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(896425),o=e.i(446547),s=e.i(811347),a=e.i(73205),l=e.i(519273),u=e.i(980124),c=e.i(435983),d=e.i(446519);function h(e){return(0,d.default)("MuiPaper",e)}(0,c.default)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var f=e.i(19483);let p=(0,o.styled)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})((0,a.default)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),g=t.forwardRef(function(e,t){let o=(0,l.useDefaultProps)({props:e,name:"MuiPaper"}),a=(0,s.useTheme)(),{className:c,component:d="div",elevation:g=1,square:m=!1,variant:v="elevation",...y}=o,b={...o,component:d,elevation:g,square:m,variant:v},x=(e=>{let{square:t,elevation:n,variant:i,classes:o}=e,s={root:["root",i,!t&&"rounded","elevation"===i&&`elevation${n}`]};return(0,r.default)(s,h,o)})(b);return(0,f.jsx)(p,{as:d,ownerState:b,className:(0,n.default)(x.root,c),ref:t,...y,style:{..."elevation"===v&&{"--Paper-shadow":(a.vars||a).shadows[g],...a.vars&&{"--Paper-overlay":a.vars.overlays?.[g]},...!a.vars&&"dark"===a.palette.mode&&{"--Paper-overlay":`linear-gradient(${(0,i.alpha)("#fff",(0,u.default)(g))}, ${(0,i.alpha)("#fff",(0,u.default)(g))})`}},...y.style}})});e.s(["default",0,g],966196)},443654,e=>{"use strict";var t=e.i(435983),n=e.i(446519);function r(e){return(0,n.default)("MuiAlert",e)}let i=(0,t.default)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);e.s(["default",0,i,"getAlertUtilityClass",()=>r])},73371,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(82100),o=e.i(446547),s=e.i(73205),a=e.i(860223),l=e.i(519273),u=e.i(98648),c=e.i(924011),d=e.i(578509),h=e.i(435983),f=e.i(446519);function p(e){return(0,f.default)("MuiIconButton",e)}let g=(0,h.default)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]);var m=e.i(19483);let v=(0,o.styled)(u.default,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${(0,d.default)(n.color)}`],n.edge&&t[`edge${(0,d.default)(n.edge)}`],t[`size${(0,d.default)(n.size)}`]]}})((0,s.default)(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),(0,s.default)(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter((0,a.default)()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter((0,a.default)()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${g.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${g.loading}`]:{color:"transparent"}}))),y=(0,o.styled)("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),b=t.forwardRef(function(e,t){let o=(0,l.useDefaultProps)({props:e,name:"MuiIconButton"}),{edge:s=!1,children:a,className:u,color:h="default",disabled:f=!1,disableFocusRipple:g=!1,size:b="medium",id:x,loading:w=null,loadingIndicator:_,...k}=o,S=(0,i.unstable_useId)(x),C=_??(0,m.jsx)(c.default,{"aria-labelledby":S,color:"inherit",size:16}),O={...o,edge:s,color:h,disabled:f,disableFocusRipple:g,loading:w,loadingIndicator:C,size:b},E=(e=>{let{classes:t,disabled:n,color:i,edge:o,size:s,loading:a}=e,l={root:["root",a&&"loading",n&&"disabled","default"!==i&&`color${(0,d.default)(i)}`,o&&`edge${(0,d.default)(o)}`,`size${(0,d.default)(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return(0,r.default)(l,p,t)})(O);return(0,m.jsxs)(v,{id:w?S:x,className:(0,n.default)(E.root,u),centerRipple:!0,focusRipple:!g,disabled:f||w,ref:t,...k,ownerState:O,children:["boolean"==typeof w&&(0,m.jsx)("span",{className:E.loadingWrapper,style:{display:"contents"},children:(0,m.jsx)(y,{className:E.loadingIndicator,ownerState:O,children:w&&C})}),a]})});e.s(["default",0,b],73371)},36297,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(578509),o=e.i(446547),s=e.i(73205),a=e.i(519273),l=e.i(435983),u=e.i(446519);function c(e){return(0,u.default)("MuiSvgIcon",e)}(0,l.default)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var d=e.i(19483);let h=(0,o.styled)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,i.default)(n.color)}`],t[`fontSize${(0,i.default)(n.fontSize)}`]]}})((0,s.default)(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),f=t.forwardRef(function(e,o){let s=(0,a.useDefaultProps)({props:e,name:"MuiSvgIcon"}),{children:l,className:u,color:f="inherit",component:p="svg",fontSize:g="medium",htmlColor:m,inheritViewBox:v=!1,titleAccess:y,viewBox:b="0 0 24 24",...x}=s,w=t.isValidElement(l)&&"svg"===l.type,_={...s,color:f,component:p,fontSize:g,instanceFontSize:e.fontSize,inheritViewBox:v,viewBox:b,hasSvgAsChild:w},k={};v||(k.viewBox=b);let S=(e=>{let{color:t,fontSize:n,classes:o}=e,s={root:["root","inherit"!==t&&`color${(0,i.default)(t)}`,`fontSize${(0,i.default)(n)}`]};return(0,r.default)(s,c,o)})(_);return(0,d.jsxs)(h,{as:p,className:(0,n.default)(S.root,u),focusable:"false",color:m,"aria-hidden":!y||void 0,role:y?"img":void 0,ref:o,...k,...x,...w&&l.props,ownerState:_,children:[w?l.props.children:l,y?(0,d.jsx)("title",{children:y}):null]})});function p(e,n){function r(t,n){return(0,d.jsx)(f,{"data-testid":void 0,ref:n,...t,children:e})}return r.muiName=f.muiName,t.memo(t.forwardRef(r))}f.muiName="SvgIcon",e.s(["default",()=>p],36297)},388846,698951,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(446547),o=e.i(73205),s=e.i(519273),a=e.i(577950),l=e.i(578509),u=e.i(860223),c=e.i(966196),d=e.i(443654),h=e.i(73371),f=e.i(36297),p=e.i(19483);let g=(0,f.default)((0,p.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),m=(0,f.default)((0,p.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),v=(0,f.default)((0,p.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),y=(0,f.default)((0,p.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),b=(0,f.default)((0,p.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),x=(0,i.styled)(c.default,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,l.default)(n.color||n.severity)}`]]}})((0,o.default)(({theme:e})=>{let t="light"===e.palette.mode?e.darken:e.lighten,n="light"===e.palette.mode?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter((0,u.default)(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${d.default.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter((0,u.default)(["light"])).map(([n])=>({props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${d.default.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter((0,u.default)(["dark"])).map(([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}}))]}})),w=(0,i.styled)("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),_=(0,i.styled)("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),k=(0,i.styled)("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),S={success:(0,p.jsx)(g,{fontSize:"inherit"}),warning:(0,p.jsx)(m,{fontSize:"inherit"}),error:(0,p.jsx)(v,{fontSize:"inherit"}),info:(0,p.jsx)(y,{fontSize:"inherit"})},C=t.forwardRef(function(e,t){let i=(0,s.useDefaultProps)({props:e,name:"MuiAlert"}),{action:o,children:u,className:c,closeText:f="Close",color:g,components:m={},componentsProps:v={},icon:y,iconMapping:C=S,onClose:O,role:E="alert",severity:M="success",slotProps:A={},slots:P={},variant:T="standard",...R}=i,I={...i,color:g,severity:M,variant:T,colorSeverity:g||M},D=(e=>{let{variant:t,color:n,severity:i,classes:o}=e,s={root:["root",`color${(0,l.default)(n||i)}`,`${t}${(0,l.default)(n||i)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,r.default)(s,d.getAlertUtilityClass,o)})(I),L={slots:{closeButton:m.CloseButton,closeIcon:m.CloseIcon,...P},slotProps:{...v,...A}},[j,N]=(0,a.default)("root",{ref:t,shouldForwardComponentProp:!0,className:(0,n.default)(D.root,c),elementType:x,externalForwardedProps:{...L,...R},ownerState:I,additionalProps:{role:E,elevation:0}}),[F,B]=(0,a.default)("icon",{className:D.icon,elementType:w,externalForwardedProps:L,ownerState:I}),[z,V]=(0,a.default)("message",{className:D.message,elementType:_,externalForwardedProps:L,ownerState:I}),[H,$]=(0,a.default)("action",{className:D.action,elementType:k,externalForwardedProps:L,ownerState:I}),[W,U]=(0,a.default)("closeButton",{elementType:h.default,externalForwardedProps:L,ownerState:I}),[q,Q]=(0,a.default)("closeIcon",{elementType:b,externalForwardedProps:L,ownerState:I});return(0,p.jsxs)(j,{...N,children:[!1!==y?(0,p.jsx)(F,{...B,children:y||C[M]||S[M]}):null,(0,p.jsx)(z,{...V,children:u}),null!=o?(0,p.jsx)(H,{...$,children:o}):null,null==o&&O?(0,p.jsx)(H,{...$,children:(0,p.jsx)(W,{size:"small","aria-label":f,title:f,color:"inherit",onClick:O,...U,children:(0,p.jsx)(q,{fontSize:"small",...Q})})}):null]})});e.s(["default",0,C],388846);var O=e.i(554191),E=e.i(143696),M=e.i(803913);e.s(["default",0,function(e={}){let{autoHideDuration:n=null,disableWindowBlurListener:r=!1,onClose:i,open:o,resumeHideDuration:s}=e,a=(0,E.default)();t.useEffect(()=>{if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"!==e.key||i?.(e,"escapeKeyDown")}},[o,i]);let l=(0,O.default)((e,t)=>{i?.(e,t)}),u=(0,O.default)(e=>{i&&null!=e&&a.start(e,()=>{l(null,"timeout")})});t.useEffect(()=>(o&&u(n),a.clear),[o,n,u,a]);let c=a.clear,d=t.useCallback(()=>{null!=n&&u(null!=s?s:.5*n)},[n,s,u]);return t.useEffect(()=>{if(!r&&o)return window.addEventListener("focus",d),window.addEventListener("blur",c),()=>{window.removeEventListener("focus",d),window.removeEventListener("blur",c)}},[r,o,d,c]),{getRootProps:(t={})=>{let n={...(0,M.default)(e),...(0,M.default)(t)};return{role:"presentation",...t,...n,onBlur:e=>{let t=n.onBlur;t?.(e),d()},onFocus:e=>{let t=n.onFocus;t?.(e),c()},onMouseEnter:e=>{let t=n.onMouseEnter;t?.(e),c()},onMouseLeave:e=>{let t=n.onMouseLeave;t?.(e),d()}}},onClickAway:e=>{i?.(e,"clickaway")}}}],698951)},842426,e=>{"use strict";function t(e){return e&&e.ownerDocument||document}e.s(["default",()=>t])},272866,e=>{"use strict";var t=e.i(187725);function n(e){return parseInt(t.version,10)>=19?e?.props?.ref||null:e?.ref||null}e.s(["default",()=>n])},914543,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(842426),r=e.i(995044),i=e.i(554191),o=e.i(272866);function s(e){return e.substring(2).toLowerCase()}function a(e){let{children:a,disableReactTree:l=!1,mouseEvent:u="onClick",onClickAway:c,touchEvent:d="onTouchEnd"}=e,h=t.useRef(!1),f=t.useRef(null),p=t.useRef(!1),g=t.useRef(!1);t.useEffect(()=>(setTimeout(()=>{p.current=!0},0),()=>{p.current=!1}),[]);let m=(0,r.default)((0,o.default)(a),f),v=(0,i.default)(e=>{let t=g.current;g.current=!1;let r=(0,n.default)(f.current);if(!(!p.current||!f.current||"clientX"in e&&(r.documentElement.clientWidth<e.clientX||r.documentElement.clientHeight<e.clientY))){if(h.current){h.current=!1;return}(e.composedPath?e.composedPath().includes(f.current):!r.documentElement.contains(e.target)||f.current.contains(e.target))||!l&&t||c(e)}}),y=e=>t=>{g.current=!0;let n=a.props[e];n&&n(t)},b={ref:m};return!1!==d&&(b[d]=y(d)),t.useEffect(()=>{if(!1!==d){let e=s(d),t=(0,n.default)(f.current),r=()=>{h.current=!0};return t.addEventListener(e,v),t.addEventListener("touchmove",r),()=>{t.removeEventListener(e,v),t.removeEventListener("touchmove",r)}}},[v,d]),!1!==u&&(b[u]=y(u)),t.useEffect(()=>{if(!1!==u){let e=s(u),t=(0,n.default)(f.current);return t.addEventListener(e,v),()=>{t.removeEventListener(e,v)}}},[v,u]),t.cloneElement(a,b)}e.s(["default",()=>a],914543)},726323,e=>{"use strict";e.i(316575);var t=e.i(382034),n=e.i(365946),r=e.i(187725),i=e.i(316245),o=e.i(914374),s="unmounted",a="exited",l="entering",u="entered",c="exiting",d=function(e){function d(t,n){var r,i=e.call(this,t,n)||this,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=a,i.appearStatus=l):r=u:r=t.unmountOnExit||t.mountOnEnter?s:a,i.state={status:r},i.nextCallback=null,i}(0,n.default)(d,e),d.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:a}:null};var h=d.prototype;return h.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},h.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==l&&n!==u&&(t=l):(n===l||n===u)&&(t=c)}this.updateStatus(!1,t)},h.componentWillUnmount=function(){this.cancelNextCallback()},h.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},h.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===l){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:i.default.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===a&&this.setState({status:s})},h.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[i.default.findDOMNode(this),r],s=o[0],a=o[1],c=this.getTimeouts(),d=r?c.appear:c.enter;(e||n)&&1?(this.props.onEnter(s,a),this.safeSetState({status:l},function(){t.props.onEntering(s,a),t.onTransitionEnd(d,function(){t.safeSetState({status:u},function(){t.props.onEntered(s,a)})})})):this.safeSetState({status:u},function(){t.props.onEntered(s)})},h.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:i.default.findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:c},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:a},function(){e.props.onExited(r)})})})):this.safeSetState({status:a},function(){e.props.onExited(r)})},h.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},h.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},h.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},h.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:i.default.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=o[0],a=o[1];this.props.addEndListener(s,a)}null!=e&&setTimeout(this.nextCallback,e)},h.render=function(){var e=this.state.status;if(e===s)return null;var n=this.props,i=n.children,a=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,(0,t.default)(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.default.createElement(o.default.Provider,{value:null},"function"==typeof i?i(e,a):r.default.cloneElement(r.default.Children.only(i),a))},d}(r.default.Component);function h(){}d.contextType=o.default,d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},d.UNMOUNTED=s,d.EXITED=a,d.ENTERING=l,d.ENTERED=u,d.EXITING=c,e.s(["Transition",0,d],726323)},155062,e=>{"use strict";function t(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??("number"==typeof n?n:n[t.mode]||0),easing:i.transitionTimingFunction??("object"==typeof r?r[t.mode]:r),delay:i.transitionDelay}}e.s(["getTransitionProps",()=>t,"reflow",0,e=>e.scrollTop])},401440,e=>{"use strict";var t=e.i(187725),n=e.i(143696),r=e.i(272866),i=e.i(726323),o=e.i(811347),s=e.i(155062),a=e.i(723938),l=e.i(19483);function u(e){return`scale(${e}, ${e**2})`}let c={entering:{opacity:1,transform:u(1)},entered:{opacity:1,transform:"none"}},d="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),h=t.forwardRef(function(e,h){let{addEndListener:f,appear:p=!0,children:g,easing:m,in:v,onEnter:y,onEntered:b,onEntering:x,onExit:w,onExited:_,onExiting:k,style:S,timeout:C="auto",TransitionComponent:O=i.Transition,...E}=e,M=(0,n.default)(),A=t.useRef(),P=(0,o.useTheme)(),T=t.useRef(null),R=(0,a.default)(T,(0,r.default)(g),h),I=e=>t=>{if(e){let n=T.current;void 0===t?e(n):e(n,t)}},D=I(x),L=I((e,t)=>{let n;(0,s.reflow)(e);let{duration:r,delay:i,easing:o}=(0,s.getTransitionProps)({style:S,timeout:C,easing:m},{mode:"enter"});"auto"===C?A.current=n=P.transitions.getAutoHeightDuration(e.clientHeight):n=r,e.style.transition=[P.transitions.create("opacity",{duration:n,delay:i}),P.transitions.create("transform",{duration:d?n:.666*n,delay:i,easing:o})].join(","),y&&y(e,t)}),j=I(b),N=I(k),F=I(e=>{let t,{duration:n,delay:r,easing:i}=(0,s.getTransitionProps)({style:S,timeout:C,easing:m},{mode:"exit"});"auto"===C?A.current=t=P.transitions.getAutoHeightDuration(e.clientHeight):t=n,e.style.transition=[P.transitions.create("opacity",{duration:t,delay:r}),P.transitions.create("transform",{duration:d?t:.666*t,delay:d?r:r||.333*t,easing:i})].join(","),e.style.opacity=0,e.style.transform=u(.75),w&&w(e)}),B=I(_);return(0,l.jsx)(O,{appear:p,in:v,nodeRef:T,onEnter:L,onEntered:j,onEntering:D,onExit:F,onExited:B,onExiting:N,addEndListener:e=>{"auto"===C&&M.start(A.current||0,e),f&&f(T.current,e)},timeout:"auto"===C?null:C,...E,children:(e,{ownerState:n,...r})=>t.cloneElement(g,{style:{opacity:0,transform:u(.75),visibility:"exited"!==e||v?void 0:"hidden",...c[e],...S,...g.props.style},ref:R,...r})})});h&&(h.muiSupportAuto=!0),e.s(["default",0,h])},968235,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(778024),r=e.i(698951),i=e.i(914543),o=e.i(446547),s=e.i(811347),a=e.i(73205),l=e.i(519273),u=e.i(578509),c=e.i(401440),d=e.i(7284),h=e.i(896425),f=e.i(966196),p=e.i(435983),g=e.i(446519);function m(e){return(0,g.default)("MuiSnackbarContent",e)}(0,p.default)("MuiSnackbarContent",["root","message","action"]);var v=e.i(19483);let y=(0,o.styled)(f.default,{name:"MuiSnackbarContent",slot:"Root"})((0,a.default)(({theme:e})=>{let t="light"===e.palette.mode?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText((0,h.emphasize)(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:(0,h.emphasize)(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),b=(0,o.styled)("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),x=(0,o.styled)("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),w=t.forwardRef(function(e,t){let r=(0,l.useDefaultProps)({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...u}=r,c=(e=>{let{classes:t}=e;return(0,n.default)({root:["root"],action:["action"],message:["message"]},m,t)})(r);return(0,v.jsxs)(y,{role:a,elevation:6,className:(0,d.default)(c.root,o),ownerState:r,ref:t,...u,children:[(0,v.jsx)(b,{className:c.message,ownerState:r,children:s}),i?(0,v.jsx)(x,{className:c.action,ownerState:r,children:i}):null]})});function _(e){return(0,g.default)("MuiSnackbar",e)}(0,p.default)("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);var k=e.i(577950);let S=(0,o.styled)("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`anchorOrigin${(0,u.default)(n.anchorOrigin.vertical)}${(0,u.default)(n.anchorOrigin.horizontal)}`]]}})((0,a.default)(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>"top"===e.anchorOrigin.vertical,style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>"top"!==e.anchorOrigin.vertical,style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>"left"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>"right"===e.anchorOrigin.horizontal,style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>"center"===e.anchorOrigin.horizontal,style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),C=t.forwardRef(function(e,o){let a=(0,l.useDefaultProps)({props:e,name:"MuiSnackbar"}),d=(0,s.useTheme)(),h={enter:d.transitions.duration.enteringScreen,exit:d.transitions.duration.leavingScreen},{action:f,anchorOrigin:{vertical:p,horizontal:g}={vertical:"bottom",horizontal:"left"},autoHideDuration:m=null,children:y,className:b,ClickAwayListenerProps:x,ContentProps:C,disableWindowBlurListener:O=!1,message:E,onBlur:M,onClose:A,onFocus:P,onMouseEnter:T,onMouseLeave:R,open:I,resumeHideDuration:D,slots:L={},slotProps:j={},TransitionComponent:N,transitionDuration:F=h,TransitionProps:{onEnter:B,onExited:z,...V}={},...H}=a,$={...a,anchorOrigin:{vertical:p,horizontal:g},autoHideDuration:m,disableWindowBlurListener:O,TransitionComponent:N,transitionDuration:F},W=(e=>{let{classes:t,anchorOrigin:r}=e,i={root:["root",`anchorOrigin${(0,u.default)(r.vertical)}${(0,u.default)(r.horizontal)}`]};return(0,n.default)(i,_,t)})($),{getRootProps:U,onClickAway:q}=(0,r.default)($),[Q,K]=t.useState(!0),G={slots:{transition:N,...L},slotProps:{content:C,clickAwayListener:x,transition:V,...j}},[X,Y]=(0,k.default)("root",{ref:o,className:[W.root,b],elementType:S,getSlotProps:U,externalForwardedProps:{...G,...H},ownerState:$}),[Z,{ownerState:J,...ee}]=(0,k.default)("clickAwayListener",{elementType:i.default,externalForwardedProps:G,getSlotProps:e=>({onClickAway:(...t)=>{let n=t[0];e.onClickAway?.(...t),n?.defaultMuiPrevented||q(...t)}}),ownerState:$}),[et,en]=(0,k.default)("content",{elementType:w,shouldForwardComponentProp:!0,externalForwardedProps:G,additionalProps:{message:E,action:f},ownerState:$}),[er,ei]=(0,k.default)("transition",{elementType:c.default,externalForwardedProps:G,getSlotProps:e=>({onEnter:(...t)=>{e.onEnter?.(...t),((e,t)=>{K(!1),B&&B(e,t)})(...t)},onExited:(...t)=>{e.onExited?.(...t),(e=>{K(!0),z&&z(e)})(...t)}}),additionalProps:{appear:!0,in:I,timeout:F,direction:"top"===p?"down":"up"},ownerState:$});return!I&&Q?null:(0,v.jsx)(Z,{...ee,...L.clickAwayListener&&{ownerState:J},children:(0,v.jsx)(X,{...Y,children:(0,v.jsx)(er,{...ei,children:y||(0,v.jsx)(et,{...en})})})})});e.s(["default",0,C],968235)},336277,847765,641543,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(456132),i=e.i(446519),o=e.i(778024);let s=(0,e.i(450206).default)();e.s(["default",0,s],847765);var a=e.i(444255),l=e.i(300);function u({props:e,name:t,defaultTheme:n,themeId:r}){let i=(0,l.default)(n);return r&&(i=i[r]||i),function(e){let{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,a.default)(t.components[n].defaultProps,r):r}({theme:i,name:t,props:e})}e.s(["default",()=>u],641543);var c=e.i(870264),d=e.i(315605),h=e.i(665058),f=e.i(274594),p=e.i(19483);let g=(0,d.default)(),m=s("div",{name:"MuiStack",slot:"Root"});function v(e){return u({props:e,name:"MuiStack",defaultTheme:g})}let y=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...(0,h.handleBreakpoints)({theme:t},(0,h.resolveBreakpointValues)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){let i=(0,f.createUnarySpacing)(t),o=Object.keys(t.breakpoints.values).reduce((t,n)=>(("object"==typeof e.spacing&&null!=e.spacing[n]||"object"==typeof e.direction&&null!=e.direction[n])&&(t[n]=!0),t),{}),s=(0,h.resolveBreakpointValues)({values:e.direction,base:o}),a=(0,h.resolveBreakpointValues)({values:e.spacing,base:o});"object"==typeof s&&Object.keys(s).forEach((e,t,n)=>{if(!s[e]){let r=t>0?s[n[t-1]]:"column";s[e]=r}}),n=(0,r.default)(n,(0,h.handleBreakpoints)({theme:t},a,(t,n)=>e.useFlexGap?{gap:(0,f.getValue)(i,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[n?s[n]:e.direction]}`]:(0,f.getValue)(i,t)}}))}return(0,h.mergeBreakpointsInOrder)(t.breakpoints,n)};var b=e.i(117792),x=e.i(519273);let w=function(e={}){let{createStyledComponent:r=m,useThemeProps:s=v,componentName:a="MuiStack"}=e,l=r(y);return t.forwardRef(function(e,r){let u,d=s(e),{component:h="div",direction:f="column",spacing:g=0,divider:m,children:v,className:y,useFlexGap:b=!1,...x}=(0,c.extendSxProp)(d),w=(0,o.default)({root:["root"]},e=>(0,i.default)(a,e),{});return(0,p.jsx)(l,{as:h,ownerState:{direction:f,spacing:g,useFlexGap:b},ref:r,className:(0,n.default)(w.root,y),...x,children:m?(u=t.Children.toArray(v).filter(Boolean)).reduce((e,n,r)=>(e.push(n),r<u.length-1&&e.push(t.cloneElement(m,{key:`separator-${r}`})),e),[]):v})})}({createStyledComponent:(0,b.default)("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>(0,x.useDefaultProps)({props:e,name:"MuiStack"})});e.s(["default",0,w],336277)},377855,e=>{"use strict";var t=e.i(19483),n=e.i(388846),r=e.i(924011),i=e.i(968235),o=e.i(336277),s=e.i(427938),a=e.i(187725);let l=0,u=new Set,c={create:e=>{let t=e.id||`toast-${++l}`;return u.forEach(n=>n({type:"create",options:{...e,id:t}})),t},success:e=>c.create({...e,type:"success"}),error:e=>c.create({...e,type:"error"}),warning:e=>c.create({...e,type:"warning"}),info:e=>c.create({...e,type:"info"}),loading:e=>c.create({...e,type:"loading"}),dismiss:e=>{u.forEach(t=>t({type:"dismiss",id:e}))},remove:e=>{u.forEach(t=>t({type:"dismiss",id:e}))},update:(e,t)=>{u.forEach(n=>n({type:"update",id:e,options:t}))},subscribe:e=>(u.add(e),()=>u.delete(e))};function d(){let[e,u]=(0,a.useState)([]);(0,a.useState)(()=>c.subscribe(e=>{if("create"===e.type&&e.options){let t={id:e.options.id||`toast-${++l}`,open:!0,duration:"loading"===e.options.type?void 0:e.options.duration??5e3,closable:e.options.closable??!0,...e.options};u(e=>[...e.filter(e=>e.id!==t.id),t])}else if("dismiss"===e.type&&e.id){let t=e.id;u(e=>e.map(e=>e.id===t?{...e,open:!1}:e)),setTimeout(()=>{u(e=>e.filter(e=>e.id!==t))},300)}else"update"===e.type&&e.id&&e.options&&u(t=>t.map(t=>t.id===e.id?{...t,...e.options}:t))}));let d=e=>{u(t=>t.map(t=>t.id===e?{...t,open:!1}:t)),setTimeout(()=>{u(t=>t.filter(t=>t.id!==e))},300)};return(0,t.jsx)(t.Fragment,{children:e.map(e=>(0,t.jsx)(i.default,{open:e.open,autoHideDuration:e.duration,onClose:()=>e.closable&&d(e.id),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(n.default,{severity:"loading"===e.type?"info":e.type||"info",onClose:e.closable?()=>d(e.id):void 0,icon:"loading"===e.type?(0,t.jsx)(r.default,{size:20,color:"inherit"}):void 0,sx:{width:"100%",minWidth:300},children:(0,t.jsxs)(o.default,{spacing:.5,children:[e.title&&(0,t.jsx)(s.default,{variant:"subtitle2",fontWeight:"bold",children:e.title}),e.description&&(0,t.jsx)(s.default,{variant:"body2",component:"div",children:e.description})]})})},e.id))})}e.s(["Toaster",()=>d,"toaster",0,c])},608839,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},n=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function r(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>r,"timeoutManager",()=>n])},204039,e=>{"use strict";var t=e.i(608839),n="undefined"==typeof window||"Deno"in globalThis;function r(){}function i(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function a(e,t){return"function"==typeof e?e(t):e}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==d(s,t.options))return!1}else if(!f(t.queryKey,s))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!o||!!o(t))}function c(e,t){let{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(h(t.options.mutationKey)!==h(o))return!1}else if(!f(t.options.mutationKey,o))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function d(e,t){return(t?.queryKeyHashFn||h)(e)}function h(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function f(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(n=>f(e[n],t[n]))}var p=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function m(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!y(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(n=>{t.timeoutManager.setTimeout(n,e)})}function x(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n){if(t===n)return t;let r=m(t)&&m(n);if(!r&&!(v(t)&&v(n)))return n;let i=(r?t:Object.keys(t)).length,o=r?n:Object.keys(n),s=o.length,a=r?Array(s):{},l=0;for(let u=0;u<s;u++){let s=r?u:o[u],c=t[s],d=n[s];if(c===d){a[s]=c,(r?u<i:p.call(t,s))&&l++;continue}if(null===c||null===d||"object"!=typeof c||"object"!=typeof d){a[s]=d;continue}let h=e(c,d);a[s]=h,h===c&&l++}return i===s&&l===i?t:a}(e,t):t}function w(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function _(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function S(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==k?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}e.s(["addToEnd",()=>w,"addToStart",()=>_,"ensureQueryFn",()=>S,"functionalUpdate",()=>i,"hashKey",()=>h,"hashQueryKeyByOptions",()=>d,"isServer",()=>n,"isValidTimeout",()=>o,"matchMutation",()=>c,"matchQuery",()=>u,"noop",()=>r,"partialMatchKey",()=>f,"replaceData",()=>x,"resolveEnabled",()=>l,"resolveStaleTime",()=>a,"shallowEqualObjects",()=>g,"shouldThrowError",()=>C,"skipToken",()=>k,"sleep",()=>b,"timeUntilStale",()=>s])},889747,e=>{"use strict";let t,n,r,i,o,s;var a=e.i(608839).systemSetTimeoutZero,l=(t=[],n=0,r=e=>{e()},i=e=>{e()},o=a,{batch:e=>{let s;n++;try{s=e()}finally{let e;--n||(e=t,t=[],e.length&&o(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return s},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s=e=>{n?t.push(e):o(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}});e.s(["notifyManager",()=>l])},879714,279743,935140,170434,297805,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t],279743);var n=e.i(204039),r=new class extends t{#n;#r;#i;constructor(){super(),this.#i=e=>{if(!n.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#i=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>r],935140);var i=new class extends t{#o=!0;#r;#i;constructor(){super(),this.#i=e=>{if(!n.isServer&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#i=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function o(){let e,t,n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function s(e){return Math.min(1e3*2**e,3e4)}function a(e){return(e??"online")!=="online"||i.isOnline()}e.s(["onlineManager",()=>i],170434),e.s(["pendingThenable",()=>o],297805);var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){let t,u=!1,c=0,d=o(),h=()=>r.isFocused()&&("always"===e.networkMode||i.isOnline())&&e.canRun(),f=()=>a(e.networkMode)&&e.canRun(),p=e=>{"pending"===d.status&&(t?.(),d.resolve(e))},g=e=>{"pending"===d.status&&(t?.(),d.reject(e))},m=()=>new Promise(n=>{t=e=>{("pending"!==d.status||h())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===d.status&&e.onContinue?.()}),v=()=>{let t;if("pending"!==d.status)return;let r=0===c?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if("pending"!==d.status)return;let r=e.retry??3*!n.isServer,i=e.retryDelay??s,o="function"==typeof i?i(c,t):i,a=!0===r||"number"==typeof r&&c<r||"function"==typeof r&&r(c,t);u||!a?g(t):(c++,e.onFail?.(c,t),(0,n.sleep)(o).then(()=>h()?void 0:m()).then(()=>{u?g(t):v()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let n=new l(t);g(n),e.onCancel?.(n)}},continue:()=>(t?.(),d),cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1},canStart:f,start:()=>(f()?v():m().then(v),d)}}e.s(["CancelledError",()=>l,"canFetch",()=>a,"createRetryer",()=>u],879714)},702872,e=>{"use strict";var t=e.i(608839),n=e.i(204039),r=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.isValidTimeout)(this.gcTime)&&(this.#s=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.isServer?1/0:3e5))}clearGcTimeout(){this.#s&&(t.timeoutManager.clearTimeout(this.#s),this.#s=void 0)}};e.s(["Removable",()=>r])},868259,e=>{"use strict";var t=e.i(204039),n=e.i(889747),r=e.i(879714),i=e.i(702872),o=class extends i.Removable{#a;#l;#u;#c;#d;#h;#f;constructor(e){super(),this.#f=!1,this.#h=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=l(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#h,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=l(this.options);void 0!==e.data&&(this.setState(a(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,n){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let n=this.#d?.promise;return this.#d?.cancel(e),n?n.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#f?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,n){let i;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let o=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,o.signal)})},a=()=>{let e,r=(0,t.ensureQueryFn)(this.options,n),i=(s(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},l=(s(i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(l,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#p({type:"fetch",meta:l.fetchOptions?.meta}),this.#d=(0,r.createRetryer)({initialPromise:n?.initialPromise,fn:l.fetchFn,onCancel:e=>{e instanceof r.CancelledError&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),o.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof r.CancelledError){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...s(t.data,this.options),fetchMeta:e.meta??null};case"success":let n={...t,...a(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?n:void 0,n;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),n.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,r.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function a(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function l(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>o,"fetchState",()=>s])},833679,e=>{"use strict";var t=e.i(204039),n=e.i(868259),r=e.i(889747),i=e.i(279743),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#g=new Map}#g;build(e,r,i){let o=r.queryKey,s=r.queryHash??(0,t.hashQueryKeyByOptions)(o,r),a=this.get(s);return a||(a=new n.Query({client:e,queryKey:o,queryHash:s,options:e.defaultQueryOptions(r),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(a)),a}add(e){this.#g.has(e.queryHash)||(this.#g.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#g.get(e.queryHash);t&&(e.destroy(),t===e&&this.#g.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#g.get(e)}getAll(){return[...this.#g.values()]}find(e){let n={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(n,e))}findAll(e={}){let n=this.getAll();return Object.keys(e).length>0?n.filter(n=>(0,t.matchQuery)(e,n)):n}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};e.s(["QueryCache",()=>o])},599973,e=>{"use strict";var t=e.i(889747),n=e.i(702872),r=e.i(879714),i=class extends n.Removable{#c;#m;#v;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#v=e.mutationCache,this.#m=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#m.includes(e)||(this.#m.push(e),this.clearGcTimeout(),this.#v.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#m=this.#m.filter(t=>t!==e),this.scheduleGc(),this.#v.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#m.length||("pending"===this.state.status?this.scheduleGc():this.#v.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#p({type:"continue"})},n={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=(0,r.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#v.canRun(this)});let i="pending"===this.state.status,o=!this.#d.canStart();try{if(i)t();else{this.#p({type:"pending",variables:e,isPaused:o}),await this.#v.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#p({type:"pending",context:t,variables:e,isPaused:o})}let r=await this.#d.start();return await this.#v.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#v.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#p({type:"success",data:r}),r}catch(t){try{throw await this.#v.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#v.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#p({type:"error",error:t})}}finally{this.#v.runNext(this)}}#p(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#m.forEach(t=>{t.onMutationUpdate(e)}),this.#v.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",()=>i,"getDefaultState",()=>o])},224675,e=>{"use strict";var t=e.i(204039),n=e.i(833679),r=e.i(889747),i=e.i(599973),o=e.i(279743),s=class extends o.Subscribable{constructor(e={}){super(),this.config=e,this.#y=new Set,this.#b=new Map,this.#x=0}#y;#b;#x;build(e,t,n){let r=new i.Mutation({client:e,mutationCache:this,mutationId:++this.#x,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#y.add(e);let t=a(e);if("string"==typeof t){let n=this.#b.get(t);n?n.push(e):this.#b.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#y.delete(e)){let t=a(e);if("string"==typeof t){let n=this.#b.get(t);if(n)if(n.length>1){let t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#b.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=a(e);if("string"!=typeof t)return!0;{let n=this.#b.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=a(e);if("string"!=typeof t)return Promise.resolve();{let n=this.#b.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}}clear(){r.notifyManager.batch(()=>{this.#y.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#y.clear(),this.#b.clear()})}getAll(){return Array.from(this.#y)}find(e){let n={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(n,e))}findAll(e={}){return this.getAll().filter(n=>(0,t.matchMutation)(e,n))}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function a(e){return e.options.scope?.id}var l=e.i(935140),u=e.i(170434);function c(e){return{onFetch:(n,r)=>{let i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,s=n.state.data?.pages||[],a=n.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,c=async()=>{let r=!1,c=(0,t.ensureQueryFn)(n.options,n.fetchOptions),h=async(e,i,o)=>{let s;if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let a=(Object.defineProperty(s={client:n.client,queryKey:n.queryKey,pageParam:i,direction:o?"backward":"forward",meta:n.options.meta},"signal",{enumerable:!0,get:()=>(n.signal.aborted?r=!0:n.signal.addEventListener("abort",()=>{r=!0}),n.signal)}),s),l=await c(a),{maxPages:u}=n.options,d=o?t.addToStart:t.addToEnd;return{pages:d(e.pages,l,u),pageParams:d(e.pageParams,i,u)}};if(o&&s.length){let e="backward"===o,t={pages:s,pageParams:a},n=(e?function(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}:d)(i,t);l=await h(t,n,e)}else{let t=e??s.length;do{let e=0===u?a[0]??i.initialPageParam:d(i,l);if(u>0&&null==e)break;l=await h(l,e),u++}while(u<t)}return l};n.options.persister?n.fetchFn=()=>n.options.persister?.(c,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=c}}}function d(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}var h=class{#w;#v;#h;#_;#k;#S;#C;#O;constructor(e={}){this.#w=e.queryCache||new n.QueryCache,this.#v=e.mutationCache||new s,this.#h=e.defaultOptions||{},this.#_=new Map,this.#k=new Map,this.#S=0}mount(){this.#S++,1===this.#S&&(this.#C=l.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onFocus())}),this.#O=u.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onOnline())}))}unmount(){this.#S--,0===this.#S&&(this.#C?.(),this.#C=void 0,this.#O?.(),this.#O=void 0)}isFetching(e){return this.#w.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#v.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state.data}ensureQueryData(e){let n=this.defaultQueryOptions(e),r=this.#w.build(this,n),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,t.resolveStaleTime)(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#w.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,n,r){let i=this.defaultQueryOptions({queryKey:e}),o=this.#w.get(i.queryHash),s=o?.state.data,a=(0,t.functionalUpdate)(n,s);if(void 0!==a)return this.#w.build(this,i).setData(a,{...r,manual:!0})}setQueriesData(e,t,n){return r.notifyManager.batch(()=>this.#w.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state}removeQueries(e){let t=this.#w;r.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#w;return r.notifyManager.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,n={}){let i={revert:!0,...n};return Promise.all(r.notifyManager.batch(()=>this.#w.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return r.notifyManager.batch(()=>(this.#w.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,n={}){let i={...n,cancelRefetch:n.cancelRefetch??!0};return Promise.all(r.notifyManager.batch(()=>this.#w.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let n=e.fetch(void 0,i);return i.throwOnError||(n=n.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():n}))).then(t.noop)}fetchQuery(e){let n=this.defaultQueryOptions(e);void 0===n.retry&&(n.retry=!1);let r=this.#w.build(this,n);return r.isStaleByTime((0,t.resolveStaleTime)(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=c(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=c(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return u.onlineManager.isOnline()?this.#v.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#w}getMutationCache(){return this.#v}getDefaultOptions(){return this.#h}setDefaultOptions(e){this.#h=e}setQueryDefaults(e,n){this.#_.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){let n=[...this.#_.values()],r={};return n.forEach(n=>{(0,t.partialMatchKey)(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,n){this.#k.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){let n=[...this.#k.values()],r={};return n.forEach(n=>{(0,t.partialMatchKey)(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let n={...this.#h.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=(0,t.hashQueryKeyByOptions)(n.queryKey,n)),void 0===n.refetchOnReconnect&&(n.refetchOnReconnect="always"!==n.networkMode),void 0===n.throwOnError&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===t.skipToken&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#h.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#w.clear(),this.#v.clear()}};e.s(["QueryClient",()=>h],224675)},31368,e=>{"use strict";let t,n,r,i;var o,s,a,l,u=e.i(316575);function c(e,t){return function(){return e.apply(t,arguments)}}let{toString:d}=Object.prototype,{getPrototypeOf:h}=Object,{iterator:f,toStringTag:p}=Symbol,g=(t=Object.create(null),e=>{let n=d.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())}),m=e=>(e=e.toLowerCase(),t=>g(t)===e),v=e=>t=>typeof t===e,{isArray:y}=Array,b=v("undefined");function x(e){return null!==e&&!b(e)&&null!==e.constructor&&!b(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let w=m("ArrayBuffer"),_=v("string"),k=v("function"),S=v("number"),C=e=>null!==e&&"object"==typeof e,O=e=>{if("object"!==g(e))return!1;let t=h(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(p in e)&&!(f in e)},E=m("Date"),M=m("File"),A=m("Blob"),P=m("FileList"),T=m("URLSearchParams"),[R,I,D,L]=["ReadableStream","Request","Response","Headers"].map(m);function j(e,t,{allOwnKeys:n=!1}={}){let r,i;if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{let i;if(x(e))return;let o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function N(e,t){let n;if(x(e))return null;t=t.toLowerCase();let r=Object.keys(e),i=r.length;for(;i-- >0;)if(t===(n=r[i]).toLowerCase())return n;return null}let F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g,B=e=>!b(e)&&e!==F,z=(n="undefined"!=typeof Uint8Array&&h(Uint8Array),e=>n&&e instanceof n),V=m("HTMLFormElement"),H=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),$=m("RegExp"),W=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};j(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)},U=m("AsyncFunction"),q=(o="function"==typeof setImmediate,s=k(F.postMessage),o?setImmediate:s?(a=`axios@${Math.random()}`,l=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===a&&l.length&&l.shift()()},!1),e=>{l.push(e),F.postMessage(a,"*")}):e=>setTimeout(e)),Q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):void 0!==u.default&&u.default.nextTick||q,K={isArray:y,isArrayBuffer:w,isBuffer:x,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||k(e.append)&&("formdata"===(t=g(e))||"object"===t&&k(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer)},isString:_,isNumber:S,isBoolean:e=>!0===e||!1===e,isObject:C,isPlainObject:O,isEmptyObject:e=>{if(!C(e)||x(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:I,isResponse:D,isHeaders:L,isUndefined:b,isDate:E,isFile:M,isBlob:A,isRegExp:$,isFunction:k,isStream:e=>C(e)&&k(e.pipe),isURLSearchParams:T,isTypedArray:z,isFileList:P,forEach:j,merge:function e(){let{caseless:t,skipUndefined:n}=B(this)&&this||{},r={},i=(i,o)=>{let s=t&&N(r,o)||o;O(r[s])&&O(i)?r[s]=e(r[s],i):O(i)?r[s]=e({},i):y(i)?r[s]=i.slice():n&&b(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&j(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(j(t,(t,r)=>{n&&k(t)?e[r]=c(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s,a={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=!1!==n&&h(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype)return t},kindOf:g,kindOfTest:m,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return -1!==r&&r===n},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!S(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,r=(e&&e[f]).call(e);for(;(n=r.next())&&!n.done;){let r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let n,r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:V,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:W,freezeMethods:e=>{W(e,(t,n)=>{if(k(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(k(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(y(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:N,global:F,isContextDefined:B,isSpecCompliantForm:function(e){return!!(e&&k(e.append)&&"FormData"===e[p]&&e[f])},toJSONObject:e=>{let t=Array(10),n=(e,r)=>{if(C(e)){if(t.indexOf(e)>=0)return;if(x(e))return e;if(!("toJSON"in e)){t[r]=e;let i=y(e)?[]:{};return j(e,(e,t)=>{let o=n(e,r+1);b(o)||(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:U,isThenable:e=>e&&(C(e)||k(e))&&k(e.then)&&k(e.catch),setImmediate:q,asap:Q,isIterable:e=>null!=e&&k(e[f])};var G=e.i(415306);function X(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});let Y=X.prototype,Z={};function J(e){return K.isPlainObject(e)||K.isArray(e)}function ee(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function et(e,t,n){return e?e.concat(t).map(function(e,t){return e=ee(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Z[e]={value:e}}),Object.defineProperties(X,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),X.from=(e,t,n,r,i,o)=>{let s=Object.create(Y);K.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);let a=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return X.call(s,a,l,n,r,i),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};let en=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)}),er=function(e,t,n){if(!K.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!K.isUndefined(t[e])})).metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(K.isBoolean(e))return e.toString();if(!a&&K.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):G.Buffer.from(e):e}function u(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else{var u;if(K.isArray(e)&&(u=e,K.isArray(u)&&!u.some(J))||(K.isFileList(e)||K.endsWith(n,"[]"))&&(a=K.toArray(e)))return n=ee(n),a.forEach(function(e,r){K.isUndefined(e)||null===e||t.append(!0===s?et([n],r,o):null===s?n:n+"[]",l(e))}),!1}return!!J(e)||(t.append(et(i,n,o),l(e)),!1)}let c=[],d=Object.assign(en,{defaultVisitor:u,convertValue:l,isVisitable:J});if(!K.isObject(e))throw TypeError("data must be an object");return!function e(n,r){if(!K.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),K.forEach(n,function(n,o){!0===(!(K.isUndefined(n)||null===n)&&i.call(t,n,K.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])}),c.pop()}}(e),t};function ei(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function eo(e,t){this._pairs=[],e&&er(e,this,t)}let es=eo.prototype;function ea(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function el(e,t,n){let r;if(!t)return e;let i=n&&n.encode||ea;K.isFunction(n)&&(n={serialize:n});let o=n&&n.serialize;if(r=o?o(t,n):K.isURLSearchParams(t)?t.toString():new eo(t,n).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}es.append=function(e,t){this._pairs.push([e,t])},es.toString=function(e){let t=e?function(t){return e.call(this,t,ei)}:ei;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let eu=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(t){null!==t&&e(t)})}},ec={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ed="undefined"!=typeof URLSearchParams?URLSearchParams:eo,eh="undefined"!=typeof FormData?FormData:null,ef="undefined"!=typeof Blob?Blob:null,ep="undefined"!=typeof window&&"undefined"!=typeof document,eg="object"==typeof navigator&&navigator||void 0,em=ep&&(!eg||0>["ReactNative","NativeScript","NS"].indexOf(eg.product)),ev="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ey=ep&&window.location.href||"http://localhost";e.s(["hasBrowserEnv",()=>ep,"hasStandardBrowserEnv",()=>em,"hasStandardBrowserWebWorkerEnv",()=>ev,"navigator",()=>eg,"origin",()=>ey],52597);let eb={...e.i(52597),isBrowser:!0,classes:{URLSearchParams:ed,FormData:eh,Blob:ef},protocols:["http","https","file","blob","url","data"]},ex=function(e){if(K.isFormData(e)&&K.isFunction(e.entries)){let t={};return K.forEachEntry(e,(e,n)=>{!function e(t,n,r,i){let o=t[i++];if("__proto__"===o)return!0;let s=Number.isFinite(+o),a=i>=t.length;return(o=!o&&K.isArray(r)?r.length:o,a)?K.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n:(r[o]&&K.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&K.isArray(r[o])&&(r[o]=function(e){let t,n,r={},i=Object.keys(e),o=i.length;for(t=0;t<o;t++)r[n=i[t]]=e[n];return r}(r[o]))),!s}(K.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null},ew={transitional:ec,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,r=t.getContentType()||"",i=r.indexOf("application/json")>-1,o=K.isObject(e);if(o&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return i?JSON.stringify(ex(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1){var s,a;return(s=e,a=this.formSerializer,er(s,new eb.classes.URLSearchParams,{visitor:function(e,t,n,r){return eb.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...a})).toString()}if((n=K.isFileList(e))||r.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return er(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(o||i){t.setContentType("application/json",!1);var l=e;if(K.isString(l))try{return(0,JSON.parse)(l),K.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||ew.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw X.from(e,X.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eb.classes.FormData,Blob:eb.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{ew.headers[e]={}});let e_=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ek=Symbol("internals");function eS(e){return e&&String(e).trim().toLowerCase()}function eC(e){return!1===e||null==e?e:K.isArray(e)?e.map(eC):String(e)}function eO(e,t,n,r,i){if(K.isFunction(r))return r.call(this,t,n);if(i&&(t=n),K.isString(t)){if(K.isString(r))return -1!==t.indexOf(r);if(K.isRegExp(r))return r.test(t)}}class eE{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=eS(t);if(!i)throw Error("header name must be a non-empty string");let o=K.findKey(r,i);o&&void 0!==r[o]&&!0!==n&&(void 0!==n||!1===r[o])||(r[o||t]=eC(e))}let o=(e,t)=>K.forEach(e,(e,n)=>i(e,n,t));if(K.isPlainObject(e)||e instanceof this.constructor)o(e,t);else{let r;if(K.isString(e)&&(e=e.trim())&&(r=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let n,r,i,a;o((a={},(s=e)&&s.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||a[n]&&e_[n]||("set-cookie"===n?a[n]?a[n].push(r):a[n]=[r]:a[n]=a[n]?a[n]+", "+r:r)}),a),t)}else if(K.isObject(e)&&K.isIterable(e)){let n={},r,i;for(let t of e){if(!K.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(r=n[i])?K.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=eS(e)){let n=K.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=r.exec(e);)n[t[1]]=t[2];return n}if(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=eS(e)){let n=K.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||eO(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=eS(e)){let i=K.findKey(n,e);i&&(!t||eO(n,n[i],i,t))&&(delete n[i],r=!0)}}return K.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||eO(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return K.forEach(this,(r,i)=>{let o=K.findKey(n,i);if(o){t[o]=eC(r),delete t[i];return}let s=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();s!==i&&delete t[i],t[s]=eC(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return K.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&K.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[ek]=this[ek]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=eS(e);if(!t[r]){let i;i=K.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{value:function(n,r,i){return this[t].call(this,e,n,r,i)},configurable:!0})}),t[r]=!0}}return K.isArray(e)?e.forEach(r):r(e),this}}function eM(e,t){let n=this||ew,r=t||n,i=eE.from(r.headers),o=r.data;return K.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eA(e){return!!(e&&e.__CANCEL__)}function eP(e,t,n){X.call(this,null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError"}function eT(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}eE.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(eE.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),K.freezeMethods(eE),K.inherits(eP,X,{__CANCEL__:!0});let eR=function(e,t){let n,r=Array(e=e||10),i=Array(e),o=0,s=0;return t=void 0!==t?t:1e3,function(a){let l=Date.now(),u=i[s];n||(n=l),r[o]=a,i[o]=l;let c=s,d=0;for(;c!==o;)d+=r[c++],c%=e;if((o=(o+1)%e)===s&&(s=(s+1)%e),l-n<t)return;let h=u&&l-u;return h?Math.round(1e3*d/h):void 0}},eI=function(e,t){let n,r,i=0,o=1e3/t,s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{let t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]},eD=(e,t,n=3)=>{let r=0,i=eR(50,250);return eI(n=>{let o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,l=i(a);r=o,e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},eL=(e,t)=>{let n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ej=e=>(...t)=>K.asap(()=>e(...t)),eN=eb.hasStandardBrowserEnv?(r=new URL(eb.origin),i=eb.navigator&&/(msie|trident)/i.test(eb.navigator.userAgent),e=>(e=new URL(e,eb.origin),r.protocol===e.protocol&&r.host===e.host&&(i||r.port===e.port))):()=>!0,eF=eb.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if("undefined"==typeof document)return;let a=[`${e}=${encodeURIComponent(t)}`];K.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&a.push(`path=${r}`),K.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),K.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function eB(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||!1==n)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let ez=e=>e instanceof eE?{...e}:e;function eV(e,t){t=t||{};let n={};function r(e,t,n,r){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:r},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function i(e,t,n,i){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e,n,i):r(e,t,n,i)}function o(e,t){if(!K.isUndefined(t))return r(void 0,t)}function s(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}let l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(ez(e),ez(t),n,!0)};return K.forEach(Object.keys({...e,...t}),function(r){let o=l[r]||i,s=o(e[r],t[r],r);K.isUndefined(s)&&o!==a||(n[r]=s)}),n}let eH=e=>{let t=eV({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=eE.from(s),t.url=el(eB(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),K.isFormData(n)){if(eb.hasStandardBrowserEnv||eb.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(K.isFunction(n.getHeaders)){let e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}}if(eb.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(t)),r||!1!==r&&eN(t.url))){let e=i&&o&&eF.read(o);e&&s.set(i,e)}return t},e$="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r;let i,o,s,a,l,u,c=eH(e),d=c.data,h=eE.from(c.headers).normalize(),{responseType:f,onUploadProgress:p,onDownloadProgress:g}=c;function m(){a&&a(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(i),c.signal&&c.signal.removeEventListener("abort",i)}let v=new XMLHttpRequest;function y(){if(!v)return;let r=eE.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());eT(function(e){t(e),m()},function(e){n(e),m()},{data:f&&"text"!==f&&"json"!==f?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v}),v=null}v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||4!==v.readyState||(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(y)},v.onabort=function(){v&&(n(new X("Request aborted",X.ECONNABORTED,e,v)),v=null)},v.onerror=function(t){let r=new X(t&&t.message?t.message:"Network Error",X.ERR_NETWORK,e,v);r.event=t||null,n(r),v=null},v.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||ec;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new X(t,r.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,v)),v=null},void 0===d&&h.setContentType(null),"setRequestHeader"in v&&K.forEach(h.toJSON(),function(e,t){v.setRequestHeader(t,e)}),K.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),f&&"json"!==f&&(v.responseType=c.responseType),g&&([s,l]=eD(g,!0),v.addEventListener("progress",s)),p&&v.upload&&([o,a]=eD(p),v.upload.addEventListener("progress",o),v.upload.addEventListener("loadend",a)),(c.cancelToken||c.signal)&&(i=t=>{v&&(n(!t||t.type?new eP(null,e,v):t),v.abort(),v=null)},c.cancelToken&&c.cancelToken.subscribe(i),c.signal&&(c.signal.aborted?i():c.signal.addEventListener("abort",i)));let b=(r=c.url,(u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r))&&u[1]||"");b&&-1===eb.protocols.indexOf(b)?n(new X("Unsupported protocol "+b+":",X.ERR_BAD_REQUEST,e)):v.send(d||null)})},eW=function*(e,t){let n,r=e.byteLength;if(!t||r<t)return void(yield e);let i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},eU=async function*(e,t){for await(let n of eq(e))yield*eW(n,t)},eq=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},eQ=(e,t,n,r)=>{let i,o=eU(e,t),s=0,a=e=>{!i&&(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await o.next();if(t){a(),e.close();return}let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:eK}=K,eG=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:eX,TextEncoder:eY}=K.global,eZ=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},eJ=e=>{let t,{fetch:n,Request:r,Response:i}=e=K.merge.call({skipUndefined:!0},eG,e),o=n?eK(n):"function"==typeof fetch,s=eK(r),a=eK(i);if(!o)return!1;let l=o&&eK(eX),u=o&&("function"==typeof eY?(t=new eY,e=>t.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer())),c=s&&l&&eZ(()=>{let e=!1,t=new r(eb.origin,{body:new eX,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&l&&eZ(()=>K.isReadableStream(new i("").body)),h={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{h[e]||(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new X(`Response type '${e}' is not supported`,X.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(null==e)return 0;if(K.isBlob(e))return e.size;if(K.isSpecCompliantForm(e)){let t=new r(eb.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e))?(await u(e)).byteLength:void 0},p=async(e,t)=>{let n=K.toFiniteNumber(e.getContentLength());return null==n?f(t):n};return async e=>{let t,{url:o,method:a,data:l,signal:u,cancelToken:f,timeout:g,onDownloadProgress:m,onUploadProgress:v,responseType:y,headers:b,withCredentials:x="same-origin",fetchOptions:w}=eH(e),_=n||fetch;y=y?(y+"").toLowerCase():"text";let k=((e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController,i=function(e){if(!n){n=!0,s();let t=e instanceof Error?e:this.reason;r.abort(t instanceof X?t:new eP(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{o=null,i(new X(`timeout ${t} of ms exceeded`,X.ETIMEDOUT))},t),s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));let{signal:a}=r;return a.unsubscribe=()=>K.asap(s),a}})([u,f&&f.toAbortSignal()],g),S=null,C=k&&k.unsubscribe&&(()=>{k.unsubscribe()});try{if(v&&c&&"get"!==a&&"head"!==a&&0!==(t=await p(b,l))){let e,n=new r(o,{method:"POST",body:l,duplex:"half"});if(K.isFormData(l)&&(e=n.headers.get("content-type"))&&b.setContentType(e),n.body){let[e,r]=eL(t,eD(ej(v)));l=eQ(n.body,65536,e,r)}}K.isString(x)||(x=x?"include":"omit");let n=s&&"credentials"in r.prototype,u={...w,signal:k,method:a.toUpperCase(),headers:b.normalize().toJSON(),body:l,duplex:"half",credentials:n?x:void 0};S=s&&new r(o,u);let f=await (s?_(S,w):_(o,u)),g=d&&("stream"===y||"response"===y);if(d&&(m||g&&C)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});let t=K.toFiniteNumber(f.headers.get("content-length")),[n,r]=m&&eL(t,eD(ej(m),!0))||[];f=new i(eQ(f.body,65536,n,()=>{r&&r(),C&&C()}),e)}y=y||"text";let O=await h[K.findKey(h,y)||"text"](f,e);return!g&&C&&C(),await new Promise((t,n)=>{eT(t,n,{data:O,headers:eE.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:S})})}catch(t){if(C&&C(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new X("Network Error",X.ERR_NETWORK,e,S),{cause:t.cause||t});throw X.from(t,t&&t.code,e,S)}}},e0=new Map,e1=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,o=[r,i,n],s=o.length,a,l,u=e0;for(;s--;)a=o[s],void 0===(l=u.get(a))&&u.set(a,l=s?new Map:eJ(t)),u=l;return l};e1();let e2={http:null,xhr:e$,fetch:{get:e1}};K.forEach(e2,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e5=e=>`- ${e}`,e3=e=>K.isFunction(e)||null===e||!1===e,e4=function(e,t){let n,r,{length:i}=e=K.isArray(e)?e:[e],o={};for(let s=0;s<i;s++){let i;if(r=n=e[s],!e3(n)&&void 0===(r=e2[(i=String(n)).toLowerCase()]))throw new X(`Unknown adapter '${i}'`);if(r&&(K.isFunction(r)||(r=r.get(t))))break;o[i||"#"+s]=r}if(!r){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new X("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(e5).join("\n"):" "+e5(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function e8(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eP(null,e)}function e6(e){return e8(e),e.headers=eE.from(e.headers),e.data=eM.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e4(e.adapter||ew.adapter,e)(e).then(function(t){return e8(e),t.data=eM.call(e,e.transformResponse,t),t.headers=eE.from(t.headers),t},function(t){return!eA(t)&&(e8(e),t&&t.response&&(t.response.data=eM.call(e,e.transformResponse,t.response),t.response.headers=eE.from(t.response.headers))),Promise.reject(t)})}let e7="1.13.2",e9={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e9[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let te={};e9.transitional=function(e,t,n){function r(e,t){return"[Axios v"+e7+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new X(r(i," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!te[i]&&(te[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},e9.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let tt=function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let o=r[i],s=t[o];if(s){let t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new X("option "+o+" must be "+n,X.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new X("Unknown option "+o,X.ERR_BAD_OPTION)}};class tn{constructor(e){this.defaults=e||{},this.interceptors={request:new eu,response:new eu}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){let n,r;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:o,headers:s}=t=eV(this.defaults,t);void 0!==i&&tt(i,{silentJSONParsing:e9.transitional(e9.boolean),forcedJSONParsing:e9.transitional(e9.boolean),clarifyTimeoutError:e9.transitional(e9.boolean)},!1),null!=o&&(K.isFunction(o)?t.paramsSerializer={serialize:o}:tt(o,{encode:e9.function,serialize:e9.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),tt(t,{baseUrl:e9.spelling("baseURL"),withXsrfToken:e9.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&K.merge(s.common,s[t.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=eE.concat(a,s);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d=0;if(!u){let e=[e6.bind(this),void 0];for(e.unshift(...l),e.push(...c),r=e.length,n=Promise.resolve(t);d<r;)n=n.then(e[d++],e[d++]);return n}r=l.length;let h=t;for(;d<r;){let e=l[d++],t=l[d++];try{h=e(h)}catch(e){t.call(this,e);break}}try{n=e6.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,r=c.length;d<r;)n=n.then(c[d++],c[d++]);return n}getUri(e){return el(eB((e=eV(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],function(e){tn.prototype[e]=function(t,n){return this.request(eV(n||{},{method:e,url:t,data:(n||{}).data}))}}),K.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(eV(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}tn.prototype[e]=t(),tn.prototype[e+"Form"]=t(!0)});class tr{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new eP(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new tr(function(t){e=t}),cancel:e}}}let ti={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ti).forEach(([e,t])=>{ti[t]=e});let to=function e(t){let n=new tn(t),r=c(tn.prototype.request,n);return K.extend(r,tn.prototype,n,{allOwnKeys:!0}),K.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(eV(t,n))},r}(ew);to.Axios=tn,to.CanceledError=eP,to.CancelToken=tr,to.isCancel=eA,to.VERSION=e7,to.toFormData=er,to.AxiosError=X,to.Cancel=to.CanceledError,to.all=function(e){return Promise.all(e)},to.spread=function(e){return function(t){return e.apply(null,t)}},to.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},to.mergeConfig=eV,to.AxiosHeaders=eE,to.formToJSON=e=>ex(K.isHTMLForm(e)?new FormData(e):e),to.getAdapter=e4,to.HttpStatusCode=ti,to.default=to,e.s(["default",0,to],31368)},705443,830023,e=>{"use strict";var t=e.i(224675),n=e.i(31368),r=e.i(316575);let i=r.default.env.NEXT_PUBLIC_API_URL,o=i??=window.location.origin,s=r.default.env.NEXT_PUBLIC_CLOUD_WEB_URL;s??="https://cloud.datarecce.io",e.s(["PUBLIC_API_URL",0,o],830023);let a=n.default.create({baseURL:o}),l=new t.QueryClient;e.s(["axiosClient",0,a,"reactQueryClient",0,l],705443)},713767,e=>{"use strict";var t=e.i(705443);let n=0,r=!1,i=null;function o(e){i=e}async function s(){if(Date.now()-n<3e3||r)return!1;try{return r=!0,await t.axiosClient.post("/api/keep-alive"),n=Date.now(),i&&i(n),!0}catch(e){return window.RECCE_DEBUG_IDLE&&console.log("[Keep-Alive] Failed to send",{error:e instanceof Error?e.message:String(e),timestamp:new Date().toISOString(),willRetryOnNextActivity:!0}),!1}finally{r=!1}}function a(){return n}e.s(["getLastKeepAliveTime",()=>a,"sendKeepAlive",()=>s,"setKeepAliveCallback",()=>o])},791606,(e,t,n)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},472668,(e,t,n)=>{t.exports=e.g&&e.g.Object===Object&&e.g},818408,(e,t,n)=>{var r=e.r(472668),i="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||i||Function("return this")()},702272,(e,t,n)=>{var r=e.r(818408);t.exports=function(){return r.Date.now()}},893912,(e,t,n)=>{var r=/\s/;t.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},386716,(e,t,n)=>{var r=e.r(893912),i=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},407667,(e,t,n)=>{t.exports=e.r(818408).Symbol},652930,(e,t,n)=>{var r=e.r(407667),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},21955,(e,t,n)=>{var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}},423748,(e,t,n)=>{var r=e.r(407667),i=e.r(652930),o=e.r(21955),s=r?r.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},819674,(e,t,n)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},248664,(e,t,n)=>{var r=e.r(423748),i=e.r(819674);t.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},394370,(e,t,n)=>{var r=e.r(386716),i=e.r(791606),o=e.r(248664),s=0/0,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?s:+e}},987325,(e,t,n)=>{var r=e.r(791606),i=e.r(702272),o=e.r(394370),s=Math.max,a=Math.min;t.exports=function(e,t,n){var l,u,c,d,h,f,p=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-f,r=e-p;return void 0===f||n>=t||n<0||m&&r>=c}function x(){var e,n,r,o=i();if(b(o))return w(o);h=setTimeout(x,(e=o-f,n=o-p,r=t-e,m?a(r,c-n):r))}function w(e){return(h=void 0,v&&l)?y(e):(l=u=void 0,d)}function _(){var e,n=i(),r=b(n);if(l=arguments,u=this,f=n,r){if(void 0===h)return p=e=f,h=setTimeout(x,t),g?y(e):d;if(m)return clearTimeout(h),h=setTimeout(x,t),y(f)}return void 0===h&&(h=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(g=!!n.leading,c=(m="maxWait"in n)?s(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},_.flush=function(){return void 0===h?d:w(i())},_}},360174,(e,t,n)=>{var r=e.r(987325),i=e.r(791606);t.exports=function(e,t,n){var o=!0,s=!0;if("function"!=typeof e)throw TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),r(e,t,{leading:o,maxWait:t,trailing:s})}},333207,e=>{"use strict";let t;var n=e.i(935140),r=e.i(889747),i=e.i(868259),o=e.i(279743),s=e.i(297805),a=e.i(204039),l=e.i(608839),u=class extends o.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#E=null,this.#M=(0,s.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#A=void 0;#P=void 0;#T=void 0;#R;#I;#M;#E;#D;#L;#j;#N;#F;#B;#z=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#A.addObserver(this),c(this.#A,this.options)?this.#V():this.updateResult(),this.#H())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#A,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#A,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#$(),this.#W(),this.#A.removeObserver(this)}setOptions(e){let t=this.options,n=this.#A;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#A))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#U(),this.#A.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#A,observer:this});let r=this.hasListeners();r&&h(this.#A,n,this.options,t)&&this.#V(),this.updateResult(),r&&(this.#A!==n||(0,a.resolveEnabled)(this.options.enabled,this.#A)!==(0,a.resolveEnabled)(t.enabled,this.#A)||(0,a.resolveStaleTime)(this.options.staleTime,this.#A)!==(0,a.resolveStaleTime)(t.staleTime,this.#A))&&this.#q();let i=this.#Q();r&&(this.#A!==n||(0,a.resolveEnabled)(this.options.enabled,this.#A)!==(0,a.resolveEnabled)(t.enabled,this.#A)||i!==this.#B)&&this.#K(i)}getOptimisticResult(e){var t,n;let r=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(r,e);return t=this,n=i,(0,a.shallowEqualObjects)(t.getCurrentResult(),n)||(this.#T=i,this.#I=this.options,this.#R=this.#A.state),i}getCurrentResult(){return this.#T}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#M.status||this.#M.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#z.add(e)}getCurrentQuery(){return this.#A}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),n=this.#c.getQueryCache().build(this.#c,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#V({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#T))}#V(e){this.#U();let t=this.#A.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#q(){this.#$();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#A);if(a.isServer||this.#T.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#T.dataUpdatedAt,e);this.#N=l.timeoutManager.setTimeout(()=>{this.#T.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#A):this.options.refetchInterval)??!1}#K(e){this.#W(),this.#B=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#A)&&(0,a.isValidTimeout)(this.#B)&&0!==this.#B&&(this.#F=l.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||n.focusManager.isFocused())&&this.#V()},this.#B))}#H(){this.#q(),this.#K(this.#Q())}#$(){this.#N&&(l.timeoutManager.clearTimeout(this.#N),this.#N=void 0)}#W(){this.#F&&(l.timeoutManager.clearInterval(this.#F),this.#F=void 0)}createResult(e,t){let n,r=this.#A,o=this.options,l=this.#T,u=this.#R,d=this.#I,p=e!==r?e.state:this.#P,{state:g}=e,m={...g},v=!1;if(t._optimisticResults){let n=this.hasListeners(),s=!n&&c(e,t),a=n&&h(e,r,t,o);(s||a)&&(m={...m,...(0,i.fetchState)(g.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:x}=m;n=m.data;let w=!1;if(void 0!==t.placeholderData&&void 0===n&&"pending"===x){let e;l?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=l.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#j?.state.data,this.#j):t.placeholderData,void 0!==e&&(x="success",n=(0,a.replaceData)(l?.data,e,t),v=!0)}if(t.select&&void 0!==n&&!w)if(l&&n===u?.data&&t.select===this.#D)n=this.#L;else try{this.#D=t.select,n=t.select(n),n=(0,a.replaceData)(l?.data,n,t),this.#L=n,this.#E=null}catch(e){this.#E=e}this.#E&&(y=this.#E,n=this.#L,b=Date.now(),x="error");let _="fetching"===m.fetchStatus,k="pending"===x,S="error"===x,C=k&&_,O=void 0!==n,E={status:x,fetchStatus:m.fetchStatus,isPending:k,isSuccess:"success"===x,isError:S,isInitialLoading:C,isLoading:C,data:n,dataUpdatedAt:m.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:_,isRefetching:_&&!k,isLoadingError:S&&!O,isPaused:"paused"===m.fetchStatus,isPlaceholderData:v,isRefetchError:S&&O,isStale:f(e,t),refetch:this.refetch,promise:this.#M,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===E.status?e.reject(E.error):void 0!==E.data&&e.resolve(E.data)},n=()=>{t(this.#M=E.promise=(0,s.pendingThenable)())},i=this.#M;switch(i.status){case"pending":e.queryHash===r.queryHash&&t(i);break;case"fulfilled":("error"===E.status||E.data!==i.value)&&n();break;case"rejected":("error"!==E.status||E.error!==i.reason)&&n()}}return E}updateResult(){let e=this.#T,t=this.createResult(this.#A,this.options);if(this.#R=this.#A.state,this.#I=this.options,void 0!==this.#R.data&&(this.#j=this.#A),(0,a.shallowEqualObjects)(t,e))return;this.#T=t;let n=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#z.size)return!0;let r=new Set(n??this.#z);return this.options.throwOnError&&r.add("error"),Object.keys(this.#T).some(t=>this.#T[t]!==e[t]&&r.has(t))};this.#G({listeners:n()})}#U(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#A)return;let t=this.#A;this.#A=e,this.#P=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#H()}#G(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#T)}),this.#c.getQueryCache().notify({query:this.#A,type:"observerResultsUpdated"})})}};function c(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,n){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&f(e,t)}return!1}function h(e,t,n,r){return(e!==t||!1===(0,a.resolveEnabled)(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&f(e,n)}function f(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.i(316575);var p=e.i(187725),g=e.i(63257);e.i(19483);var m=p.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),v=p.createContext(!1);v.Provider;var y=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function b(e,t){return function(e,t,n){let i=p.useContext(v),o=p.useContext(m),s=(0,g.useQueryClient)(n),l=s.defaultQueryOptions(e);if(s.getDefaultOptions().queries?._experimental_beforeQuery?.(l),l._optimisticResults=i?"isRestoring":"optimistic",l.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=l.staleTime;l.staleTime="function"==typeof t?(...n)=>e(t(...n)):e(t),"number"==typeof l.gcTime&&(l.gcTime=Math.max(l.gcTime,1e3))}(l.suspense||l.throwOnError||l.experimental_prefetchInRender)&&!o.isReset()&&(l.retryOnMount=!1),p.useEffect(()=>{o.clearReset()},[o]);let u=!s.getQueryCache().get(l.queryHash),[c]=p.useState(()=>new t(s,l)),d=c.getOptimisticResult(l),h=!i&&!1!==e.subscribed;if(p.useSyncExternalStore(p.useCallback(e=>{let t=h?c.subscribe(r.notifyManager.batchCalls(e)):a.noop;return c.updateResult(),t},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setOptions(l)},[l,c]),l?.suspense&&d.isPending)throw y(l,c,o);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||(0,a.shouldThrowError)(n,[e.error,r])))({result:d,errorResetBoundary:o,throwOnError:l.throwOnError,query:s.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw d.error;if(s.getDefaultOptions().queries?._experimental_afterQuery?.(l,d),l.experimental_prefetchInRender&&!a.isServer&&d.isLoading&&d.isFetching&&!i){let e=u?y(l,c,o):s.getQueryCache().get(l.queryHash)?.promise;e?.catch(a.noop).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}(e,u,t)}e.s(["useQuery",()=>b],333207)},407101,e=>{"use strict";e.s(["cacheKeys",0,{rowCount:e=>["row_count",e],lineage:()=>["lineage"],checks:()=>["checks","list"],check:e=>["checks",e],checkEvents:e=>["checks",e,"events"],runs:()=>["runs"],run:e=>["runs",e],runsAggregated:()=>["runs_aggregated"],flag:()=>["flag"],instanceInfo:()=>["instance_info"],user:()=>["user"]}])},830520,109624,e=>{"use strict";var t=e.i(333207),n=e.i(407101),r=e.i(705443);async function i(){return(await r.axiosClient.get("/api/instance-info")).data}e.s(["getRecceInstanceInfo",()=>i],109624),e.s(["useRecceInstanceInfo",0,()=>(0,t.useQuery)({queryKey:n.cacheKeys.instanceInfo(),queryFn:i})],830520)},503135,e=>{"use strict";e.s(["IdleTimeoutProvider",()=>u,"useIdleTimeout",()=>d,"useIdleTimeoutSafe",()=>h],503135);var t=e.i(19483),n=e.i(187725),r=e.i(713767),i=e.i(360174),o=e.i(830520);function s(e,t){window.RECCE_DEBUG_IDLE&&(t?console.log(e,t):console.log(e))}let a=["focus","mousemove","keydown","scroll"],l=(0,n.createContext)(void 0);function u({children:e}){let{data:i}=(0,o.useRecceInstanceInfo)(),s=(0,n.useRef)(Date.now()),[a,u]=(0,n.useState)(null),[d,h]=(0,n.useState)(!1),f=i?.idle_timeout??null,p=null!==f&&f>0,g=(0,n.useRef)(p);(0,n.useEffect)(()=>{g.current=p},[p]),(0,n.useEffect)(()=>{if(!p)return void(0,r.setKeepAliveCallback)(null);(0,r.setKeepAliveCallback)(e=>{g.current&&(s.current=e)});let e=(0,r.getLastKeepAliveTime)();return e>0&&(s.current=e),()=>{(0,r.setKeepAliveCallback)(null)}},[p]);let m=(0,n.useCallback)(()=>{h(!0)},[]),v=(0,n.useCallback)(()=>{h(!1),s.current=Date.now()},[]);return(0,n.useEffect)(()=>{if(!p||null===f)return void u(null);if(d)return;let e=()=>{u(Math.max(0,f-(Date.now()-s.current)/1e3))};e();let t=setInterval(e,1e3);return()=>{clearInterval(t)}},[p,f,d]),(0,t.jsxs)(l.Provider,{value:{remainingSeconds:a,idleTimeout:f,isEnabled:p,setDisconnected:m,resetConnection:v,isDisconnected:d},children:[(0,t.jsx)(c,{}),e]})}function c(){return!function(){let{data:e,isLoading:t,isError:l}=(0,o.useRecceInstanceInfo)(),u=h(),c=u?.isDisconnected??!1,d=e?.idle_timeout,f=void 0!==d&&d>0&&!c;s("[Idle Detection] Instance info",{isLoading:t,isError:l,hasIdleTimeout:void 0!==d,idleTimeout:void 0!==d?`${d}s`:"not configured",isDisconnected:c,isEnabled:f});let p=(0,n.useCallback)(async()=>{document.hidden||await (0,r.sendKeepAlive)()&&s("[Idle Detection] Keep-alive sent successfully",{timestamp:new Date().toISOString()})},[]),g=(0,n.useCallback)(e=>{f&&!document.hidden&&(s("[Idle Detection] Activity detected",{event:e.type,tabActive:!document.hidden}),p())},[f,p]),m=(0,n.useCallback)(()=>{f&&(document.hidden||(s("[Idle Detection] Tab became active",{timestamp:new Date().toISOString()}),p()))},[f,p]),v=(0,n.useMemo)(()=>(0,i.default)(g,150,{leading:!0,trailing:!0}),[g]);(0,n.useEffect)(()=>f?(s("[Idle Detection] Initialized",{enabled:!0,idleTimeout:`${d}s`,eventThrottle:"150ms",apiThrottle:"3s (axios layer)",monitoredEvents:a.join(", ")}),a.forEach(e=>{window.addEventListener(e,v,{passive:!0})}),document.addEventListener("visibilitychange",m),()=>{s("[Idle Detection] Cleanup - removing event listeners"),a.forEach(e=>{window.removeEventListener(e,v)}),document.removeEventListener("visibilitychange",m),v.cancel()}):void s("[Idle Detection] Disabled",{idleTimeout:d,reason:void 0===d?"idle_timeout not configured on server":0===d?"idle_timeout is 0":"disconnected"}),[f,v,m,d])}(),null}function d(){let e=(0,n.useContext)(l);if(!e)throw Error("useIdleTimeout must be used within IdleTimeoutProvider");return e}function h(){return(0,n.useContext)(l)??null}},672394,592468,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(995044),r=e.i(842426),i=e.i(272866);let o=function(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t};e.s(["default",0,o],592468);var s=e.i(19483);function a(e){let t=[],n=[];return Array.from(e.querySelectorAll('input,select,textarea,a[href],button,[tabindex],audio[controls],video[controls],[contenteditable]:not([contenteditable="false"])')).forEach((e,r)=>{let i,o=Number.isNaN(i=parseInt(e.getAttribute("tabindex")||"",10))?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:i;-1===o||e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e)||(0===o?t.push(e):n.push({documentOrder:r,tabIndex:o,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function l(){return!0}e.s(["default",0,function(e){let{children:u,disableAutoFocus:c=!1,disableEnforceFocus:d=!1,disableRestoreFocus:h=!1,getTabbable:f=a,isEnabled:p=l,open:g}=e,m=t.useRef(!1),v=t.useRef(null),y=t.useRef(null),b=t.useRef(null),x=t.useRef(null),w=t.useRef(!1),_=t.useRef(null),k=(0,n.default)((0,i.default)(u),_),S=t.useRef(null);t.useEffect(()=>{g&&_.current&&(w.current=!c)},[c,g]),t.useEffect(()=>{if(!g||!_.current)return;let e=o((0,r.default)(_.current));return!_.current.contains(e)&&(_.current.hasAttribute("tabIndex")||_.current.setAttribute("tabIndex","-1"),w.current&&_.current.focus()),()=>{h||(b.current&&b.current.focus&&(m.current=!0,b.current.focus()),b.current=null)}},[g]),t.useEffect(()=>{if(!g||!_.current)return;let e=(0,r.default)(_.current),t=o(e),n=e=>{S.current=e,!d&&p()&&"Tab"===e.key&&t===_.current&&e.shiftKey&&(m.current=!0,y.current&&y.current.focus())},i=()=>{let t=_.current;if(null===t)return;let n=o(e);if(!e.hasFocus()||!p()||m.current){m.current=!1;return}if(t.contains(n)||d&&n!==v.current&&n!==y.current)return;if(n!==x.current)x.current=null;else if(null!==x.current)return;if(!w.current)return;let r=[];if((n===v.current||n===y.current)&&(r=f(_.current)),r.length>0){let e=!!(S.current?.shiftKey&&S.current?.key==="Tab"),t=r[0],n=r[r.length-1];"string"!=typeof t&&"string"!=typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",i),e.addEventListener("keydown",n,!0);let s=setInterval(()=>{let t=o(e);t&&"BODY"===t.tagName&&i()},50);return()=>{clearInterval(s),e.removeEventListener("focusin",i),e.removeEventListener("keydown",n,!0)}},[c,d,h,p,g,f]);let C=e=>{null===b.current&&(b.current=e.relatedTarget),w.current=!0};return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)("div",{tabIndex:g?0:-1,onFocus:C,ref:v,"data-testid":"sentinelStart"}),t.cloneElement(u,{ref:k,onFocus:e=>{null===b.current&&(b.current=e.relatedTarget),w.current=!0,x.current=e.target;let t=u.props.onFocus;t&&t(e)}}),(0,s.jsx)("div",{tabIndex:g?0:-1,onFocus:C,ref:y,"data-testid":"sentinelEnd"})]})}],672394)},355503,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(316245),r=e.i(86396),i=e.i(995044);function o(e,t){"function"==typeof e?e(t):e&&(e.current=t)}var s=e.i(272866);let a=t.forwardRef(function(e,a){let{children:l,container:u,disablePortal:c=!1}=e,[d,h]=t.useState(null),f=(0,i.default)(t.isValidElement(l)?(0,s.default)(l):null,a);return((0,r.default)(()=>{c||h(("function"==typeof u?u():u)||document.body)},[u,c]),(0,r.default)(()=>{if(d&&!c)return o(a,d),()=>{o(a,null)}},[a,d,c]),c)?t.isValidElement(l)?t.cloneElement(l,{ref:f}):l:d?n.createPortal(l,d):d});e.s(["default",0,a],355503)},644367,599779,464755,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(446547),o=e.i(519273),s=e.i(577950),a=e.i(726323),l=e.i(272866),u=e.i(811347),c=e.i(155062),d=e.i(723938),h=e.i(19483);let f={entering:{opacity:1},entered:{opacity:1}},p=t.forwardRef(function(e,n){let r=(0,u.useTheme)(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:p,easing:g,in:m,onEnter:v,onEntered:y,onEntering:b,onExit:x,onExited:w,onExiting:_,style:k,timeout:S=i,TransitionComponent:C=a.Transition,...O}=e,E=t.useRef(null),M=(0,d.default)(E,(0,l.default)(p),n),A=e=>t=>{if(e){let n=E.current;void 0===t?e(n):e(n,t)}},P=A(b),T=A((e,t)=>{(0,c.reflow)(e);let n=(0,c.getTransitionProps)({style:k,timeout:S,easing:g},{mode:"enter"});e.style.webkitTransition=r.transitions.create("opacity",n),e.style.transition=r.transitions.create("opacity",n),v&&v(e,t)}),R=A(y),I=A(_),D=A(e=>{let t=(0,c.getTransitionProps)({style:k,timeout:S,easing:g},{mode:"exit"});e.style.webkitTransition=r.transitions.create("opacity",t),e.style.transition=r.transitions.create("opacity",t),x&&x(e)}),L=A(w);return(0,h.jsx)(C,{appear:s,in:m,nodeRef:E,onEnter:T,onEntered:R,onEntering:P,onExit:D,onExited:L,onExiting:I,addEndListener:e=>{o&&o(E.current,e)},timeout:S,...O,children:(e,{ownerState:n,...r})=>t.cloneElement(p,{style:{opacity:0,visibility:"exited"!==e||m?void 0:"hidden",...f[e],...k,...p.props.style},ref:M,...r})})});e.s(["default",0,p],599779);var g=e.i(435983),m=e.i(446519);function v(e){return(0,m.default)("MuiBackdrop",e)}(0,g.default)("MuiBackdrop",["root","invisible"]);let y=(0,i.styled)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),b=t.forwardRef(function(e,t){let i=(0,o.useDefaultProps)({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:u="div",invisible:c=!1,open:d,components:f={},componentsProps:g={},slotProps:m={},slots:b={},TransitionComponent:x,transitionDuration:w,..._}=i,k={...i,component:u,invisible:c},S=(e=>{let{classes:t,invisible:n}=e;return(0,r.default)({root:["root",n&&"invisible"]},v,t)})(k),C={component:u,slots:{transition:x,root:f.Root,...b},slotProps:{...g,...m}},[O,E]=(0,s.default)("root",{elementType:y,externalForwardedProps:C,className:(0,n.default)(S.root,l),ownerState:k}),[M,A]=(0,s.default)("transition",{elementType:p,externalForwardedProps:C,ownerState:k});return(0,h.jsx)(M,{in:d,timeout:w,..._,...A,children:(0,h.jsx)(O,{"aria-hidden":!0,...E,classes:S,ref:t,children:a})})});function x(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}e.s(["default",0,b],644367),e.s(["default",()=>x],464755)},138419,e=>{"use strict";var t=e.i(842426);function n(e){return(0,t.default)(e).defaultView||window}e.s(["default",()=>n])},687536,589624,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(672394),o=e.i(355503),s=e.i(446547),a=e.i(73205),l=e.i(519273),u=e.i(644367),c=e.i(842426),d=e.i(995044),h=e.i(554191),f=e.i(464755),p=e.i(803913),g=e.i(138419);function m(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function v(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function y(e){return parseInt((0,g.default)(e).getComputedStyle(e).paddingRight,10)||0}function b(e,t,n,r,i){let o=[t,n,...r];[].forEach.call(e.children,e=>{let t,n,r=!o.includes(e),s=(t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type"),!t&&!n);r&&s&&v(e,i)})}function x(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}e.s(["default",()=>m],589624);let w=()=>{},_=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n,r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&v(e.modalRef,!1);let i=(n=[],[].forEach.call(t.children,e=>{"true"===e.getAttribute("aria-hidden")&&n.push(e)}),n);b(t,e.mount,e.modalRef,i,!0);let o=x(this.containers,e=>e.container===t);return -1!==o?this.containers[o].modals.push(e):this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:i}),r}mount(e,t){let n=x(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||(r.restore=function(e,t){let n=[],r=e.container;if(!t.disableScrollLock){let e,t;if((t=(0,c.default)(r)).body===r?(0,g.default)(r).innerWidth>t.documentElement.clientWidth:r.scrollHeight>r.clientHeight){let e=m((0,g.default)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${y(r)+e}px`;let t=(0,c.default)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${y(t)+e}px`})}if(r.parentNode instanceof DocumentFragment)e=(0,c.default)(r).body;else{let t=r.parentElement,n=(0,g.default)(r);e=t?.nodeName==="HTML"&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}(r,t))}remove(e,t=!0){let n=this.modals.indexOf(e);if(-1===n)return n;let r=x(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&v(e.modalRef,t),b(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&v(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},k=function(e){let{container:n,disableEscapeKeyDown:r=!1,disableScrollLock:i=!1,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:u,open:g,rootRef:m}=e,y=t.useRef({}),b=t.useRef(null),x=t.useRef(null),k=(0,d.default)(x,m),[S,C]=t.useState(!g),O=!!l&&l.props.hasOwnProperty("in"),E=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(E=!1);let M=()=>(y.current.modalRef=x.current,y.current.mount=b.current,y.current),A=()=>{_.mount(M(),{disableScrollLock:i}),x.current&&(x.current.scrollTop=0)},P=(0,h.default)(()=>{let e=("function"==typeof n?n():n)||(0,c.default)(b.current).body;_.add(M(),e),x.current&&A()}),T=()=>_.isTopModal(M()),R=(0,h.default)(e=>{b.current=e,e&&(g&&T()?A():x.current&&v(x.current,E))}),I=t.useCallback(()=>{_.remove(M(),E)},[E]);return t.useEffect(()=>()=>{I()},[I]),t.useEffect(()=>{g?P():O&&o||I()},[g,I,O,o,P]),{getRootProps:(t={})=>{let n=(0,p.default)(e);delete n.onTransitionEnter,delete n.onTransitionExited;let i={...n,...t};return{role:"presentation",...i,onKeyDown:e=>{i.onKeyDown?.(e),"Escape"===e.key&&229!==e.which&&T()&&!r&&(e.stopPropagation(),u&&u(e,"escapeKeyDown"))},ref:k}},getBackdropProps:(e={})=>({"aria-hidden":!0,...e,onClick:t=>{e.onClick?.(t),t.target===t.currentTarget&&u&&u(t,"backdropClick")},open:g}),getTransitionProps:()=>({onEnter:(0,f.default)(()=>{C(!1),s&&s()},l?.props.onEnter??w),onExited:(0,f.default)(()=>{C(!0),a&&a(),o&&I()},l?.props.onExited??w)}),rootRef:k,portalRef:R,isTopModal:T,exited:S,hasTransition:O}};var S=e.i(435983),C=e.i(446519);function O(e){return(0,C.default)("MuiModal",e)}(0,S.default)("MuiModal",["root","hidden","backdrop"]);var E=e.i(577950),M=e.i(19483);let A=(0,s.styled)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((0,a.default)(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),P=(0,s.styled)(u.default,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),T=t.forwardRef(function(e,s){let a=(0,l.useDefaultProps)({name:"MuiModal",props:e}),{BackdropComponent:u=P,BackdropProps:c,classes:d,className:h,closeAfterTransition:f=!1,children:p,container:g,component:m,components:v={},componentsProps:y={},disableAutoFocus:b=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:w=!1,disablePortal:_=!1,disableRestoreFocus:S=!1,disableScrollLock:C=!1,hideBackdrop:T=!1,keepMounted:R=!1,onClose:I,onTransitionEnter:D,onTransitionExited:L,open:j,slotProps:N={},slots:F={},theme:B,...z}=a,V={...a,closeAfterTransition:f,disableAutoFocus:b,disableEnforceFocus:x,disableEscapeKeyDown:w,disablePortal:_,disableRestoreFocus:S,disableScrollLock:C,hideBackdrop:T,keepMounted:R},{getRootProps:H,getBackdropProps:$,getTransitionProps:W,portalRef:U,isTopModal:q,exited:Q,hasTransition:K}=k({...V,rootRef:s}),G={...V,exited:Q},X=(e=>{let{open:t,exited:n,classes:i}=e;return(0,r.default)({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},O,i)})(G),Y={};if(void 0===p.props.tabIndex&&(Y.tabIndex="-1"),K){let{onEnter:e,onExited:t}=W();Y.onEnter=e,Y.onExited=t}let Z={slots:{root:v.Root,backdrop:v.Backdrop,...F},slotProps:{...y,...N}},[J,ee]=(0,E.default)("root",{ref:s,elementType:A,externalForwardedProps:{...Z,...z,component:m},getSlotProps:H,ownerState:G,className:(0,n.default)(h,X?.root,!G.open&&G.exited&&X?.hidden)}),[et,en]=(0,E.default)("backdrop",{ref:c?.ref,elementType:u,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:c,getSlotProps:e=>$({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:(0,n.default)(c?.className,X?.backdrop),ownerState:G});return R||j||K&&!Q?(0,M.jsx)(o.default,{ref:U,container:g,disablePortal:_,children:(0,M.jsxs)(J,{...ee,children:[!T&&u?(0,M.jsx)(et,{...en}):null,(0,M.jsx)(i.default,{disableEnforceFocus:x,disableAutoFocus:b,disableRestoreFocus:S,isEnabled:q,open:j,children:t.cloneElement(p,Y)})]})}):null});e.s(["default",0,T],687536)},468836,11321,772510,845209,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(244875),o=e.i(578509),s=e.i(687536),a=e.i(599779),l=e.i(966196),u=e.i(435983),c=e.i(446519);function d(e){return(0,c.default)("MuiDialog",e)}let h=(0,u.default)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),f=t.createContext({});var p=e.i(644367),g=e.i(446547),m=e.i(811347),v=e.i(73205),y=e.i(519273),b=e.i(577950),x=e.i(19483);let w=(0,g.styled)(p.default,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),_=(0,g.styled)(s.default,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),k=(0,g.styled)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${(0,o.default)(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),S=(0,g.styled)(l.default,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${(0,o.default)(n.scroll)}`],t[`paperWidth${(0,o.default)(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((0,v.default)(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${h.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(e=>"xs"!==e).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${h.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${h.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),C=t.forwardRef(function(e,s){let u=(0,y.useDefaultProps)({props:e,name:"MuiDialog"}),c=(0,m.useTheme)(),h={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{"aria-describedby":p,"aria-labelledby":g,"aria-modal":v=!0,BackdropComponent:C,BackdropProps:O,children:E,className:M,disableEscapeKeyDown:A=!1,fullScreen:P=!1,fullWidth:T=!1,maxWidth:R="sm",onClick:I,onClose:D,open:L,PaperComponent:j=l.default,PaperProps:N={},scroll:F="paper",slots:B={},slotProps:z={},TransitionComponent:V=a.default,transitionDuration:H=h,TransitionProps:$,...W}=u,U={...u,disableEscapeKeyDown:A,fullScreen:P,fullWidth:T,maxWidth:R,scroll:F},q=(e=>{let{classes:t,scroll:n,maxWidth:i,fullWidth:s,fullScreen:a}=e,l={root:["root"],container:["container",`scroll${(0,o.default)(n)}`],paper:["paper",`paperScroll${(0,o.default)(n)}`,`paperWidth${(0,o.default)(String(i))}`,s&&"paperFullWidth",a&&"paperFullScreen"]};return(0,r.default)(l,d,t)})(U),Q=t.useRef(),K=(0,i.default)(g),G=t.useMemo(()=>({titleId:K}),[K]),X={slots:{transition:V,...B},slotProps:{transition:$,paper:N,backdrop:O,...z}},[Y,Z]=(0,b.default)("root",{elementType:_,shouldForwardComponentProp:!0,externalForwardedProps:X,ownerState:U,className:(0,n.default)(q.root,M),ref:s}),[J,ee]=(0,b.default)("backdrop",{elementType:w,shouldForwardComponentProp:!0,externalForwardedProps:X,ownerState:U}),[et,en]=(0,b.default)("paper",{elementType:S,shouldForwardComponentProp:!0,externalForwardedProps:X,ownerState:U,className:(0,n.default)(q.paper,N.className)}),[er,ei]=(0,b.default)("container",{elementType:k,externalForwardedProps:X,ownerState:U,className:q.container}),[eo,es]=(0,b.default)("transition",{elementType:a.default,externalForwardedProps:X,ownerState:U,additionalProps:{appear:!0,in:L,timeout:H,role:"presentation"}});return(0,x.jsx)(Y,{closeAfterTransition:!0,slots:{backdrop:J},slotProps:{backdrop:{transitionDuration:H,as:C,...ee}},disableEscapeKeyDown:A,onClose:D,open:L,onClick:e=>{I&&I(e),Q.current&&(Q.current=null,D&&D(e,"backdropClick"))},...Z,...W,children:(0,x.jsx)(eo,{...es,children:(0,x.jsx)(er,{onMouseDown:e=>{Q.current=e.target===e.currentTarget},...ei,children:(0,x.jsx)(et,{as:j,elevation:24,role:"dialog","aria-describedby":p,"aria-labelledby":K,"aria-modal":v,...en,children:(0,x.jsx)(f.Provider,{value:G,children:E})})})})})});function O(e){return(0,c.default)("MuiDialogActions",e)}e.s(["default",0,C],468836),(0,u.default)("MuiDialogActions",["root","spacing"]);let E=(0,g.styled)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),M=t.forwardRef(function(e,t){let i=(0,y.useDefaultProps)({props:e,name:"MuiDialogActions"}),{className:o,disableSpacing:s=!1,...a}=i,l={...i,disableSpacing:s},u=(e=>{let{classes:t,disableSpacing:n}=e;return(0,r.default)({root:["root",!n&&"spacing"]},O,t)})(l);return(0,x.jsx)(E,{className:(0,n.default)(u.root,o),ownerState:l,ref:t,...a})});function A(e){return(0,c.default)("MuiDialogContent",e)}function P(e){return(0,c.default)("MuiDialogTitle",e)}e.s(["default",0,M],11321),(0,u.default)("MuiDialogContent",["root","dividers"]);let T=(0,u.default)("MuiDialogTitle",["root"]),R=(0,g.styled)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((0,v.default)(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${T.root} + &`]:{paddingTop:0}}}]}))),I=t.forwardRef(function(e,t){let i=(0,y.useDefaultProps)({props:e,name:"MuiDialogContent"}),{className:o,dividers:s=!1,...a}=i,l={...i,dividers:s},u=(e=>{let{classes:t,dividers:n}=e;return(0,r.default)({root:["root",n&&"dividers"]},A,t)})(l);return(0,x.jsx)(R,{className:(0,n.default)(u.root,o),ownerState:l,ref:t,...a})});e.s(["default",0,I],772510);var D=e.i(427938);let L=(0,g.styled)(D.default,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),j=t.forwardRef(function(e,i){let o=(0,y.useDefaultProps)({props:e,name:"MuiDialogTitle"}),{className:s,id:a,...l}=o,u=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},P,t)})(o),{titleId:c=a}=t.useContext(f);return(0,x.jsx)(L,{component:"h2",className:(0,n.default)(u.root,s),ownerState:o,ref:i,variant:"h6",id:a??c,...l})});e.s(["default",0,j],845209)},79312,(e,t,n)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else if(47===n)break;else n=47;if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2)){if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--)s>=0?r=arguments[s]:(void 0===e&&(e=""),r=e),t(r),0!==r.length&&(i=r+"/"+i,o=47===r.charCodeAt(0));if(i=n(i,!o),o)if(i.length>0)return"/"+i;else return"/";return i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return(0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var l=n.length-a,u=s<l?s:l,c=-1,d=0;d<=u;++d){if(d===u){if(l>u){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);else if(0===d)return n.slice(a+d)}else s>u&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var h=e.charCodeAt(i+d);if(h!==n.charCodeAt(a+d))break;47===h&&(c=d)}var f="";for(d=i+c+1;d<=o;++d)(d===o||47===e.charCodeAt(d))&&(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(a+c):(a+=c,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return -1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else -1===l&&(s=!1,l=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else -1===o&&(s=!1,o=r+1);return -1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47===l){if(!o){r=a+1;break}continue}-1===i&&(o=!1,i=a+1),46===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return -1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){var t,n;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+n:t+"/"+n:n},parse:function(e){t(e);var n,r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,d=0;c>=n;--c){if(47===(i=e.charCodeAt(c))){if(!u){a=c+1;break}continue}-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1)}return -1===s||-1===l||0===d||1===d&&s===l-1&&s===a+1?-1!==l&&(0===a&&o?r.base=r.name=e.slice(1,l):r.base=r.name=e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}},s=!0;try{e[t](o,o.exports,r),s=!1}finally{s&&delete n[t]}return o.exports}r.ab="/ROOT/node_modules/.pnpm/next@16.0.10_@babel+core@7.28.5_@opentelemetry+api@1.9.0_babel-plugin-macros@3.1.0_reac_b41129a5d0dbb99ff13b71aa74cb05b9/node_modules/next/dist/compiled/path-browserify/",t.exports=r(114)}()},955343,e=>{"use strict";var t=e.i(187725),n={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(n),i=["attr","size","title"];function o(){return(o=Object.assign.bind()).apply(this,arguments)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){return n=>t.default.createElement(u,o({attr:a({},e.attr)},n),function e(n){return n&&n.map((n,r)=>t.default.createElement(n.tag,a({key:r},n.attr),e(n.child)))}(e.child))}function u(e){var s=n=>{var r,{attr:s,size:l,title:u}=e,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,i),d=l||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",o({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,c,{className:r,style:a(a({color:e.color||n.color},n.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),u&&t.default.createElement("title",null,u),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>s(e)):s(n)}e.s(["GenIcon",()=>l],955343)},603338,e=>{"use strict";var t=e.i(955343);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M128 80V64a48.14 48.14 0 0 1 48-48h224a48.14 48.14 0 0 1 48 48v368l-80-64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M320 96H112a48.14 48.14 0 0 0-48 48v352l152-128 152 128V144a48.14 48.14 0 0 0-48-48z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M449.07 399.08 278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17zm-198.6-1.83a20 20 0 1 1 20-20 20 20 0 0 1-20 20zm21.72-201.15-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7z"},child:[]}]})(e)}e.s(["IoBookmarksOutline",()=>n,"IoClose",()=>r,"IoWarning",()=>i])},593104,(e,t,n)=>{"use strict";function r(e,t){e[t]?e[t]++:e[t]=1}function i(e,t){--e[t]||delete e[t]}function o(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}return i+"\x01"+o+"\x01"+(void 0===r?"\0":r)}function s(e,t){return o(e,t.v,t.w,t.name)}t.exports=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var n=t;void 0!==n;n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else if("\0"===e)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(i){var o=n.parent(i);return void 0===o||t.hasNode(o)?(r[i]=o,o):o in r?r[o]:e(o)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,i,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(i=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var l=o(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return s&&(this._edgeLabels[l]=i),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=s?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return r&&(a.name=r),a}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[l]=u,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,t,n){var r=1==arguments.length?s(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1==arguments.length?s(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var r=1==arguments.length?s(this._isDirected,arguments[0]):o(this._isDirected,e,t,n),a=this._edgeObjs[r];return a&&(e=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=Object.values(n);return t?r.filter(e=>e.v===t):r}}outEdges(e,t){var n=this._out[e];if(n){var r=Object.values(n);return t?r.filter(e=>e.w===t):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}},556524,(e,t,n)=>{t.exports="2.2.4"},60242,(e,t,n)=>{t.exports={Graph:e.r(593104),version:e.r(556524)}},728058,(e,t,n)=>{var r=e.r(593104);t.exports={write:function(e){var t,n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}),edges:(n=e).edges().map(function(e){var t=n.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==t&&(r.value=t),r})};return void 0!==e.graph()&&(r.value=structuredClone(e.graph())),r},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},113595,(e,t,n)=>{t.exports=function(e){var t,n={},r=[];return e.nodes().forEach(function(i){t=[],function r(i){Object.hasOwn(n,i)||(n[i]=!0,t.push(i),e.successors(i).forEach(r),e.predecessors(i).forEach(r))}(i),t.length&&r.push(t)}),r}},524053,(e,t,n)=>{t.exports=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(!Object.hasOwn(n,e=String(e))){var r=this._arr,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}}},495904,(e,t,n)=>{var r=e.r(524053);t.exports=function(e,t,n,o){return function(e,t,n,i){var o,s,a={},l=new r,u=function(e){var t=e.v!==o?e.v:e.w,r=a[t],i=n(e),u=s.distance+i;if(i<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<r.distance&&(r.distance=u,r.predecessor=o,l.decrease(t,u))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;a[e]={distance:n},l.add(e,n)});l.size()>0&&(s=a[o=l.removeMin()]).distance!==1/0;)i(o).forEach(u);return a}(e,String(t),n||i,o||function(t){return e.outEdges(t)})};var i=()=>1},453242,(e,t,n)=>{var r=e.r(495904);t.exports=function(e,t,n){return e.nodes().reduce(function(i,o){return i[o]=r(e,o,t,n),i},{})}},939386,(e,t,n)=>{t.exports=function(e){var t=0,n=[],r={},i=[];return e.nodes().forEach(function(o){Object.hasOwn(r,o)||function o(s){var a=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(a.lowlink=Math.min(a.lowlink,r[e].index)):(o(e),a.lowlink=Math.min(a.lowlink,r[e].lowlink))}),a.lowlink===a.index){var l,u=[];do r[l=n.pop()].onStack=!1,u.push(l);while(s!==l)i.push(u)}}(o)}),i}},628782,(e,t,n)=>{var r=e.r(939386);t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},953449,(e,t,n)=>{t.exports=function(e,t,n){var i,o,s,a,l;return i=e,o=t||r,s=n||function(t){return e.outEdges(t)},a={},(l=i.nodes()).forEach(function(e){a[e]={},a[e][e]={distance:0},l.forEach(function(t){e!==t&&(a[e][t]={distance:1/0})}),s(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=o(t);a[e][n]={distance:r,predecessor:e}})}),l.forEach(function(e){var t=a[e];l.forEach(function(n){var r=a[n];l.forEach(function(n){var i=r[e],o=t[n],s=r[n],a=i.distance+o.distance;a<s.distance&&(s.distance=a,s.predecessor=o.predecessor)})})}),a};var r=()=>1},686103,(e,t,n)=>{function r(e){var t={},n={},r=[];if(e.sinks().forEach(function o(s){if(Object.hasOwn(n,s))throw new i;Object.hasOwn(t,s)||(n[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete n[s],r.push(s))}),Object.keys(t).length!==e.nodeCount())throw new i;return r}class i extends Error{constructor(){super(...arguments)}}t.exports=r,r.CycleException=i},871053,(e,t,n)=>{var r=e.r(686103);t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},937525,(e,t,n)=>{function r(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),o(t(s[0]),e=>i.push([e,!1])))}}function i(e,t,n,r){for(var i=[e];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),o(t(s),e=>i.push(e)))}}function o(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}t.exports=function(e,t,n){Array.isArray(t)||(t=[t]);var o=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),s="post"===n?r:i,a=[],l={};return t.forEach(t=>{if(!e.hasNode(t))throw Error("Graph does not have node: "+t);s(t,o,l,a)}),a}},347059,(e,t,n)=>{var r=e.r(937525);t.exports=function(e,t){return r(e,t,"post")}},481445,(e,t,n)=>{var r=e.r(937525);t.exports=function(e,t){return r(e,t,"pre")}},9712,(e,t,n)=>{var r=e.r(593104),i=e.r(524053);t.exports=function(e,t){var n,o=new r,s={},a=new i;function l(e){var r=e.v===n?e.w:e.v,i=a.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,a.decrease(r,o))}}if(0===e.nodeCount())return o;e.nodes().forEach(function(e){a.add(e,1/0),o.setNode(e)}),a.decrease(e.nodes()[0],0);for(var u=!1;a.size()>0;){if(Object.hasOwn(s,n=a.removeMin()))o.setEdge(n,s[n]);else if(u)throw Error("Input graph is not connected: "+e);else u=!0;e.nodeEdges(n).forEach(l)}return o}},981620,(e,t,n)=>{t.exports={components:e.r(113595),dijkstra:e.r(495904),dijkstraAll:e.r(453242),findCycles:e.r(628782),floydWarshall:e.r(953449),isAcyclic:e.r(871053),postorder:e.r(347059),preorder:e.r(481445),prim:e.r(9712),tarjan:e.r(939386),topsort:e.r(686103)}},76321,(e,t,n)=>{var r=e.r(60242);t.exports={Graph:r.Graph,json:e.r(728058),alg:e.r(981620),version:r.version}},738141,(e,t,n)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return"["+e.join(", ")+"]"}}},835934,(e,t,n)=>{let r=e.r(76321).Graph,i=e.r(738141);t.exports=function(e,t){var n,l;let u,c,d,h,f;if(1>=e.nodeCount())return[];let p=(n=e,l=t||o,u=new r,c=0,d=0,n.nodes().forEach(e=>{u.setNode(e,{v:e,in:0,out:0})}),n.edges().forEach(e=>{let t=u.edge(e.v,e.w)||0,n=l(e);u.setEdge(e.v,e.w,t+n),d=Math.max(d,u.node(e.v).out+=n),c=Math.max(c,u.node(e.w).in+=n)}),h=(function(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t})(d+c+3).map(()=>new i),f=c+1,u.nodes().forEach(e=>{a(h,f,u.node(e))}),{graph:u,buckets:h,zeroIdx:f});return(function(e,t,n){let r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(r=t[o].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}}return i})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};let o=()=>1;function s(e,t,n,r,i){let o=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let s=e.edge(r),l=e.node(r.v);i&&o.push({v:r.v,w:r.w}),l.out-=s,a(t,n,l)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),o=r.w,s=e.node(o);s.in-=i,a(t,n,s)}),e.removeNode(r.v),o}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},558704,(e,t,n)=>{"use strict";let r=e.r(76321).Graph;function i(e,t,n,r){for(var i=r;e.hasNode(i);)i=l(r);return n.dummy=t,e.setNode(i,n),i}t.exports={addBorderNode:function(e,t,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),i(e,"border",o,t)},addDummyNode:i,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t},buildLayerMatrix:function(e){let t=u(s(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;void 0!==i&&(t[i][r.order]=n)}),t},intersectRect:function(e,t){let n,r,i=e.x,o=e.y,s=t.x-i,a=t.y-o,l=e.width/2,u=e.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*l>Math.abs(s)*u?(a<0&&(u=-u),n=u*s/a,r=u):(s<0&&(l=-l),n=l,r=l*a/s),{x:i+n,y:o+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})},maxRank:s,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n}));e.nodes().forEach(n=>{let r=e.node(n);Object.hasOwn(r,"rank")&&(r.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n},pick:function(e,t){let n={};for(let r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},range:u,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank)),n=[];e.nodes().forEach(r=>{let i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});let r=0,i=e.graph().nodeRankFactor;Array.from(n).forEach((t,n)=>{void 0===t&&n%i!=0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:l,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let n=function(e,t=65535){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}}function s(e){return o(Math.max,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?5e-324:n}))}let a=0;function l(e){return e+""+ ++a}function u(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function c(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}},238577,(e,t,n)=>{"use strict";let r=e.r(835934),i=e.r(558704).uniqueId;t.exports={run:function(e){var t,n;let o,s,a;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(o=[],s={},a={},(n=e).nodes().forEach(function e(t){Object.hasOwn(a,t)||(a[t]=!0,s[t]=!0,n.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?o.push(t):e(t.w)}),delete s[t])}),o)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,i("rev"))})},undo:function(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}},966771,(e,t,n)=>{"use strict";let r=e.r(558704);t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,i,o,s=t.v,a=e.node(s).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==a+1){for(e.removeEdge(t),o=0,++a;a<u;++o,++a)d.points=[],i={width:0,height:0,edgeLabel:d,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",i,"_d"),a===h&&(i.width=d.width,i.height=d.height,i.dummy="edge-label",i.labelpos=d.labelpos),e.setEdge(s,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,l,{weight:d.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)})}}},879466,(e,t,n)=>{"use strict";let{applyWithChunking:r}=e.r(558704);t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(i){var o=e.node(i);if(Object.hasOwn(t,i))return o.rank;t[i]=!0;var s=r(Math.min,e.outEdges(i).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),o.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},300813,(e,t,n)=>{"use strict";var r=e.r(76321).Graph,i=e.r(879466).slack;t.exports=function(e){var t,n,o,s,a=new r({directed:!1}),l=e.nodes()[0],u=e.nodeCount();for(a.setNode(l,{});t=a,n=e,t.nodes().forEach(function e(r){n.nodeEdges(r).forEach(o=>{var s=o.v,a=r===s?o.w:s;t.hasNode(a)||i(n,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),e(a))})}),t.nodeCount()<u;)o=function(e,t){return t.edges().reduce((n,r)=>{let o=1/0;return(e.hasNode(r.v)!==e.hasNode(r.w)&&(o=i(t,r)),o<n[0])?[o,r]:n},[1/0,null])[1]}(a,e),s=a.hasNode(o.v)?i(e,o):-i(e,o),function(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}(a,e,s);return a}},346101,(e,t,n)=>{"use strict";var r=e.r(300813),i=e.r(879466).slack,o=e.r(879466).longestPath,s=e.r(76321).alg.preorder,a=e.r(76321).alg.postorder,l=e.r(558704).simplify;function u(e){o(e=l(e));var t,n,i=r(e);for(h(i),c(i,e);t=f(i);)n=p(i,e,t),g(i,e,t,n)}function c(e,t){var n=a(e,e.nodes());(n=n.slice(0,n.length-1)).forEach(n=>{var r,i,o,s;return r=e,i=t,o=n,s=r.node(o).parent,void(r.edge(o,s).cutvalue=d(r,i,o))})}function d(e,t,n){var r=e.node(n).parent,i=!0,o=t.edge(n,r),s=0;return o||(i=!1,o=t.edge(r,n)),s=o.weight,t.nodeEdges(n).forEach(o=>{var a=o.v===n,l=a?o.w:o.v;if(l!==r){var u,c,d,h=a===i,f=t.edge(o).weight;if(s+=h?f:-f,u=e,c=n,d=l,u.hasEdge(c,d)){var p=e.edge(n,l).cutvalue;s+=h?-p:p}}}),s}function h(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,r,i,o){var s=r,a=t.node(i);return n[i]=!0,t.neighbors(i).forEach(o=>{Object.hasOwn(n,o)||(r=e(t,n,r,o,i))}),a.low=s,a.lim=r++,o?a.parent=o:delete a.parent,r}(e,{},1,t)}function f(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function p(e,t,n){var r=n.v,o=n.w;t.hasEdge(r,o)||(r=n.w,o=n.v);var s=e.node(r),a=e.node(o),l=s,u=!1;return s.lim>a.lim&&(l=a,u=!0),t.edges().filter(t=>u===m(e,e.node(t.v),l)&&u!==m(e,e.node(t.w),l)).reduce((e,n)=>i(t,n)<i(t,e)?n:e)}function g(e,t,n,r){var i,o,a,l,u=n.v,d=n.w;e.removeEdge(u,d),e.setEdge(r.v,r.w,{}),h(e),c(e,t),i=e,o=t,a=i.nodes().find(e=>!o.node(e).parent),(l=(l=s(i,a)).slice(1)).forEach(e=>{var t=i.node(e).parent,n=o.edge(e,t),r=!1;n||(n=o.edge(t,e),r=!0),o.node(e).rank=o.node(t).rank+(r?n.minlen:-n.minlen)})}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=u,u.initLowLimValues=h,u.initCutValues=c,u.calcCutValue=d,u.leaveEdge=f,u.enterEdge=p,u.exchangeEdges=g},829221,(e,t,n)=>{"use strict";var r=e.r(879466).longestPath,i=e.r(300813),o=e.r(346101);t.exports=function(e){var t,n=e.graph().ranker;if(n instanceof Function)return n(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),i(t);break;case"longest-path":s(e);case"none":}};var s=r},544809,(e,t,n)=>{t.exports=function(e){var t;let n,r,i=(n={},r=0,(t=e).children().forEach(function e(i){let o=r;t.children(i).forEach(e),n[i]={low:o,lim:r++}}),n);e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeObj,o=function(e,t,n,r){let i,o,s=[],a=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do s.push(i=e.parent(i));while(i&&(t[i].low>l||u>t[i].lim))for(o=i,i=r;(i=e.parent(i))!==o;)a.push(i);return{path:s.concat(a.reverse()),lca:o}}(e,i,r.v,r.w),s=o.path,a=o.lca,l=0,u=s[0],c=!0;for(;t!==r.w;){if(n=e.node(t),c){for(;(u=s[l])!==a&&e.node(u).maxRank<n.rank;)l++;u===a&&(c=!1)}if(!c){for(;l<s.length-1&&e.node(u=s[l+1]).minRank<=n.rank;)l++;u=s[l]}e.setParent(t,u),t=e.successors(t)[0]}})}},111517,(e,t,n)=>{let r=e.r(558704);t.exports={run:function(e){var t,n,i;let o=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,i){var o=t.children(r);o&&o.length&&o.forEach(t=>e(t,i+1)),n[r]=i})(e,1)),n),a=Object.values(s),l=r.applyWithChunking(Math.max,a)-1,u=2*l+1;e.graph().nestingRoot=o,e.edges().forEach(t=>e.edge(t).minlen*=u);let c=(i=e).edges().reduce((e,t)=>e+i.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,i,o,s,a,l){let u=t.children(l);if(!u.length){l!==n&&t.setEdge(n,l,{weight:0,minlen:i});return}let c=r.addBorderNode(t,"_bt"),d=r.addBorderNode(t,"_bb"),h=t.node(l);t.setParent(c,l),h.borderTop=c,t.setParent(d,l),h.borderBottom=d,u.forEach(r=>{e(t,n,i,o,s,a,r);let u=t.node(r),h=u.borderTop?u.borderTop:r,f=u.borderBottom?u.borderBottom:r,p=u.borderTop?o:2*o,g=h!==f?1:s-a[l]+1;t.setEdge(c,h,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(l)||t.setEdge(n,c,{weight:0,minlen:s+a[l]})})(e,o,u,c,l,s,t)),e.graph().nodeRankFactor=u},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}},234950,(e,t,n)=>{let r=e.r(558704);function i(e,t,n,i,o,s){let a=o[t][s-1],l=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);o[t][s]=l,e.setParent(l,i),a&&e.setEdge(a,l,{weight:1})}t.exports=function(e){e.children().forEach(function t(n){let r=e.children(n),o=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let t=o.minRank,r=o.maxRank+1;t<r;++t)i(e,"borderLeft","_bl",n,o,t),i(e,"borderRight","_br",n,o,t)}})}},594453,(e,t,n)=>{"use strict";function r(e){e.nodes().forEach(t=>i(e.node(t))),e.edges().forEach(t=>i(e.edge(t)))}function i(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function s(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let i=e.graph().rankdir.toLowerCase();("bt"===i||"rl"===i)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let n=t.edge(e);n.points.forEach(o),Object.hasOwn(n,"y")&&o(n)})),("lr"===i||"rl"===i)&&((n=e).nodes().forEach(e=>s(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(s),Object.hasOwn(t,"x")&&s(t)}),r(e))}}},934278,(e,t,n)=>{"use strict";let r=e.r(558704);t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),i=n.map(t=>e.node(t).rank),o=r.applyWithChunking(Math.max,i),s=r.range(o+1).map(()=>[]);return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(function n(r){t[r]||(t[r]=!0,s[e.node(r).rank].push(r),e.successors(r).forEach(n))}),s}},535208,(e,t,n)=>{"use strict";let r=e.r(558704).zipObject;t.exports=function(e,t){let n=0;for(let i=1;i<t.length;++i)n+=function(e,t,n){let i=r(n,n.map((e,t)=>t)),o=t.flatMap(t=>e.outEdges(t).map(t=>({pos:i[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let l=Array(a).fill(0),u=0;return o.forEach(e=>{let t=e.pos+s;l[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=l[t+1]),t=t-1>>1,l[t]+=e.weight;u+=e.weight*n}),u}(e,t[i-1],t[i]);return n}},125077,(e,t,n)=>{t.exports=function(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}},107049,(e,t,n)=>{"use strict";let r=e.r(558704);t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(function(e){return t=>{!t.merged&&(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),n.out.forEach(function(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}},803369,(e,t,n)=>{let r=e.r(558704);function i(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}t.exports=function(e,t){var n;let o=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=o.lhs,a=o.rhs.sort((e,t)=>t.i-e.i),l=[],u=0,c=0,d=0;s.sort((n=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i)),d=i(l,a,d),s.forEach(e=>{d+=e.vs.length,l.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,d=i(l,a,d)});let h={vs:l.flat(!0)};return c&&(h.barycenter=u/c,h.weight=c),h}},738769,(e,t,n)=>{let r=e.r(125077),i=e.r(107049),o=e.r(803369);t.exports=function e(t,n,s,a){var l,u;let c=t.children(n),d=t.node(n),h=d?d.borderLeft:void 0,f=d?d.borderRight:void 0,p={};h&&(c=c.filter(e=>e!==h&&e!==f));let g=r(t,c);g.forEach(n=>{if(t.children(n.v).length){var r,i;let o=e(t,n.v,s,a);p[n.v]=o,Object.hasOwn(o,"barycenter")&&(r=n,i=o,void 0!==r.barycenter?(r.barycenter=(r.barycenter*r.weight+i.barycenter*i.weight)/(r.weight+i.weight),r.weight+=i.weight):(r.barycenter=i.barycenter,r.weight=i.weight))}});let m=i(g,s);l=m,u=p,l.forEach(e=>{e.vs=e.vs.flatMap(e=>u[e]?u[e].vs:e)});let v=o(m,a);if(h&&(v.vs=[h,v.vs,f].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),n=t.node(t.predecessors(f)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+n.order)/(v.weight+2),v.weight+=2}return v}},340956,(e,t,n)=>{let r=e.r(76321).Graph,i=e.r(558704);t.exports=function(e,t,n,o){o||(o=e.nodes());let s=function(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}(e),a=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return o.forEach(r=>{let i=e.node(r),o=e.parent(r);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(a.setNode(r),a.setParent(r,o||s),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=void 0!==i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(i,"minRank")&&a.setNode(r,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))}),a}},436203,(e,t,n)=>{t.exports=function(e,t,n){let r={},i;n.forEach(n=>{let o=e.parent(n),s,a;for(;o;){if((s=e.parent(o))?(a=r[s],r[s]=o):(a=i,i=o),a&&a!==o)return void t.setEdge(a,o);o=s}})}},10571,(e,t,n)=>{"use strict";let r=e.r(934278),i=e.r(535208),o=e.r(738769),s=e.r(340956),a=e.r(436203),l=e.r(76321).Graph,u=e.r(558704);function c(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if("number"==typeof n.rank&&i(n.rank,t),"number"==typeof n.minRank&&"number"==typeof n.maxRank)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return s(e,t,n,r.get(t)||[])})}function d(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}t.exports=function e(t,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(t,e);let s=u.maxRank(t),h=c(t,u.range(1,s+1),"inEdges"),f=c(t,u.range(s-1,-1,-1),"outEdges"),p=r(t);if(d(t,p),n&&n.disableOptimalOrderHeuristic)return;let g=1/0,m;for(let e=0,n=0;n<4;++e,++n){(function(e,t){let n=new l;e.forEach(function(e){let r=e.graph().root,i=o(e,r,n,t);i.vs.forEach((t,n)=>e.node(t).order=n),a(e,n,i.vs)})})(e%2?h:f,e%4>=2),p=u.buildLayerMatrix(t);let r=i(t,p);r<g&&(n=0,m=Object.assign({},p),g=r)}d(t,m)}},787670,(e,t,n)=>{"use strict";let r=e.r(76321).Graph,i=e.r(558704);function o(e,t){let n={};return t.length&&t.reduce(function(t,r){let i=0,o=0,s=t.length,l=r[r.length-1];return r.forEach((t,u)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=c?e.node(c).order:s;(c||t===l)&&(r.slice(o,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let o=e.node(r),s=o.order;(s<i||d<s)&&!(o.dummy&&e.node(t).dummy)&&a(n,r,t)})}),o=u+1,i=d)}),r}),n}function s(e,t){let n={};function r(t,r,o,s,l){let u;i.range(r,o).forEach(r=>{u=t[r],e.node(u).dummy&&e.predecessors(u).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<s||r.order>l)&&a(n,t,u)})})}return t.length&&t.reduce(function(t,n){let i=-1,o,s=0;return n.forEach((a,l)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(o=e.node(t[0]).order,r(n,s,l,i,o),s=l,i=o)}r(n,s,n.length,o,t.length)}),n}),n}function a(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function l(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function u(e,t,n,r){let i={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,o[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=r(e);if(a.length){let r=((a=a.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=a[u];o[e]===e&&t<s[r]&&!l(n,e,r)&&(o[r]=e,o[e]=i[e]=i[r],t=s[r])}}})}),{root:i,align:o}}function c(e,t,n,i,o){var s,a,l,u,c,d,h;let f,p,g,m={},v=(s=e,a=t,l=n,u=o,f=new r,g=(c=(p=s.graph()).nodesep,d=p.edgesep,h=u,(e,t,n)=>{let r,i,o=e.node(t),s=e.node(n);if(r=0+o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":i=-o.width/2;break;case"r":i=o.width/2}if(i&&(r+=h?i:-i),i=0,r+=(o.dummy?d:c)/2,r+=(s.dummy?d:c)/2,r+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":i=s.width/2;break;case"r":i=-s.width/2}return i&&(r+=h?i:-i),i=0,r}),a.forEach(e=>{let t;e.forEach(e=>{let n=l[e];if(f.setNode(n),t){var r=l[t],i=f.edge(r,n);f.setEdge(r,n,Math.max(g(s,e,t),i||0))}t=e})}),f),y=o?"borderLeft":"borderRight";function b(e,t){let n=v.nodes(),r=n.pop(),i={};for(;r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let n=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==y&&(m[t]=Math.max(m[t],n))},v.successors.bind(v)),Object.keys(i).forEach(e=>m[e]=m[n[e]]),m}function d(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{var o,s;let a=(o=e,s=t,o.node(s).width/2);r=Math.max(n+a,r),i=Math.min(n-a,i)});let o=r-i;return o<t[0]&&(t=[o,n]),t},[1/0,null])[1]}function h(e,t){let n=Object.values(t),r=i.applyWithChunking(Math.min,n),o=i.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(s=>{let a=n+s,l=e[a];if(l===t)return;let u=Object.values(l),c=r-i.applyWithChunking(Math.min,u);"l"!==s&&(c=o-i.applyWithChunking(Math.max,u)),c&&(e[a]=i.mapValues(l,e=>e+c))})})}function f(e,t){return i.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t,n=i.buildLayerMatrix(e),r=Object.assign(o(e,n),s(e,n)),a={};["u","d"].forEach(o=>{t="u"===o?n:Object.values(n).reverse(),["l","r"].forEach(n=>{"r"===n&&(t=t.map(e=>Object.values(e).reverse()));let s=("u"===o?e.predecessors:e.successors).bind(e),l=u(e,t,r,s),d=c(e,t,l.root,l.align,"r"===n);"r"===n&&(d=i.mapValues(d,e=>-e)),a[o+n]=d})});let l=d(e,a);return h(a,l),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:a,hasConflict:l,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:d,balance:f}},245551,(e,t,n)=>{"use strict";let r=e.r(558704),i=e.r(787670).positionX;t.exports=function(e){var t;let n,o,s;t=e=r.asNonCompoundGraph(e),n=r.buildLayerMatrix(t),o=t.graph().ranksep,s=0,n.forEach(e=>{let n=e.reduce((e,n)=>{let r=t.node(n).height;return e>r?e:r},0);e.forEach(e=>t.node(e).y=s+n/2),s+=n+o}),Object.entries(i(e)).forEach(([t,n])=>e.node(t).x=n)}},964033,(e,t,n)=>{"use strict";let r=e.r(238577),i=e.r(966771),o=e.r(829221),s=e.r(558704).normalizeRanks,a=e.r(544809),l=e.r(558704).removeEmptyRanks,u=e.r(111517),c=e.r(234950),d=e.r(594453),h=e.r(10571),f=e.r(245551),p=e.r(558704),g=e.r(76321).Graph;t.exports=function(e,t){let n=t&&t.debugTiming?p.time:p.notime;n("layout",()=>{let O=n(" buildLayoutGraph",()=>{var t;let n,r;return t=e,n=new g({multigraph:!0,compound:!0}),r=C(t.graph()),n.setGraph(Object.assign({},v,S(r,m),p.pick(r,y))),t.nodes().forEach(e=>{let r=S(C(t.node(e)),b);Object.keys(x).forEach(e=>{void 0===r[e]&&(r[e]=x[e])}),n.setNode(e,r),n.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let r=C(t.edge(e));n.setEdge(e,Object.assign({},_,S(r,w),p.pick(r,k)))}),n});n(" runLayout",()=>{var e,g,m;return e=O,g=n,m=t,void(g(" makeSpaceForEdgeLabels",()=>{var t;let n;return n=(t=e).graph(),void(n.ranksep/=2,t.edges().forEach(e=>{let r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),g(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),g(" acyclic",()=>r.run(e)),g(" nestingGraph.run",()=>u.run(e)),g(" rank",()=>o(p.asNonCompoundGraph(e))),g(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};p.addDummyNode(t,"edge-proxy",r,"_ep")}})}),g(" removeEmptyRanks",()=>l(e)),g(" nestingGraph.cleanup",()=>u.cleanup(e)),g(" normalizeRanks",()=>s(e)),g(" assignRankMinMax",()=>{var t;let n;return n=0,void((t=e).nodes().forEach(e=>{let r=t.node(e);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,n=Math.max(n,r.maxRank))}),t.graph().maxRank=n)}),g(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),g(" normalize.run",()=>i.run(e)),g(" parentDummyChains",()=>a(e)),g(" addBorderSegments",()=>c(e)),g(" order",()=>h(e,m)),g(" insertSelfEdges",()=>{var t;return t=e,void p.buildLayerMatrix(t).forEach(e=>{var n=0;e.forEach((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach(e=>{p.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}),g(" adjustCoordinateSystem",()=>d.adjust(e)),g(" position",()=>f(e)),g(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,a=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*s/3,y:o-a},{x:i+5*s/6,y:o-a},{x:i+s,y:o},{x:i+5*s/6,y:o+a},{x:i+2*s/3,y:o+a}],n.label.x=n.x,n.label.y=n.y}})}),g(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),o=t.node(n.borderLeft[n.borderLeft.length-1]),s=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),g(" normalize.undo",()=>i.undo(e)),g(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}),g(" undoCoordinateSystem",()=>d.undo(e)),g(" translateGraph",()=>(function(e){let t=1/0,n=0,r=1/0,i=0,o=e.graph(),s=o.marginx||0,a=o.marginy||0;function l(e){let o=e.x,s=e.y,a=e.width,l=e.height;t=Math.min(t,o-a/2),n=Math.max(n,o+a/2),r=Math.min(r,s-l/2),i=Math.max(i,s+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&l(n)}),t-=s,r-=a,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,"x")&&(i.x-=t),Object.hasOwn(i,"y")&&(i.y-=r)}),o.width=n-t+s,o.height=i-r+a})(e)),g(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let n,r,i=t.edge(e),o=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=o),i.points.unshift(p.intersectRect(o,n)),i.points.push(p.intersectRect(s,r))})}),g(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}),g(" acyclic.undo",()=>r.undo(e)))}),n(" updateInputGraph",()=>{var t,n;return t=e,n=O,void(t.nodes().forEach(e=>{let r=t.node(e),i=n.node(e);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,n.children(e).length&&(r.width=i.width,r.height=i.height))}),t.edges().forEach(e=>{let r=t.edge(e),i=n.edge(e);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height)})})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],v={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},y=["acyclicer","ranker","rankdir","align"],b=["width","height","rank"],x={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function S(e,t){return p.mapValues(p.pick(e,t),Number)}function C(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n}),t}},950364,(e,t,n)=>{let r=e.r(558704),i=e.r(76321).Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),n=new i({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{n.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(n.setEdge(e,t,{style:"invis"}),t))}),n}}},281624,(e,t,n)=>{t.exports="1.1.8"},35380,(e,t,n)=>{t.exports={graphlib:e.r(76321),layout:e.r(964033),debug:e.r(950364),util:{time:e.r(558704).time,notime:e.r(558704).notime},version:e.r(281624)}},292002,e=>{"use strict";e.i(316575);var t,n,r,i,o,s,a,l,u,c,d,h,f,p,g,m={value:()=>{}};function v(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new y(r)}function y(e){this._=e}function b(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=m,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function x(){}function w(e){return null==e?x:function(){return this.querySelector(e)}}function _(){return[]}function k(e){return null==e?_:function(){return this.querySelectorAll(e)}}function S(e){return function(){return this.matches(e)}}function C(e){return function(t){return t.matches(e)}}y.prototype=v.prototype={constructor:y,on:function(e,t){var n,r=this._,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((n=(e=i[o]).type)&&(n=function(e,t){for(var n,r=0,i=e.length;r<i;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++o<s;)if(n=(e=i[o]).type)r[n]=b(r[n],e.name,t);else if(null==t)for(n in r)r[n]=b(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new y(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],o=0,n=r.length;o<n;++o)r[o].value.apply(t,i)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};var O=Array.prototype.find;function E(){return this.firstElementChild}var M=Array.prototype.filter;function A(){return Array.from(this.children)}function P(e){return Array(e.length)}function T(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function R(e,t,n,r,i,o){for(var s,a=0,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new T(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function I(e,t,n,r,i,o,s){var a,l,u,c=new Map,d=t.length,h=o.length,f=Array(d);for(a=0;a<d;++a)(l=t[a])&&(f[a]=u=s.call(l,l.__data__,a,t)+"",c.has(u)?i[a]=l:c.set(u,l));for(a=0;a<h;++a)u=s.call(e,o[a],a,o)+"",(l=c.get(u))?(r[a]=l,l.__data__=o[a],c.delete(u)):n[a]=new T(e,o[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(f[a])===l&&(i[a]=l)}function D(e){return e.__data__}function L(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}T.prototype={constructor:T,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var j="http://www.w3.org/1999/xhtml";let N={svg:"http://www.w3.org/2000/svg",xhtml:j,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function F(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),N.hasOwnProperty(t)?{space:N[t],local:e}:e}function B(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function z(e,t){return e.style.getPropertyValue(t)||B(e).getComputedStyle(e,null).getPropertyValue(t)}function V(e){return e.trim().split(/^|\s+/)}function H(e){return e.classList||new $(e)}function $(e){this._node=e,this._names=V(e.getAttribute("class")||"")}function W(e,t){for(var n=H(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function U(e,t){for(var n=H(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function q(){this.textContent=""}function Q(){this.innerHTML=""}function K(){this.nextSibling&&this.parentNode.appendChild(this)}function G(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function X(e){var t=F(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===j&&t.documentElement.namespaceURI===j?t.createElement(e):t.createElementNS(n,e)}})(t)}function Y(){return null}function Z(){var e=this.parentNode;e&&e.removeChild(this)}function J(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ee(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function et(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r<o;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function en(e,t,n){return function(){var r,i=this.__on,o=function(e){t.call(this,e,this.__data__)};if(i){for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(r):this.__on=[r]}}function er(e,t,n){var r=B(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}$.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ei=[null];function eo(e,t){this._groups=e,this._parents=t}function es(){return new eo([[document.documentElement]],ei)}function ea(e){return"string"==typeof e?new eo([[document.querySelector(e)]],[document.documentElement]):new eo([[e]],ei)}function el(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}eo.prototype=es.prototype={constructor:eo,select:function(e){"function"!=typeof e&&(e=w(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,s,a=t[i],l=a.length,u=r[i]=Array(l),c=0;c<l;++c)(o=a[c])&&(s=e.call(o,o.__data__,c,a))&&("__data__"in o&&(s.__data__=o.__data__),u[c]=s);return new eo(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=k(e);for(var n=this._groups,r=n.length,i=[],o=[],s=0;s<r;++s)for(var a,l=n[s],u=l.length,c=0;c<u;++c)(a=l[c])&&(i.push(e.call(a,a.__data__,c,l)),o.push(a));return new eo(i,o)},selectChild:function(e){var t;return this.select(null==e?E:(t="function"==typeof e?e:C(e),function(){return O.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?A:(t="function"==typeof e?e:C(e),function(){return M.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=S(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,s=t[i],a=s.length,l=r[i]=[],u=0;u<a;++u)(o=s[u])&&e.call(o,o.__data__,u,s)&&l.push(o);return new eo(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,D);var n=t?I:R,r=this._parents,i=this._groups;"function"!=typeof e&&(y=e,e=function(){return y});for(var o=i.length,s=Array(o),a=Array(o),l=Array(o),u=0;u<o;++u){var c=r[u],d=i[u],h=d.length,f="object"==typeof(v=e.call(c,c&&c.__data__,u,r))&&"length"in v?v:Array.from(v),p=f.length,g=a[u]=Array(p),m=s[u]=Array(p);n(c,d,g,m,l[u]=Array(h),f,t);for(var v,y,b,x,w=0,_=0;w<p;++w)if(b=g[w]){for(w>=_&&(_=w+1);!(x=m[_])&&++_<p;);b._next=x||null}}return(s=new eo(s,r))._enter=a,s._exit=l,s},enter:function(){return new eo(this._enter||this._groups.map(P),this._parents)},exit:function(){return new eo(this._exit||this._groups.map(P),this._parents)},join:function(e,t,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=Array(i),l=0;l<s;++l)for(var u,c=n[l],d=r[l],h=c.length,f=a[l]=Array(h),p=0;p<h;++p)(u=c[p]||d[p])&&(f[p]=u);for(;l<i;++l)a[l]=n[l];return new eo(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],o=i.length-1,s=i[o];--o>=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=L);for(var n=this._groups,r=n.length,i=Array(r),o=0;o<r;++o){for(var s,a=n[o],l=a.length,u=i[o]=Array(l),c=0;c<l;++c)(s=a[c])&&(u[c]=s);u.sort(t)}return new eo(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,o=t[n],s=0,a=o.length;s<a;++s)(i=o[s])&&e.call(i,i.__data__,s,o);return this},attr:function(e,t){var n=F(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):z(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=V(e+"");if(arguments.length<2){for(var r=H(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?W:U)(this,e)}}:t?function(e){return function(){W(this,e)}}:function(e){return function(){U(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?q:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Q:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(K)},lower:function(){return this.each(G)},append:function(e){var t="function"==typeof e?e:X(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:X(e),r=null==t?Y:"function"==typeof t?t:w(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Z)},clone:function(e){return this.select(e?ee:J)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),s=o.length;if(arguments.length<2){var a=this.node().__on;if(a){for(var l,u=0,c=a.length;u<c;++u)for(r=0,l=a[u];r<s;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value}return}for(r=0,a=t?en:et;r<s;++r)this.each(a(o[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return er(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return er(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,i=e[t],o=0,s=i.length;o<s;++o)(r=i[o])&&(yield r)}};let eu={passive:!1},ec={capture:!0,passive:!1};function ed(e){e.stopImmediatePropagation()}function eh(e){e.preventDefault(),e.stopImmediatePropagation()}function ef(e){var t=e.document.documentElement,n=ea(e).on("dragstart.drag",eh,ec);"onselectstart"in t?n.on("selectstart.drag",eh,ec):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ep(e,t){var n=e.document.documentElement,r=ea(e).on("dragstart.drag",null);t&&(r.on("click.drag",eh,ec),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let eg=e=>()=>e;function em(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function ev(e){return!e.ctrlKey&&!e.button}function ey(){return this.parentNode}function eb(e,t){return null==t?{x:e.x,y:e.y}:t}function ex(){return navigator.maxTouchPoints||"ontouchstart"in this}function ew(){var e,t,n,r,i=ev,o=ey,s=eb,a=ex,l={},u=v("start","drag","end"),c=0,d=0;function h(e){e.on("mousedown.drag",f).filter(a).on("touchstart.drag",m).on("touchmove.drag",y,eu).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(s,a){if(!r&&i.call(this,s,a)){var l=x(this,o.call(this,s,a),s,a,"mouse");l&&(ea(s.view).on("mousemove.drag",p,ec).on("mouseup.drag",g,ec),ef(s.view),ed(s),n=!1,e=s.clientX,t=s.clientY,l("start",s))}}function p(r){if(eh(r),!n){var i=r.clientX-e,o=r.clientY-t;n=i*i+o*o>d}l.mouse("drag",r)}function g(e){ea(e.view).on("mousemove.drag mouseup.drag",null),ep(e.view,n),eh(e),l.mouse("end",e)}function m(e,t){if(i.call(this,e,t)){var n,r,s=e.changedTouches,a=o.call(this,e,t),l=s.length;for(n=0;n<l;++n)(r=x(this,a,e,t,s[n].identifier,s[n]))&&(ed(e),r("start",e,s[n]))}}function y(e){var t,n,r=e.changedTouches,i=r.length;for(t=0;t<i;++t)(n=l[r[t].identifier])&&(eh(e),n("drag",e,r[t]))}function b(e){var t,n,i=e.changedTouches,o=i.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<o;++t)(n=l[i[t].identifier])&&(ed(e),n("end",e,i[t]))}function x(e,t,n,r,i,o){var a,d,f,p=u.copy(),g=el(o||n,t);if(null!=(f=s.call(e,new em("beforestart",{sourceEvent:n,target:h,identifier:i,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),r)))return a=f.x-g[0]||0,d=f.y-g[1]||0,function n(o,s,u){var m,v=g;switch(o){case"start":l[i]=n,m=c++;break;case"end":delete l[i],--c;case"drag":g=el(u||s,t),m=c}p.call(o,e,new em(o,{sourceEvent:s,subject:f,target:h,identifier:i,active:m,x:g[0]+a,y:g[1]+d,dx:g[0]-v[0],dy:g[1]-v[1],dispatch:p}),r)}}return h.filter=function(e){return arguments.length?(i="function"==typeof e?e:eg(!!e),h):i},h.container=function(e){return arguments.length?(o="function"==typeof e?e:eg(e),h):o},h.subject=function(e){return arguments.length?(s="function"==typeof e?e:eg(e),h):s},h.touchable=function(e){return arguments.length?(a="function"==typeof e?e:eg(!!e),h):a},h.on=function(){var e=u.on.apply(u,arguments);return e===u?h:e},h.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,h):Math.sqrt(d)},h}function e_(e){return((e=Math.exp(e))+1/e)/2}em.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ek=function e(t,n,r){function i(e,i){var o,s,a=e[0],l=e[1],u=e[2],c=i[0],d=i[1],h=i[2],f=c-a,p=d-l,g=f*f+p*p;if(g<1e-12)s=Math.log(h/u)/t,o=function(e){return[a+e*f,l+e*p,u*Math.exp(t*e*s)]};else{var m=Math.sqrt(g),v=(h*h-u*u+r*g)/(2*u*n*m),y=(h*h-u*u-r*g)/(2*h*n*m),b=Math.log(Math.sqrt(v*v+1)-v);s=(Math.log(Math.sqrt(y*y+1)-y)-b)/t,o=function(e){var r,i,o=e*s,c=e_(b),d=u/(n*m)*(c*(((r=Math.exp(2*(r=t*o+b)))-1)/(r+1))-((i=Math.exp(i=b))-1/i)/2);return[a+d*f,l+d*p,u*c/e_(t*o+b)]}}return o.duration=1e3*s*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4);var eS,eC,eO=0,eE=0,eM=0,eA=0,eP=0,eT=0,eR="object"==typeof performance&&performance.now?performance:Date,eI="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eD(){return eP||(eI(eL),eP=eR.now()+eT)}function eL(){eP=0}function ej(){this._call=this._time=this._next=null}function eN(e,t,n){var r=new ej;return r.restart(e,t,n),r}function eF(){eP=(eA=eR.now())+eT,eO=eE=0;try{eD(),++eO;for(var e,t=eS;t;)(e=eP-t._time)>=0&&t._call.call(void 0,e),t=t._next;--eO}finally{eO=0,function(){for(var e,t,n=eS,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:eS=t);eC=e,ez(r)}(),eP=0}}function eB(){var e=eR.now(),t=e-eA;t>1e3&&(eT-=t,eA=e)}function ez(e){!eO&&(eE&&(eE=clearTimeout(eE)),e-eP>24?(e<1/0&&(eE=setTimeout(eF,e-eR.now()-eT)),eM&&(eM=clearInterval(eM))):(eM||(eA=eR.now(),eM=setInterval(eB,1e3)),eO=1,eI(eF)))}function eV(e,t,n){var r=new ej;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}ej.prototype=eN.prototype={constructor:ej,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?eD():+n)+(null==t?0:+t),this._next||eC===this||(eC?eC._next=this:eS=this,eC=this),this._call=e,this._time=n,ez()},stop:function(){this._call&&(this._call=null,this._time=1/0,ez())}};var eH=v("start","end","cancel","interrupt"),e$=[];function eW(e,t,n,r,i,o){var s=e.__transition;if(s){if(n in s)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function o(l){var u,c,d,h;if(1!==n.state)return a();for(u in i)if((h=i[u]).name===n.name){if(3===h.state)return eV(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete i[u]):+u<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete i[u])}if(eV(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(u=0,n.state=3,r=Array(d=n.tween.length),c=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=h);r.length=c+1}}function s(t){for(var i=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=r.length;++o<s;)r[o].call(e,i);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){for(var r in n.state=6,n.timer.stop(),delete i[t],i)return;delete e.__transition}i[t]=n,n.timer=eN(function(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:i,on:eH,tween:e$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function eU(e,t){var n=eQ(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eq(e,t){var n=eQ(e,t);if(n.state>3)throw Error("too late; already running");return n}function eQ(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function eK(e,t){var n,r,i,o=e.__transition,s=!0;if(o){for(i in t=null==t?null:t+"",o){if((n=o[i]).name!==t){s=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete o[i]}s&&delete e.__transition}}function eG(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var eX=180/Math.PI,eY={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eZ(e,t,n,r,i,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*eX,skewX:Math.atan(l)*eX,scaleX:s,scaleY:a}}function eJ(e,t,n,r){function i(e){return e.length?e.pop()+" ":""}return function(o,s){var a,l,u,c,d=[],h=[];return o=e(o),s=e(s),!function(e,r,i,o,s,a){if(e!==i||r!==o){var l=s.push("translate(",null,t,null,n);a.push({i:l-4,x:eG(e,i)},{i:l-2,x:eG(r,o)})}else(i||o)&&s.push("translate("+i+t+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,d,h),a=o.rotate,l=s.rotate,a!==l?(a-l>180?l+=360:l-a>180&&(a+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:eG(a,l)})):l&&d.push(i(d)+"rotate("+l+r),u=o.skewX,c=s.skewX,u!==c?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:eG(u,c)}):c&&d.push(i(d)+"skewX("+c+r),!function(e,t,n,r,o,s){if(e!==n||t!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:eG(e,n)},{i:a-2,x:eG(t,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,d,h),o=s=null,function(e){for(var t,n=-1,r=h.length;++n<r;)d[(t=h[n]).i]=t.x(e);return d.join("")}}}var e0=eJ(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eY:eZ(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),e1=eJ(function(e){return null==e?eY:(l||(l=document.createElementNS("http://www.w3.org/2000/svg","g")),l.setAttribute("transform",e),e=l.transform.baseVal.consolidate())?eZ((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):eY},", ",")",")");function e2(e,t,n){var r=e._id;return e.each(function(){var e=eq(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return eQ(e,r).value[t]}}function e5(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function e3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function e4(){}var e8="\\s*([+-]?\\d+)\\s*",e6="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",e7="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e9=/^#([0-9a-f]{3,8})$/,te=RegExp(`^rgb\\(${e8},${e8},${e8}\\)$`),tt=RegExp(`^rgb\\(${e7},${e7},${e7}\\)$`),tn=RegExp(`^rgba\\(${e8},${e8},${e8},${e6}\\)$`),tr=RegExp(`^rgba\\(${e7},${e7},${e7},${e6}\\)$`),ti=RegExp(`^hsl\\(${e6},${e7},${e7}\\)$`),to=RegExp(`^hsla\\(${e6},${e7},${e7},${e6}\\)$`),ts={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function ta(){return this.rgb().formatHex()}function tl(){return this.rgb().formatRgb()}function tu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e9.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?tc(t):3===n?new tf(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?td(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=te.exec(e))?new tf(t[1],t[2],t[3],1):(t=tt.exec(e))?new tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=tn.exec(e))?td(t[1],t[2],t[3],t[4]):(t=tr.exec(e))?td(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ti.exec(e))?tb(t[1],t[2]/100,t[3]/100,1):(t=to.exec(e))?tb(t[1],t[2]/100,t[3]/100,t[4]):ts.hasOwnProperty(e)?tc(ts[e]):"transparent"===e?new tf(NaN,NaN,NaN,0):null}function tc(e){return new tf(e>>16&255,e>>8&255,255&e,1)}function td(e,t,n,r){return r<=0&&(e=t=n=NaN),new tf(e,t,n,r)}function th(e,t,n,r){var i;return 1==arguments.length?((i=e)instanceof e4||(i=tu(i)),i)?new tf((i=i.rgb()).r,i.g,i.b,i.opacity):new tf:new tf(e,t,n,null==r?1:r)}function tf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function tp(){return`#${ty(this.r)}${ty(this.g)}${ty(this.b)}`}function tg(){let e=tm(this.opacity);return`${1===e?"rgb(":"rgba("}${tv(this.r)}, ${tv(this.g)}, ${tv(this.b)}${1===e?")":`, ${e})`}`}function tm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ty(e){return((e=tv(e))<16?"0":"")+e.toString(16)}function tb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tw(e,t,n,r)}function tx(e){if(e instanceof tw)return new tw(e.h,e.s,e.l,e.opacity);if(e instanceof e4||(e=tu(e)),!e)return new tw;if(e instanceof tw)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+(n<r)*6:n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new tw(s,a,l,e.opacity)}function tw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function t_(e){return(e=(e||0)%360)<0?e+360:e}function tk(e){return Math.max(0,Math.min(1,e||0))}function tS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function tC(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}e5(e4,tu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ta,formatHex:ta,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tx(this).formatHsl()},formatRgb:tl,toString:tl}),e5(tf,th,e3(e4,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tf(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tf(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tf(tv(this.r),tv(this.g),tv(this.b),tm(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tp,formatHex:tp,formatHex8:function(){return`#${ty(this.r)}${ty(this.g)}${ty(this.b)}${ty((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:tg,toString:tg})),e5(tw,function(e,t,n,r){return 1==arguments.length?tx(e):new tw(e,t,n,null==r?1:r)},e3(e4,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new tf(tS(e>=240?e-240:e+120,i,r),tS(e,i,r),tS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tw(t_(this.h),tk(this.s),tk(this.l),tm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tm(this.opacity);return`${1===e?"hsl(":"hsla("}${t_(this.h)}, ${100*tk(this.s)}%, ${100*tk(this.l)}%${1===e?")":`, ${e})`}`}}));let tO=e=>()=>e;function tE(e,t){var n=t-e;return n?function(t){return e+t*n}:tO(isNaN(e)?t:e)}let tM=function e(t){var n,r=1==(n=+t)?tE:function(e,t){var r,i,o;return t-e?(r=e,i=t,r=Math.pow(r,o=n),i=Math.pow(i,o)-r,o=1/o,function(e){return Math.pow(r+e*i,o)}):tO(isNaN(e)?t:e)};function i(e,t){var n=r((e=th(e)).r,(t=th(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),s=tE(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);function tA(e){return function(t){var n,r,i=t.length,o=Array(i),s=Array(i),a=Array(i);for(n=0;n<i;++n)r=th(t[n]),o[n]=r.r||0,s[n]=r.g||0,a[n]=r.b||0;return o=e(o),s=e(s),a=e(a),r.opacity=1,function(e){return r.r=o(e),r.g=s(e),r.b=a(e),r+""}}}tA(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return tC((n-r/t)*t,s,i,o,a)}}),tA(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],a=e[(r+2)%t];return tC((n-r/t)*t,i,o,s,a)}});var tP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tT=RegExp(tP.source,"g");function tR(e,t){var n,r,i,o,s,a=tP.lastIndex=tT.lastIndex=0,l=-1,u=[],c=[];for(e+="",t+="";(i=tP.exec(e))&&(o=tT.exec(t));)(s=o.index)>a&&(s=t.slice(a,s),u[l]?u[l]+=s:u[++l]=s),(i=i[0])===(o=o[0])?u[l]?u[l]+=o:u[++l]=o:(u[++l]=null,c.push({i:l,x:eG(i,o)})),a=tT.lastIndex;return a<t.length&&(s=t.slice(a),u[l]?u[l]+=s:u[++l]=s),u.length<2?c[0]?(n=c[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=c.length,function(e){for(var n,r=0;r<t;++r)u[(n=c[r]).i]=n.x(e);return u.join("")})}function tI(e,t){var n;return("number"==typeof t?eG:t instanceof tu?tM:(n=tu(t))?(t=n,tM):tR)(e,t)}var tD=es.prototype.constructor;function tL(e){return function(){this.style.removeProperty(e)}}var tj=0;function tN(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var tF=es.prototype;tN.prototype=(function(e){return es().transition(e)}).prototype={constructor:tN,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=w(e));for(var r=this._groups,i=r.length,o=Array(i),s=0;s<i;++s)for(var a,l,u=r[s],c=u.length,d=o[s]=Array(c),h=0;h<c;++h)(a=u[h])&&(l=e.call(a,a.__data__,h,u))&&("__data__"in a&&(l.__data__=a.__data__),d[h]=l,eW(d[h],t,n,h,d,eQ(a,n)));return new tN(o,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=k(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l,u=r[a],c=u.length,d=0;d<c;++d)if(l=u[d]){for(var h,f=e.call(l,l.__data__,d,u),p=eQ(l,n),g=0,m=f.length;g<m;++g)(h=f[g])&&eW(h,t,n,g,f,p);o.push(f),s.push(l)}return new tN(o,s,t,n)},selectChild:tF.selectChild,selectChildren:tF.selectChildren,filter:function(e){"function"!=typeof e&&(e=S(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var o,s=t[i],a=s.length,l=r[i]=[],u=0;u<a;++u)(o=s[u])&&e.call(o,o.__data__,u,s)&&l.push(o);return new tN(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=Array(r),a=0;a<o;++a)for(var l,u=t[a],c=n[a],d=u.length,h=s[a]=Array(d),f=0;f<d;++f)(l=u[f]||c[f])&&(h[f]=l);for(;a<r;++a)s[a]=t[a];return new tN(s,this._parents,this._name,this._id)},selection:function(){return new tD(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++tj,r=this._groups,i=r.length,o=0;o<i;++o)for(var s,a=r[o],l=a.length,u=0;u<l;++u)if(s=a[u]){var c=eQ(s,t);eW(s,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tN(r,this._parents,e,n)},call:tF.call,nodes:tF.nodes,node:tF.node,size:tF.size,empty:tF.empty,each:tF.each,on:function(e,t){var n,r,i,o,s,a,l=this._id;return arguments.length<2?eQ(this.node(),l).on.on(e):this.each((n=l,r=e,i=t,a=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eU:eq,function(){var e=a(this,n),t=e.on;t!==o&&(s=(o=t).copy()).on(r,i),e.on=s}))},attr:function(e,t){var n=F(e),r="transform"===n?e1:tI;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,i,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=t(r=s,l))}}:function(e,t,n){var r,i,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttribute(e):(s=this.getAttribute(e))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=t(r=s,l))}})(n,r,e2(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,i,o=n+"";return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}:function(e,t,n){var r,i,o=n+"";return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=F(e);return this.tween(n,(r.local?function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t){this.setAttributeNS(e.space,e.local,i.call(this,t))}),n}return i._value=t,i}:function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t){this.setAttribute(e,i.call(this,t))}),n}return i._value=t,i})(r,t))},style:function(e,t,n){var r,i,o,s,a,l,u,c,d,h,f,p,g,m,v,y,b,x,w,_,k,S="transform"==(e+="")?e0:tI;return null==t?this.styleTween(e,(r=e,function(){var e=z(this,r),t=(this.style.removeProperty(r),z(this,r));return e===t?null:e===i&&t===o?s:s=S(i=e,o=t)})).on("end.style."+e,tL(e)):"function"==typeof t?this.styleTween(e,(a=e,l=e2(this,"style."+e,t),function(){var e=z(this,a),t=l(this),n=t+"";return null==t&&(this.style.removeProperty(a),n=t=z(this,a)),e===n?null:e===u&&n===c?d:(c=n,d=S(u=e,t))})).each((h=this._id,b="end."+(y="style."+(f=e)),function(){var e=eq(this,h),t=e.on,n=null==e.value[y]?v||(v=tL(f)):void 0;(t!==p||m!==n)&&(g=(p=t).copy()).on(b,m=n),e.on=g})):this.styleTween(e,(x=e,k=t+"",function(){var e=z(this,x);return e===k?null:e===w?_:_=S(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,i;function o(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t){this.style.setProperty(e,o.call(this,t),n)}),r}return o._value=t,o}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=e2(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=eQ(this.node(),n).tween,o=0,s=i.length;o<s;++o)if((r=i[o]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var i=eq(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){(r=r.slice()).splice(s,1);break}}i.tween=r}}:function(e,t,n){var r,i;if("function"!=typeof n)throw Error();return function(){var o=eq(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}o.tween=i}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eU(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eU(this,e).delay=t}})(t,e)):eQ(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eq(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eq(this,e).duration=t}})(t,e)):eQ(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eq(this,e).ease=t}}(t,e)):eQ(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eq(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){0==--i&&o()}};n.each(function(){var n=eq(this,r),i=n.on;i!==e&&((t=(e=i).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),n.on=t}),0===i&&o()})},[Symbol.iterator]:tF[Symbol.iterator]};var tB={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};es.prototype.interrupt=function(e){return this.each(function(){eK(this,e)})},es.prototype.transition=function(e){var t,n;e instanceof tN?(t=e._id,e=e._name):(t=++tj,(n=tB).time=eD(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s,a=r[o],l=a.length,u=0;u<l;++u)(s=a[u])&&eW(s,e,t,u,a,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(s,t));return new tN(r,this._parents,e,t)};let tz=e=>()=>e;function tV(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function tH(e,t,n){this.k=e,this.x=t,this.y=n}tH.prototype={constructor:tH,scale:function(e){return 1===e?this:new tH(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tH(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var t$=new tH(1,0,0);function tW(e){for(;!e.__zoom;)if(!(e=e.parentNode))return t$;return e.__zoom}function tU(e){e.stopImmediatePropagation()}function tq(e){e.preventDefault(),e.stopImmediatePropagation()}function tQ(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function tK(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function tG(){return this.__zoom||t$}function tX(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tY(){return navigator.maxTouchPoints||"ontouchstart"in this}function tZ(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function tJ(){var e,t,n,r=tQ,i=tK,o=tZ,s=tX,a=tY,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=ek,h=v("start","zoom","end"),f=0,p=10;function g(e){e.property("__zoom",tG).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",C).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new tH(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new tH(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,o=w(this,e).event(r),s=i.apply(this,e),a=null==n?b(s):"function"==typeof n?n.apply(this,e):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=this.__zoom,c="function"==typeof t?t.apply(this,e):t,h=d(u.invert(a).concat(l/u.k),c.invert(a).concat(l/c.k));return function(e){if(1===e)e=c;else{var t=h(e),n=l/t[2];e=new tH(n,a[0]-t[0]*n,a[1]-t[1]*n)}o.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new _(e,t)}function _(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=i.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),i=this.__zoom,a=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,s.apply(this,arguments)))),c=el(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=i.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(i.k===a)return;n.mouse=[c,i.invert(c)],eK(this),n.start()}tq(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(y(m(i,a),n.mouse[0],n.mouse[1]),n.extent,u))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var i=e.currentTarget,s=w(this,t,!0).event(e),a=ea(e.view).on("mousemove.zoom",function(e){if(tq(e),!s.moved){var t=e.clientX-c,n=e.clientY-d;s.moved=t*t+n*n>f}s.event(e).zoom("mouse",o(y(s.that.__zoom,s.mouse[0]=el(e,i),s.mouse[1]),s.extent,u))},!0).on("mouseup.zoom",function(e){a.on("mousemove.zoom mouseup.zoom",null),ep(e.view,s.moved),tq(e),s.event(e).end()},!0),l=el(e,i),c=e.clientX,d=e.clientY;ef(e.view),tU(e),s.mouse=[l,this.__zoom.invert(l)],eK(this),s.start()}}function C(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,s=el(e.changedTouches?e.changedTouches[0]:e,this),a=n.invert(s),l=n.k*(e.shiftKey?.5:2),d=o(y(m(n,l),s,a),i.apply(this,t),u);tq(e),c>0?ea(this).transition().duration(c).call(x,d,s,e):ea(this).call(g.transform,d,s,e)}}function O(n,...i){if(r.apply(this,arguments)){var o,s,a,l,u=n.touches,c=u.length,d=w(this,i,n.changedTouches.length===c).event(n);for(tU(n),s=0;s<c;++s)l=[l=el(a=u[s],this),this.__zoom.invert(l),a.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,o=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),o&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),eK(this),d.start())}}function E(e,...t){if(this.__zooming){var n,r,i,s,a=w(this,t).event(e),l=e.changedTouches,c=l.length;for(tq(e),n=0;n<c;++n)i=el(r=l[n],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=i:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=i);if(r=a.that.__zoom,a.touch1){var d=a.touch0[0],h=a.touch0[1],f=a.touch1[0],p=a.touch1[1],g=(g=f[0]-d[0])*g+(g=f[1]-d[1])*g,v=(v=p[0]-h[0])*v+(v=p[1]-h[1])*v;r=m(r,Math.sqrt(g/v)),i=[(d[0]+f[0])/2,(d[1]+f[1])/2],s=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!a.touch0)return;i=a.touch0[0],s=a.touch0[1]}a.zoom("touch",o(y(r,i,s),a.extent,u))}}function M(e,...r){if(this.__zooming){var i,o,s=w(this,r).event(e),a=e.changedTouches,l=a.length;for(tU(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<l;++i)o=a[i],s.touch0&&s.touch0[2]===o.identifier?delete s.touch0:s.touch1&&s.touch1[2]===o.identifier&&delete s.touch1;if(s.touch1&&!s.touch0&&(s.touch0=s.touch1,delete s.touch1),s.touch0)s.touch0[1]=this.__zoom.invert(s.touch0[0]);else if(s.end(),2===s.taps&&(o=el(o,this),Math.hypot(t[0]-o[0],t[1]-o[1])<p)){var u=ea(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return g.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property("__zoom",tG),e!==i?x(e,t,n,r):i.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},g.scaleBy=function(e,t,n,r){g.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},g.scaleTo=function(e,t,n,r){g.transform(e,function(){var e=i.apply(this,arguments),r=this.__zoom,s=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,a=r.invert(s),l="function"==typeof t?t.apply(this,arguments):t;return o(y(m(r,l),s,a),e,u)},n,r)},g.translateBy=function(e,t,n,r){g.transform(e,function(){return o(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),u)},null,r)},g.translateTo=function(e,t,n,r,s){g.transform(e,function(){var e=i.apply(this,arguments),s=this.__zoom,a=null==r?b(e):"function"==typeof r?r.apply(this,arguments):r;return o(t$.translate(a[0],a[1]).scale(s.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,u)},r,s)},_.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ea(this.that).datum();h.call(e,this.that,new tV(e,{sourceEvent:this.sourceEvent,target:g,type:e,transform:this.that.__zoom,dispatch:h}),t)}},g.wheelDelta=function(e){return arguments.length?(s="function"==typeof e?e:tz(+e),g):s},g.filter=function(e){return arguments.length?(r="function"==typeof e?e:tz(!!e),g):r},g.touchable=function(e){return arguments.length?(a="function"==typeof e?e:tz(!!e),g):a},g.extent=function(e){return arguments.length?(i="function"==typeof e?e:tz([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),g):i},g.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],g):[l[0],l[1]]},g.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],g):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},g.constrain=function(e){return arguments.length?(o=e,g):o},g.duration=function(e){return arguments.length?(c=+e,g):c},g.interpolate=function(e){return arguments.length?(d=e,g):d},g.on=function(){var e=h.on.apply(h,arguments);return e===h?g:e},g.clickDistance=function(e){return arguments.length?(f=(e*=1)*e,g):Math.sqrt(f)},g.tapDistance=function(e){return arguments.length?(p=+e,g):p},g}function t0(e,t){var n,r,i=typeof t;return null==t||"boolean"===i?tO(t):("number"===i?eG:"string"===i?(r=tu(t))?(t=r,tM):tR:t instanceof tu?tM:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=Array(i),s=Array(r);for(n=0;n<i;++n)o[n]=t0(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},i={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=t0(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}:eG:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}})(e,t)}tW.prototype=tH.prototype;let t1={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},t2=[[-1/0,-1/0],[1/0,1/0]],t5=["Enter"," ","Escape"],t3={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(t=u||(u={})).Strict="strict",t.Loose="loose",(n=c||(c={})).Free="free",n.Vertical="vertical",n.Horizontal="horizontal",(r=d||(d={})).Partial="partial",r.Full="full";let t4={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(i=h||(h={})).Bezier="default",i.Straight="straight",i.Step="step",i.SmoothStep="smoothstep",i.SimpleBezier="simplebezier",(o=f||(f={})).Arrow="arrow",o.ArrowClosed="arrowclosed",(s=p||(p={})).Left="left",s.Top="top",s.Right="right",s.Bottom="bottom";let t8={[p.Left]:p.Right,[p.Right]:p.Left,[p.Top]:p.Bottom,[p.Bottom]:p.Top};function t6(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function t7(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function t9(e){return null===e?null:e?"valid":"invalid"}let ne=e=>"id"in e&&"source"in e&&"target"in e,nt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),nn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nr=(e,t=[0,0])=>{let{width:n,height:r}=nR(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},ni=(e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:nv(e.reduce((e,n)=>{let r="string"==typeof n,i=t.nodeLookup||r?void 0:n;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):nn(n)?n:t.nodeLookup.get(n.id)),ng(e,i?nb(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),no=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=ng(n,nb(e)),r=!0)}),r?nv(n):{x:0,y:0,width:0,height:0}},ns=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{let a={...nO(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(s&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,u=e.height??t.height??t.initialHeight??null,c=nw(a,ny(t)),d=(i??0)*(u??0),h=o&&c>0;(!t.internals.handleBounds||h||c>=d||t.dragging)&&l.push(t)}return l};async function na({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){let a,l;if(0===e.size)return Promise.resolve(!0);let u=nA(no((a=new Map,l=s?.nodes?new Set(s.nodes.map(e=>e.id)):null,e.forEach(e=>{e.measured.width&&e.measured.height&&(s?.includeHiddenNodes||!e.hidden)&&(!l||l.has(e.id))&&a.set(e.id,e)}),a)),t,n,s?.minZoom??i,s?.maxZoom??o,s?.padding??.1);return await r.setViewport(u,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function nl({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){let s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},c=s.origin??r,d=s.extent||i;if("parent"!==s.extent||s.expandParent)a&&nT(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);else if(a){let e=a.measured.width,t=a.measured.height;e&&t&&(d=[[l,u],[l+e,u+t]])}else o?.("005",t1.error005());let h=nT(d)?nd(t,d,s.measured):t;return(void 0===s.measured.width||void 0===s.measured.height)&&o?.("015",t1.error015()),{position:{x:h.x-l+(s.measured.width??0)*c[0],y:h.y-u+(s.measured.height??0)*c[1]},positionAbsolute:h}}async function nu({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let o,s=new Set(e.map(e=>e.id)),a=[];for(let e of n){if(!1===e.deletable)continue;let t=s.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}let l=new Set(t.map(e=>e.id)),u=r.filter(e=>!1!==e.deletable),c=(o=new Set,a.forEach(e=>{o.add(e.id)}),u.filter(e=>o.has(e.source)||o.has(e.target)));for(let e of u)l.has(e.id)&&!c.find(t=>t.id===e.id)&&c.push(e);if(!i)return{edges:c,nodes:a};let d=await i({nodes:a,edges:c});return"boolean"==typeof d?d?{edges:c,nodes:a}:{edges:[],nodes:[]}:d}let nc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),nd=(e={x:0,y:0},t,n)=>({x:nc(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nc(e.y,t[0][1],t[1][1]-(n?.height??0))});function nh(e,t,n){let{width:r,height:i}=nR(n),{x:o,y:s}=n.internals.positionAbsolute;return nd(e,[[o,s],[o+r,s+i]],t)}let nf=(e,t,n)=>e<t?nc(Math.abs(e-t),1,t)/t:e>n?-nc(Math.abs(e-n),1,t)/t:0,np=(e,t,n=15,r=40)=>[nf(e.x,r,t.width-r)*n,nf(e.y,r,t.height-r)*n],ng=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),nm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nv=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ny=(e,t=[0,0])=>{let{x:n,y:r}=nn(e)?e.internals.positionAbsolute:nr(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nb=(e,t=[0,0])=>{let{x:n,y:r}=nn(e)?e.internals.positionAbsolute:nr(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},nx=(e,t)=>nv(ng(nm(e),nm(t))),nw=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),n_=e=>nk(e.width)&&nk(e.height)&&nk(e.x)&&nk(e.y),nk=e=>!isNaN(e)&&isFinite(e),nS=(e,t)=>{},nC=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nO=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{let a={x:(e-n)/i,y:(t-r)/i};return o?nC(a,s):a},nE=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function nM(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let nA=(e,t,n,r,i,o)=>{let s=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=nM(e,n),i=nM(e,t);return{top:r,right:i,bottom:r,left:i,x:2*i,y:2*r}}if("object"==typeof e){let r=nM(e.top??e.y??0,n),i=nM(e.bottom??e.y??0,n),o=nM(e.left??e.x??0,t),s=nM(e.right??e.x??0,t);return{top:r,right:s,bottom:i,left:o,x:o+s,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(o,t,n),a=nc(Math.min((t-s.x)/e.width,(n-s.y)/e.height),r,i),l=e.x+e.width/2,u=e.y+e.height/2,c=t/2-l*a,d=n/2-u*a,h=function(e,t,n,r,i,o){let{x:s,y:a}=nE(e,[t,n,r]),{x:l,y:u}=nE({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(i-l),bottom:Math.floor(o-u)}}(e,c,d,a,t,n),f={left:Math.min(h.left-s.left,0),top:Math.min(h.top-s.top,0),right:Math.min(h.right-s.right,0),bottom:Math.min(h.bottom-s.bottom,0)};return{x:c-f.left+f.right,y:d-f.top+f.bottom,zoom:a}},nP=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nT(e){return null!=e&&"parent"!==e}function nR(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nI(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nD(e,t={width:0,height:0},n,r,i){let o={...e},s=r.get(n);if(s){let e=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*e[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*e[1]}return o}function nL(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function nj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function nN(e){return{...t3,...e||{}}}function nF(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:o,y:s}=nW(e),a=nO({x:o-(i?.left??0),y:s-(i?.top??0)},r),{x:l,y:u}=n?nC(a,t):a;return{xSnapped:l,ySnapped:u,...a}}let nB=e=>({width:e.offsetWidth,height:e.offsetHeight}),nz=e=>e?.getRootNode?.()||window?.document,nV=["INPUT","SELECT","TEXTAREA"];function nH(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(nV.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let n$=e=>"clientX"in e,nW=(e,t)=>{let n=n$(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},nU=(e,t,n,r,i)=>{let o=t.querySelectorAll(`.${e}`);return o&&o.length?Array.from(o).map(t=>{let o=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:i,position:t.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...nB(t)}}):null};function nq({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){let l=.125*e+.375*i+.375*s+.125*n,u=.125*t+.375*o+.375*a+.125*r,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function nQ(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function nK({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case p.Left:return[t-nQ(t-r,o),n];case p.Right:return[t+nQ(r-t,o),n];case p.Top:return[t,n-nQ(n-i,o)];case p.Bottom:return[t,n+nQ(i-n,o)]}}function nG({sourceX:e,sourceY:t,sourcePosition:n=p.Bottom,targetX:r,targetY:i,targetPosition:o=p.Top,curvature:s=.25}){let[a,l]=nK({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,c]=nK({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,h,f,g]=nq({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${i}`,d,h,f,g]}function nX({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,o=Math.abs(r-t)/2;return[n<e?n+i:n-i,r<t?r+o:r-o,i,o]}function nY({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if("manual"===o)return r;let s=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return(i&&n?r+1e3:r)+s}function nZ({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let o=ng(nb(e),nb(t));return o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1),nw({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},nv(o))>0}let nJ=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,n0=(e,t,n={})=>{let r,i;if(!e.source||!e.target)return nS("006",t1.error006()),t;let o=n.getEdgeId||nJ;return(i=r=ne(e)?{...e}:{...e,id:o(e)},t.some(e=>e.source===i.source&&e.target===i.target&&(e.sourceHandle===i.sourceHandle||!e.sourceHandle&&!i.sourceHandle)&&(e.targetHandle===i.targetHandle||!e.targetHandle&&!i.targetHandle)))?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))};function n1({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,o,s,a]=nX({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}let n2={[p.Left]:{x:-1,y:0},[p.Right]:{x:1,y:0},[p.Top]:{x:0,y:-1},[p.Bottom]:{x:0,y:1}},n5=({source:e,sourcePosition:t=p.Bottom,target:n})=>t===p.Left||t===p.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},n3=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function n4({sourceX:e,sourceY:t,sourcePosition:n=p.Bottom,targetX:r,targetY:i,targetPosition:o=p.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:c=.5}){let[d,h,f,g,m]=function({source:e,sourcePosition:t=p.Bottom,target:n,targetPosition:r=p.Top,center:i,offset:o,stepPosition:s}){let a,l,u=n2[t],c=n2[r],d={x:e.x+u.x*o,y:e.y+u.y*o},h={x:n.x+c.x*o,y:n.y+c.y*o},f=n5({source:d,sourcePosition:t,target:h}),g=0!==f.x?"x":"y",m=f[g],v=[],y={x:0,y:0},b={x:0,y:0},[,,x,w]=nX({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(u[g]*c[g]==-1){"x"===g?(a=i.x??d.x+(h.x-d.x)*s,l=i.y??(d.y+h.y)/2):(a=i.x??(d.x+h.x)/2,l=i.y??d.y+(h.y-d.y)*s);let e=[{x:a,y:d.y},{x:a,y:h.y}],t=[{x:d.x,y:l},{x:h.x,y:l}];v=u[g]===m?"x"===g?e:t:"x"===g?t:e}else{let i=[{x:d.x,y:h.y}],s=[{x:h.x,y:d.y}];if(v="x"===g?u.x===m?s:i:u.y===m?i:s,t===r){let t=Math.abs(e[g]-n[g]);if(t<=o){let r=Math.min(o-1,o-t);u[g]===m?y[g]=(d[g]>e[g]?-1:1)*r:b[g]=(h[g]>n[g]?-1:1)*r}}if(t!==r){let e="x"===g?"y":"x",t=u[g]===c[e],n=d[e]>h[e],r=d[e]<h[e];(1===u[g]&&(!t&&n||t&&r)||1!==u[g]&&(!t&&r||t&&n))&&(v="x"===g?i:s)}let f={x:d.x+y.x,y:d.y+y.y},p={x:h.x+b.x,y:h.y+b.y};Math.max(Math.abs(f.x-v[0].x),Math.abs(p.x-v[0].x))>=Math.max(Math.abs(f.y-v[0].y),Math.abs(p.y-v[0].y))?(a=(f.x+p.x)/2,l=v[0].y):(a=v[0].x,l=(f.y+p.y)/2)}return[[e,{x:d.x+y.x,y:d.y+y.y},...v,{x:h.x+b.x,y:h.y+b.y},n],a,l,x,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:u,stepPosition:c});return[d.reduce((e,t,n)=>e+(n>0&&n<d.length-1?function(e,t,n,r){let i=Math.min(n3(e,t)/2,n3(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${o+i*t},${s}Q ${o},${s} ${o},${s+i*r}`}let a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}(d[n-1],t,d[n+1],s):`${0===n?"M":"L"}${t.x} ${t.y}`),""),h,f,g,m]}function n8(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function n6(e){let{sourceNode:t,targetNode:n}=e;if(!n8(t)||!n8(n))return null;let r=t.internals.handleBounds||n7(t.handles),i=n.internals.handleBounds||n7(n.handles),o=re(r?.source??[],e.sourceHandle),s=re(e.connectionMode===u.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!o||!s)return e.onError?.("008",t1.error008(!o?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let a=o?.position||p.Bottom,l=s?.position||p.Top,c=n9(t,o,a),d=n9(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function n7(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function n9(e,t,n=p.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,o=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??nR(e);if(r)return{x:i+s/2,y:o+a/2};switch(t?.position??n){case p.Top:return{x:i+s/2,y:o};case p.Right:return{x:i+s,y:o+a/2};case p.Bottom:return{x:i+s/2,y:o+a};case p.Left:return{x:i,y:o+a/2}}}function re(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function rt(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}function rn(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let o=new Set;return e.reduce((e,s)=>([s.markerStart||r,s.markerEnd||i].forEach(r=>{if(r&&"object"==typeof r){let i=rt(r,t);o.has(i)||(e.push({id:i,color:r.color||n,...r}),o.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}function rr(e,t,n,r,i){let o=.5;"start"===i?o=0:"end"===i&&(o=1);let s=[(e.x+e.width*o)*t.zoom+t.x,e.y*t.zoom+t.y-r],a=[-100*o,-100];switch(n){case p.Right:s=[(e.x+e.width)*t.zoom+t.x+r,(e.y+e.height*o)*t.zoom+t.y],a=[0,-100*o];break;case p.Bottom:s[1]=(e.y+e.height)*t.zoom+t.y+r,a[1]=0;break;case p.Left:s=[e.x*t.zoom+t.x-r,(e.y+e.height*o)*t.zoom+t.y],a=[-100,-100*o]}return`translate(${s[0]}px, ${s[1]}px) translate(${a[0]}%, ${a[1]}%)`}let ri={left:0,center:50,right:100},ro={top:0,center:50,bottom:100};function rs(e,t,n,r="center",i="center"){return`translate(${e}px, ${t}px) scale(${1/n}) translate(${-(ri[r]??50)}%, ${-(ro[i]??50)}%)`}let ra={nodeOrigin:[0,0],nodeExtent:t2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rl={...ra,checkEquality:!0};function ru(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function rc(e,t,n){let r=ru(ra,n);for(let n of e.values())if(n.parentId)rf(n,e,t,r);else{let e=nd(nr(n,r.nodeOrigin),nT(n.extent)?n.extent:r.nodeExtent,nR(n));n.internals.positionAbsolute=e}}function rd(e){return"manual"===e}function rh(e,t,n,r={}){let i=ru(rl,r),o={i:0},s=new Map(t),a=i?.elevateNodesOnSelect&&!rd(i.zIndexMode)?1e3:0,l=e.length>0;for(let u of(t.clear(),n.clear(),e)){let e=s.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=nd(nr(u,i.nodeOrigin),nT(u.extent)?u.extent:i.nodeExtent,nR(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(i):"target"===t.type&&r.push(i)}return{source:n,target:r}}(u,e),z:rp(u,a,i.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(l=!1),u.parentId&&rf(e,t,n,r,o)}return l}function rf(e,t,n,r,i){let{elevateNodesOnSelect:o,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=ru(ra,r),u=e.parentId,c=t.get(u);if(!c)return void console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),i&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===l&&(c.internals.rootParentIndex=++i.i,c.internals.z=c.internals.z+10*i.i),i&&void 0!==c.internals.rootParentIndex&&(i.i=c.internals.rootParentIndex);let{x:d,y:h,z:f}=function(e,t,n,r,i,o){let{x:s,y:a}=t.internals.positionAbsolute,l=nR(e),u=nr(e,n),c=nT(e.extent)?nd(u,e.extent,l):u,d=nd({x:s+c.x,y:a+c.y},r,l);"parent"===e.extent&&(d=nh(d,l,t));let h=rp(e,i,o),f=t.internals.z??0;return{x:d.x,y:d.y,z:f>=h?f+1:h}}(e,c,s,a,o&&!rd(l)?1e3:0,l),{positionAbsolute:p}=e.internals,g=d!==p.x||h!==p.y;(g||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:d,y:h}:p,z:f}})}function rp(e,t,n){let r=nk(e.zIndex)?e.zIndex:0;return rd(n)?r:r+(e.selected?t:0)}function rg(e,t,n,r=[0,0]){let i=[],o=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=nx(o.get(n.parentId)?.expandedRect??ny(e),n.rect);o.set(n.parentId,{expandedRect:r,parent:e})}return o.size>0&&o.forEach(({expandedRect:t,parent:o},s)=>{let a=o.internals.positionAbsolute,l=nR(o),u=o.origin??r,c=t.x<a.x?Math.round(Math.abs(a.x-t.x)):0,d=t.y<a.y?Math.round(Math.abs(a.y-t.y)):0,h=Math.max(l.width,Math.round(t.width)),f=Math.max(l.height,Math.round(t.height)),p=(h-l.width)*u[0],g=(f-l.height)*u[1];(c>0||d>0||p||g)&&(i.push({id:s,type:"position",position:{x:o.position.x-c+p,y:o.position.y-d+g}}),n.get(s)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||c||d)&&i.push({id:s,type:"dimensions",setAttributes:!0,dimensions:{width:h+(c?u[0]*c-p:0),height:f+(d?u[1]*d-g:0)}})}),i}function rm(e,t,n,r,i,o,s){let a=r?.querySelector(".xyflow__viewport"),l=!1;if(!a)return{changes:[],updatedInternals:l};let u=[],c=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(c.transform),h=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}let a=nB(r.nodeElement),c=e.measured.width!==a.width||e.measured.height!==a.height;if(a.width&&a.height&&(c||!e.internals.handleBounds||r.force)){let f=r.nodeElement.getBoundingClientRect(),p=nT(e.extent)?e.extent:o,{positionAbsolute:g}=e.internals;e.parentId&&"parent"===e.extent?g=nh(g,a,t.get(e.parentId)):p&&(g=nd(g,p,a));let m={...e,measured:a,internals:{...e.internals,positionAbsolute:g,handleBounds:{source:nU("source",r.nodeElement,f,d,e.id),target:nU("target",r.nodeElement,f,d,e.id)}}};t.set(e.id,m),e.parentId&&rf(m,t,n,{nodeOrigin:i,zIndexMode:s}),l=!0,c&&(u.push({id:e.id,type:"dimensions",dimensions:a}),e.expandParent&&e.parentId&&h.push({id:e.id,parentId:e.parentId,rect:ny(m,i)}))}}if(h.length>0){let e=rg(h,t,n,i);u.push(...e)}return{changes:u,updatedInternals:l}}async function rv({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r);return Promise.resolve(!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]))}function ry(e,t,n,r,i,o){let s=i,a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${i}-${e}`;let l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),o){s=`${i}-${e}-${o}`;let a=r.get(s)||new Map;r.set(s,a.set(n,t))}}function rb(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:i,sourceHandle:o=null,targetHandle:s=null}=r,a={edgeId:r.id,source:n,target:i,sourceHandle:o,targetHandle:s},l=`${n}-${o}--${i}-${s}`;ry("source",a,`${i}-${s}--${n}-${o}`,e,n,o),ry("target",a,l,e,i,s),t.set(r.id,r)}}function rx(e,t){if(null===e||null===t)return!1;let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e].id!==r[e].id||n[e].type!==r[e].type||!Object.is(n[e].data,r[e].data))return!1;return!0}function rw(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r)return!1}function r_({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,o]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:o.position,dragging:r})}if(!e)return[i[0],i];let o=n.get(e)?.internals.userNode;return[o?{...o,position:t.get(e)?.position||o.position,dragging:r}:i[0],i]}function rk({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},c=null,d=!1,h=null,f=!1,p=!1,g=null;return{update:function({noDragClassName:m,handleSelector:v,domNode:y,isSelectable:b,nodeId:x,nodeClickDistance:w=0}){function _({x:e,y:n}){let{nodeLookup:i,nodeExtent:s,snapGrid:l,snapToGrid:u,nodeOrigin:c,onNodeDrag:d,onSelectionDrag:h,onError:f,updateNodePositions:m}=t();o={x:e,y:n};let v=!1,y=a.size>1,b=y&&s?nm(no(a)):null,w=y&&u?function({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let o={x:n-i.distance.x,y:r-i.distance.y},s=nC(o,t);return{x:s.x-o.x,y:s.y-o.y}}({dragItems:a,snapGrid:l,x:e,y:n}):null;for(let[t,r]of a){if(!i.has(t))continue;let o={x:e-r.distance.x,y:n-r.distance.y};u&&(o=w?{x:Math.round(o.x+w.x),y:Math.round(o.y+w.y)}:nC(o,l));let a=null;if(y&&s&&!r.extent&&b){let{positionAbsolute:e}=r.internals,t=e.x-b.x+s[0][0],n=e.x+r.measured.width-b.x2+s[1][0];a=[[t,e.y-b.y+s[0][1]],[n,e.y+r.measured.height-b.y2+s[1][1]]]}let{position:d,positionAbsolute:h}=nl({nodeId:t,nextPosition:o,nodeLookup:i,nodeExtent:a||s,nodeOrigin:c,onError:f});v=v||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=h}if(p=p||v,v&&(m(a,!0),g&&(r||d||!x&&h))){let[e,t]=r_({nodeId:x,dragItems:a,nodeLookup:i});r?.(g,a,e,t),d?.(g,e,t),x||h?.(g,t)}}async function k(){if(!c)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){l=!1,cancelAnimationFrame(s);return}let[a,d]=np(u,c,r);(0!==a||0!==d)&&(o.x=(o.x??0)-a/e[2],o.y=(o.y??0)-d/e[2],await n({x:a,y:d})&&_(o)),s=requestAnimationFrame(k)}function S(r){let{nodeLookup:i,multiSelectionActive:s,nodesDraggable:l,transform:u,snapGrid:h,snapToGrid:f,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:m,unselectNodesAndEdges:v}=t();d=!0,p&&b||s||!x||i.get(x)?.selected||v(),b&&p&&x&&e?.(x);let y=nF(r.sourceEvent,{transform:u,snapGrid:h,snapToGrid:f,containerBounds:c});if(o=y,(a=function(e,t,n,r){let i=new Map;for(let[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(s,e))&&(s.draggable||t&&void 0===s.draggable)){let t=e.get(o);t&&i.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}(i,l,y,x)).size>0&&(n||g||!x&&m)){let[e,t]=r_({nodeId:x,dragItems:a,nodeLookup:i});n?.(r.sourceEvent,a,e,t),g?.(r.sourceEvent,e,t),x||m?.(r.sourceEvent,t)}}h=ea(y);let C=ew().clickDistance(w).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:s,snapToGrid:a}=t();c=n?.getBoundingClientRect()||null,f=!1,p=!1,g=e.sourceEvent,0===r&&S(e),o=nF(e.sourceEvent,{transform:i,snapGrid:s,snapToGrid:a,containerBounds:c}),u=nW(e.sourceEvent,c)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:s,nodeDragThreshold:h,nodeLookup:p}=t(),m=nF(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:s,containerBounds:c});if(g=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||x&&!p.has(x))&&(f=!0),!f){if(!l&&n&&d&&(l=!0,k()),!d){let t=nW(e.sourceEvent,c),n=t.x-u.x,r=t.y-u.y;Math.sqrt(n*n+r*r)>h&&S(e)}(o.x!==m.xSnapped||o.y!==m.ySnapped)&&a&&d&&(u=nW(e.sourceEvent,c),_(m))}}).on("end",e=>{if(d&&!f&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:o,onSelectionDragStop:s}=t();if(p&&(r(a,!1),p=!1),i||o||!x&&s){let[t,r]=r_({nodeId:x,dragItems:a,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,a,t,r),o?.(e.sourceEvent,t,r),x||s?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!m||!rw(t,`.${m}`,y))&&(!v||rw(t,v,y))});h.call(C)},destroy:function(){h?.on(".drag",null)}}}function rS(e,t,n,r,i,o=!1){let s=r.get(e);if(!s)return null;let a="strict"===i?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(e=>e.id===n):a?.[0])??null;return l&&o?{...l,...n9(s,l,l.position,!0)}:l}function rC(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let rO=()=>!0;function rE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:c=rO,nodeLookup:d}){let h="target"===o,f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=nW(e),m=s.elementFromPoint(p,g),v=m?.classList.contains(`${a}-flow__handle`)?m:f,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){let e=rC(void 0,v),t=v.getAttribute("data-nodeid"),o=v.getAttribute("data-handleid"),s=v.classList.contains("connectable"),a=v.classList.contains("connectableend");if(!t||!e)return y;let l={source:h?t:r,sourceHandle:h?o:i,target:h?r:t,targetHandle:h?i:o};y.connection=l,y.isValid=s&&a&&(n===u.Strict?h&&"source"===e||!h&&"target"===e:t!==r||o!==i)&&c(l),y.toHandle=rS(t,e,o,d,n,!0)}return y}let rM={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:c,flowId:d,panBy:h,cancelConnection:f,onConnectStart:g,onConnect:m,onConnectEnd:v,isValidConnection:y=rO,onReconnectEnd:b,updateConnection:x,getTransform:w,getFromHandle:_,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:C}){let O,E=nz(e.target),M=0,{x:A,y:P}=nW(e),T=rC(o,C),R=a?.getBoundingClientRect(),I=!1;if(!R||!T)return;let D=rS(i,T,r,l,t);if(!D)return;let L=nW(e,R),j=!1,N=null,F=!1,B=null,z={...D,nodeId:i,type:T,position:D.position},V=l.get(i),H={inProgress:!0,isValid:null,from:n9(V,z,p.Left,!0),fromHandle:z,fromPosition:z.position,fromNode:V,to:L,toHandle:null,toPosition:t8[z.position],toNode:null,pointer:L};function $(){I=!0,x(H),g?.(e,{nodeId:i,handleId:r,handleType:T})}function W(e){var o,a;let f;if(!I){let{x:t,y:n}=nW(e),r=t-A,i=n-P;if(!(r*r+i*i>S*S))return;$()}if(!_()||!z)return void U(e);let g=w();O=function(e,t,n,r){let i=[],o=1/0;for(let s of function(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())nw(i,ny(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:a,y:l}=n9(s,n,n.position,!0),u=Math.sqrt(Math.pow(a-e.x,2)+Math.pow(l-e.y,2));u>t||(u<o?(i=[{...n,x:a,y:l}],o=u):u===o&&i.push({...n,x:a,y:l}))}if(!i.length)return null;if(i.length>1){let e="source"===r.type?"target":"source";return i.find(t=>t.type===e)??i[0]}return i[0]}(nO(L=nW(e,R),g,!1,[1,1]),n,l,z),j||(!function e(){if(!c||!R)return;let[t,n]=np(L,R,k);h({x:t,y:n}),M=requestAnimationFrame(e)}(),j=!0);let m=rE(e,{handle:O,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:y,doc:E,lib:u,flowId:d,nodeLookup:l});B=m.handleDomNode,N=m.connection,o=!!O,a=m.isValid,f=null,a?f=!0:o&&!a&&(f=!1),F=f;let v=l.get(i),b=v?n9(v,z,p.Left,!0):H.from,C={...H,from:b,isValid:F,to:m.toHandle&&F?nE({x:m.toHandle.x,y:m.toHandle.y},g):L,toHandle:m.toHandle,toPosition:F&&m.toHandle?m.toHandle.position:t8[z.position],toNode:m.toHandle?l.get(m.toHandle.nodeId):null,pointer:L};x(C),H=C}function U(e){if(!("touches"in e)||!(e.touches.length>0)){if(I){(O||B)&&N&&F&&m?.(N);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};v?.(e,r),o&&b?.(e,r)}f(),cancelAnimationFrame(M),j=!1,F=!1,N=null,B=null,E.removeEventListener("mousemove",W),E.removeEventListener("mouseup",U),E.removeEventListener("touchmove",W),E.removeEventListener("touchend",U)}}0===S&&$(),E.addEventListener("mousemove",W),E.addEventListener("mouseup",U),E.addEventListener("touchmove",W),E.addEventListener("touchend",U)},isValid:rE};function rA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=ea(e);return{update:function({translateExtent:e,width:o,height:s,zoomStep:a=1,pannable:l=!0,zoomable:u=!0,inversePan:c=!1}){let d=[0,0],h=tJ().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?i=>{let a=n();if("mousemove"!==i.sourceEvent.type&&"touchmove"!==i.sourceEvent.type||!t)return;let l=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],u=[l[0]-d[0],l[1]-d[1]];d=l;let h=r()*Math.max(a[2],Math.log(a[2]))*(c?-1:1),f={x:a[0]-u[0]*h,y:a[1]-u[1]*h};t.setViewportConstrained({x:f.x,y:f.y,zoom:a[2]},[[0,0],[o,s]],e)}:null).on("zoom.wheel",u?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&nP()?10:1,o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*a,s=r[2]*Math.pow(2,o*i);t.scaleTo(s)}:null);i.call(h,{})},destroy:function(){i.on("zoom",null)},pointer:el}}let rP=e=>({x:e.x,y:e.y,zoom:e.k}),rT=({x:e,y:t,zoom:n})=>t$.translate(e,t).scale(n),rR=(e,t)=>e.target.closest(`.${t}`),rI=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),rD=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rL=(e,t=0,n=rD,r=()=>{})=>{let i="number"==typeof t&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},rj=e=>{let t=e.ctrlKey&&nP()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function rN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=tJ().scaleExtent([t,n]).translateExtent(r),f=ea(e).call(h);y({x:i.x,y:i.y,zoom:nc(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");function m(e,t){return f?new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?t0:ek).transform(rL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function v(){h.on("zoom",null)}async function y(e,t,n){let r=rT(e),i=h?.constrain()(r,t,n);return i&&await m(i),new Promise(e=>e(i))}return h.wheelDelta(rj),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:d,panOnScrollMode:m,panOnScrollSpeed:y,preventScrolling:b,zoomOnPinch:x,zoomOnScroll:w,zoomOnDoubleClick:_,zoomActivationKeyPressed:k,lib:S,onTransformChange:C,connectionInProgress:O,paneClickDistance:E,selectionOnDrag:M}){r&&!u.isZoomingOrPanning&&v();let A=i&&!k&&!r;h.clickDistance(M?1/0:!nk(E)||E<0?0:E);let P=A?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(rR(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&s){let e=el(d),t=h*Math.pow(2,rj(d));r.scaleTo(n,t,e,d);return}let f=1===d.deltaMode?20:1,p=i===c.Vertical?0:d.deltaX*f,g=i===c.Horizontal?0:d.deltaY*f;!nP()&&d.shiftKey&&i!==c.Vertical&&(p=d.deltaY*f,g=0),r.translateBy(n,-(p/h)*o,-(g/h)*o,{internal:!0});let m=rP(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(d,m),e.panScrollTimeout=setTimeout(()=>{u?.(d,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(d,m))}}({zoomPanValues:u,noWheelClassName:e,d3Selection:f,d3Zoom:h,panOnScrollMode:m,panOnScrollSpeed:y,zoomOnPinch:x,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:a}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let o="wheel"===r.type,s=!t&&o&&!r.ctrlKey,a=rR(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,i)}}({noWheelClassName:e,preventScrolling:b,d3ZoomHandler:p});if(f.on("wheel.zoom",P,{passive:!1}),!r){let e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=rP(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});h.on("start",e);let t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{e.usedRightMouseButton=!!(n&&rI(t,e.mouseButton??0)),o.sourceEvent?.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!o.sourceEvent?.internal&&i?.(o.sourceEvent,rP(o.transform))}}({zoomPanValues:u,panOnDrag:d,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:C});h.on("zoom",t);let r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&rI(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=rP(s.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(s.sourceEvent,t)},150*!!n)}}}({zoomPanValues:u,panOnDrag:d,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:a,onDraggingChange:l});h.on("end",r)}let T=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:c}){return d=>{let h=e||t,f=n&&d.ctrlKey,p="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(rR(d,`${u}-flow__node`)||rR(d,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!o&&!n||s||c&&!p||rR(d,a)&&p||rR(d,l)&&(!p||i&&p&&!e)||!n&&d.ctrlKey&&p)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!h&&!i&&!f&&p||!r&&("mousedown"===d.type||"touchstart"===d.type)||Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;let g=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||p)&&g}}({zoomActivationKeyPressed:k,panOnDrag:d,zoomOnScroll:w,panOnScroll:i,zoomOnDoubleClick:_,zoomOnPinch:x,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:S,connectionInProgress:O});h.filter(T),_?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)},destroy:v,setViewport:async function e(e,t){let n=rT(e);return await m(n,t),new Promise(e=>e(n))},setViewportConstrained:y,getViewport:function(){let e=f?tW(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?t0:ek).scaleTo(rL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?t0:ek).scaleBy(rL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){h?.scaleExtent(e)},setTranslateExtent:function(e){h?.translateExtent(e)},syncViewport:function(e){if(f){let t=rT(e),n=f.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&h?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){let t=!nk(e)||e<0?0:e;h?.clickDistance(t)}}}(a=g||(g={})).Line="line",a.Handle="handle";let rF=["top-left","top-right","bottom-left","bottom-right"],rB=["top","right","bottom","left"];function rz(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}function rV(e,t){return Math.max(0,t-e)}function rH(e,t){return Math.max(0,e-t)}function r$(e,t,n){return Math.max(0,t-e,e-n)}let rW={width:0,height:0,x:0,y:0},rU={...rW,pointerX:0,pointerY:0,aspectRatio:1};function rq({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let o=ea(e),s={controlDirection:rz("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:a,keepAspectRatio:l,resizeDirection:u,onResizeStart:c,onResize:d,onResizeEnd:h,shouldResize:f}){let p,g,m,v,y={...rW},b={...rU};s={boundaries:a,resizeDirection:u,keepAspectRatio:l,controlDirection:rz(e)};let x=null,w=[],_=!1,k=ew().on("start",e=>{let{nodeLookup:r,transform:i,snapGrid:o,snapToGrid:s,nodeOrigin:a,paneDomNode:l}=n();if(!(p=r.get(t)))return;x=l?.getBoundingClientRect()??null;let{xSnapped:u,ySnapped:d}=nF(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:x});if(b={...y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},pointerX:u,pointerY:d,aspectRatio:y.width/y.height},g=void 0,p.parentId&&("parent"===p.extent||p.expandParent)){var h;m=(g=r.get(p.parentId))&&"parent"===p.extent?[[0,0],[(h=g).measured.width,h.measured.height]]:void 0}for(let[e,n]of(w=[],v=void 0,r))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,l=n[1]*s;return[[r-a,i-l],[r+o-a,i+s-l]]}(n,p,n.origin??a);v=v?[[Math.min(e[0][0],v[0][0]),Math.min(e[0][1],v[0][1])],[Math.max(e[1][0],v[1][0]),Math.max(e[1][1],v[1][1])]]:e}c?.(e,{...y})}).on("drag",e=>{let{transform:t,snapGrid:i,snapToGrid:o,nodeOrigin:a}=n(),l=nF(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:o,containerBounds:x}),u=[];if(!p)return;let{x:c,y:h,width:k,height:S}=y,C={},O=p.origin??a,{width:E,height:M,x:A,y:P}=function(e,t,n,r,i,o,s,a){var l,u,c,d;let{affectsX:h,affectsY:f}=t,{isHorizontal:p,isVertical:g}=t,m=p&&g,{xSnapped:v,ySnapped:y}=n,{minWidth:b,maxWidth:x,minHeight:w,maxHeight:_}=r,{x:k,y:S,width:C,height:O,aspectRatio:E}=e,M=Math.floor(p?v-e.pointerX:0),A=Math.floor(g?y-e.pointerY:0),P=C+(h?-M:M),T=O+(f?-A:A),R=-o[0]*C,I=-o[1]*O,D=r$(P,b,x),L=r$(T,w,_);if(s){let e=0,t=0;h&&M<0?e=rV(k+M+R,s[0][0]):!h&&M>0&&(e=rH(k+P+R,s[1][0])),f&&A<0?t=rV(S+A+I,s[0][1]):!f&&A>0&&(t=rH(S+T+I,s[1][1])),D=Math.max(D,e),L=Math.max(L,t)}if(a){let e=0,t=0;h&&M>0?e=rH(k+M,a[0][0]):!h&&M<0&&(e=rV(k+P,a[1][0])),f&&A>0?t=rH(S+A,a[0][1]):!f&&A<0&&(t=rV(S+T,a[1][1])),D=Math.max(D,e),L=Math.max(L,t)}if(i){if(p){(D=Math.max(D,r$(P/E,w,_)*E),s)&&(D=Math.max(D,(h||f)&&(!h||f||!m)?rV(S+I+(h?M:-M)/E,s[0][1])*E:rH(S+I+P/E,s[1][1])*E));a&&(D=Math.max(D,(h||f)&&(!h||f||!m)?rH(S+(h?M:-M)/E,a[0][1])*E:rV(S+P/E,a[1][1])*E))}if(g){(L=Math.max(L,r$(T*E,b,x)/E),s)&&(L=Math.max(L,(h||f)&&(!f||h||!m)?rV(k+(f?A:-A)*E+R,s[0][0])/E:rH(k+T*E+R,s[1][0])/E));a&&(L=Math.max(L,(h||f)&&(!f||h||!m)?rH(k+(f?A:-A)*E,a[0][0])/E:rV(k+T*E,a[1][0])/E))}}A+=A<0?L:-L,M+=M<0?D:-D,i&&(m?P>T*E?A=((l=h,u=f,l?!u:u)?-M:M)/E:M=((c=h,d=f,c?!d:d)?-A:A)*E:p?(A=M/E,f=h):(M=A*E,h=f));let j=h?k+M:k,N=f?S+A:S;return{width:C+(h?-M:M),height:O+(f?-A:A),x:o[0]*M*(h?-1:1)+j,y:o[1]*A*(f?-1:1)+N}}(b,s.controlDirection,l,s.boundaries,s.keepAspectRatio,O,m,v),T=E!==k,R=M!==S,I=A!==c&&T,D=P!==h&&R;if(!I&&!D&&!T&&!R)return;if((I||D||1===O[0]||1===O[1])&&(C.x=I?A:y.x,C.y=D?P:y.y,y.x=C.x,y.y=C.y,w.length>0)){let e=A-c,t=P-h;for(let n of w)n.position={x:n.position.x-e+O[0]*(E-k),y:n.position.y-t+O[1]*(M-S)},u.push(n)}if((T||R)&&(C.width=T&&(!s.resizeDirection||"horizontal"===s.resizeDirection)?E:y.width,C.height=R&&(!s.resizeDirection||"vertical"===s.resizeDirection)?M:y.height,y.width=C.width,y.height=C.height),g&&p.expandParent){let e=O[0]*(C.width??0);C.x&&C.x<e&&(y.x=e,b.x=b.x-(C.x-e));let t=O[1]*(C.height??0);C.y&&C.y<t&&(y.y=t,b.y=b.y-(C.y-t))}let L=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){let s=e-t,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(l[0]=-1*l[0]),a&&o&&(l[1]=-1*l[1]),l}({width:y.width,prevWidth:k,height:y.height,prevHeight:S,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),j={...y,direction:L};!1!==f?.(e,j)&&(_=!0,d?.(e,j),r(C,u))}).on("end",e=>{_&&(h?.(e,{...y}),i?.({...y}),_=!1)});o.call(k)},destroy:function(){o.on(".drag",null)}}}e.s(["ConnectionLineType",()=>h,"ConnectionMode",()=>u,"MarkerType",()=>f,"PanOnScrollMode",()=>c,"Position",()=>p,"ResizeControlVariant",()=>g,"SelectionMode",()=>d,"XYDrag",()=>rk,"XYHandle",()=>rM,"XYMinimap",()=>rA,"XYPanZoom",()=>rN,"XYResizer",()=>rq,"XY_RESIZER_HANDLE_POSITIONS",()=>rF,"XY_RESIZER_LINE_POSITIONS",()=>rB,"addEdge",()=>n0,"adoptUserNodes",()=>rh,"areConnectionMapsEqual",()=>t6,"areSetsEqual",()=>nL,"calculateNodePosition",()=>nl,"createMarkerIds",()=>rn,"defaultAriaLabelConfig",()=>t3,"devWarn",()=>nS,"elementSelectionKeys",()=>t5,"errorMessages",()=>t1,"evaluateAbsolutePosition",()=>nD,"fitViewport",()=>na,"getBezierEdgeCenter",()=>nq,"getBezierPath",()=>nG,"getBoundsOfRects",()=>nx,"getConnectionStatus",()=>t9,"getDimensions",()=>nB,"getEdgePosition",()=>n6,"getEdgeToolbarTransform",()=>rs,"getElementsToRemove",()=>nu,"getElevatedEdgeZIndex",()=>nY,"getEventPosition",()=>nW,"getHandlePosition",()=>n9,"getHostForElement",()=>nz,"getInternalNodesBounds",()=>no,"getMarkerId",()=>rt,"getNodeDimensions",()=>nR,"getNodeToolbarTransform",()=>rr,"getNodesBounds",()=>ni,"getNodesInside",()=>ns,"getOverlappingArea",()=>nw,"getSmoothStepPath",()=>n4,"getStraightPath",()=>n1,"getViewportForBounds",()=>nA,"handleConnectionChange",()=>t7,"handleExpandParent",()=>rg,"infiniteExtent",()=>t2,"initialConnection",()=>t4,"isEdgeBase",()=>ne,"isEdgeVisible",()=>nZ,"isInputDOMNode",()=>nH,"isMacOs",()=>nP,"isMouseEvent",()=>n$,"isNodeBase",()=>nt,"isNumeric",()=>nk,"isRectObject",()=>n_,"mergeAriaLabelConfig",()=>nN,"nodeHasDimensions",()=>nI,"nodeToRect",()=>ny,"panBy",()=>rv,"pointToRendererPoint",()=>nO,"rendererPointToPoint",()=>nE,"shallowNodeData",()=>rx,"snapPosition",()=>nC,"updateAbsolutePositions",()=>rc,"updateConnectionLookup",()=>rb,"updateNodeInternals",()=>rm,"withResolvers",()=>nj],292002)},523043,81167,e=>{"use strict";var t=e.i(35380),n=e.i(292002);function r(e,t,n=1e3){let i=new Set,o={},s=(e,n)=>{if(!(n<0)&&(null==o[e]||!(o[e]>=n))){for(let r of(o[e]=n,t(e)))s(r,n-1);i.add(e)}};for(let t of e)s(t,n);return i}function i(...e){let t=new Set;return e.forEach(e=>{e.forEach(e=>{t.add(e)})}),t}function o(e){return"lineageGraphNode"===e.type}function s(e){return"lineageGraphColumnNode"===e.type}function a(e,t,n){let r={},i={},o=(e,t)=>({id:e,data:{id:e,name:e,from:t,data:{base:void 0,current:void 0},parents:{},children:{}},type:"lineageGraphNode"});for(let[t,n]of Object.entries(e.nodes))r[t]=o(t,"base"),n&&(r[t].data.data.base=n,r[t].data.name=n.name,r[t].data.resourceType=n.resource_type,r[t].data.packageName=n.package_name);for(let[e,n]of Object.entries(t.nodes))r[e]?r[e].data.from="both":r[e]=o(e,"current"),n&&(r[e].data.data.current=t.nodes[e],r[e].data.name=n.name,r[e].data.resourceType=n.resource_type,r[e].data.packageName=n.package_name);for(let[t,n]of Object.entries(e.parent_map))for(let e of n){let n=r[t],o=r[e],s=`${e}_${t}`;if(!n||!o)continue;i[s]={id:s,source:o.id,target:n.id,data:{from:"base"}};let a=i[s];n.data.parents[e]=a,o.data.children[t]=a}for(let[e,n]of Object.entries(t.parent_map))for(let t of n){let n=r[e],o=r[t],s=`${t}_${e}`;if(!n||!o)continue;let a=i[s];a?.data&&i[s].data?i[s].data.from="both":i[s]={id:s,source:o.id,target:n.id,data:{from:"current"}};let l=i[s];n.data.parents[t]=l,o.data.children[e]=l}let s=[];for(let[e,t]of Object.entries(r)){let r=n?.[e];if(r)t.data.changeStatus=r.change_status,r.change&&(t.data.change={category:r.change.category,columns:r.change.columns}),s.push(e);else if("base"===t.data.from)t.data.changeStatus="removed",s.push(t.id);else if("current"===t.data.from)t.data.changeStatus="added",s.push(t.id);else{let e=t.data.data.base?.checksum?.checksum,n=t.data.data.current?.checksum?.checksum;e&&n&&e!==n&&(t.data.changeStatus="modified",s.push(t.id))}}for(let[,e]of Object.entries(i))e.data&&("base"===e.data.from?e.data.changeStatus="removed":"current"===e.data.from&&(e.data.changeStatus="added"));return{nodes:r,edges:i,modifiedSet:s,manifestMetadata:{base:e.manifest_metadata??void 0,current:t.manifest_metadata??void 0},catalogMetadata:{base:e.catalog_metadata??void 0,current:t.catalog_metadata??void 0}}}function l(e,t,n=1e3){return r(t,t=>void 0===e.nodes[t]?[]:Object.keys(e.nodes[t].data.parents),n)}function u(e,t,n=1e3){return r(t,t=>void 0===e.nodes[t]?[]:Object.keys(e.nodes[t].data.children),n)}function c(e,t){let r=[],i=[],{selectedNodes:o,cll:s}=t??{},a={};function l(e){return"base"===e?0:"current"===e?2:1}function u(e,t){let n=l(e.data?.from),r=l(t.data?.from);return n<r?-1:+(n>r)}let c=void 0!==o?new Set(o):void 0;for(let t of Object.values(e.nodes).sort(u)){if(c&&!c.has(t.id))continue;let e=new Set,o=0;if(s){let a=s.current;for(let e of a?.parent_map[t.id]??new Set){let n=t.id;i.push({id:`m2c_${e}_${n}`,source:e,target:n,style:{zIndex:9999}})}for(let a of Object.keys(t.data.data.current?.columns??{})){let l=`${t.id}_${a}`,u=s.current,c=u?.columns[l],d=u?.parent_map[l]??new Set;if(null!=c){for(let e of(r.push({id:l,position:{x:10,y:70+20*o},parentId:t.id,extent:"parent",draggable:!1,className:"no-track-pii-safe",data:{node:t.data,column:c.name,type:c.type,transformationType:c.transformation_type,changeStatus:c.change_status},style:{zIndex:9999},type:"lineageGraphColumnNode",targetPosition:n.Position.Left,sourcePosition:n.Position.Right}),d))i.push({id:`${e}_${l}`,source:e,target:l,style:{zIndex:9999}});o++,e.add(c.name)}}}a[t.id]=e;let l=60;o>0&&(l+=20+20*o),r.unshift({id:t.id,position:{x:0,y:0},width:300,height:l,className:"no-track-pii-safe",data:{...t.data},type:"lineageGraphNode",targetPosition:n.Position.Left,sourcePosition:n.Position.Right,style:{width:300,height:l}})}for(let t of Object.values(e.edges).sort(u))(!c||c.has(t.source)&&c.has(t.target))&&i.push({id:t.id,type:"lineageGraphEdge",source:t.source,target:t.target,data:{...t.data}});return d(r,i),[r,i,a]}e.s(["getNeighborSet",()=>r,"union",()=>i],81167);let d=(e,n,r="LR")=>{let i=new t.default.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:r,ranksep:50,nodesep:30}),e.forEach(e=>{if(!o(e))return;let t=300,n=60;e.style?.height&&e.style.width&&(t=parseInt(String(e.style.width),10),n=parseInt(String(e.style.height),10)),i.setNode(e.id,{width:t,height:n})}),n.forEach(e=>{i.setEdge(e.source,e.target)}),t.default.layout(i),e.forEach(e=>{if(!o(e))return;let t=e.style?.width??300,n=e.style?.height??60,r=i.node(e.id);return e.position={x:r.x-Number(t)/2,y:r.y-Number(n)/2},e})};e.s(["COLUMN_HEIGHT",0,20,"buildLineageGraph",()=>a,"isLineageGraphColumnNode",()=>s,"isLineageGraphNode",()=>o,"layout",0,d,"selectDownstream",()=>u,"selectUpstream",()=>l,"toReactFlow",()=>c],523043)},893970,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return a}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});function o(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,s(e));else t.set(n,s(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},492148,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=e.r(744066)._(e.r(893970)),s=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",a=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:n&&(u=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||s.test(r))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),a&&"#"!==a[0]&&(a="#"+a),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${u}${i}${c}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},341607,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(187725);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=o(e,r)),t&&(i.current=o(t,r))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},148982,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return o},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return _}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>a.test(e);function u(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&h(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}let g="undefined"!=typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function _(e){return JSON.stringify({message:e.message,stack:e.stack})}},560657,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return o}});let r=e.r(148982),i=e.r(949879);function o(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},256716,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},721739,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return v},useLinkStatus:function(){return b}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let o=e.r(744066),s=e.r(19483),a=o._(e.r(187725)),l=e.r(492148),u=e.r(994590),c=e.r(341607),d=e.r(148982),h=e.r(182090);e.r(585190);let f=e.r(388618),p=e.r(560657),g=e.r(984183);function m(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function v(t){var n;let r,i,o,[l,v]=(0,a.useOptimistic)(f.IDLE_LINK_STATUS),b=(0,a.useRef)(null),{href:x,as:w,children:_,prefetch:k=null,passHref:S,replace:C,shallow:O,scroll:E,onClick:M,onMouseEnter:A,onTouchStart:P,legacyBehavior:T=!1,onNavigate:R,ref:I,unstable_dynamicOnHover:D,...L}=t;r=_,T&&("string"==typeof r||"number"==typeof r)&&(r=(0,s.jsx)("a",{children:r}));let j=a.default.useContext(u.AppRouterContext),N=!1!==k,F=!1!==k?null===(n=k)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:B,as:z}=a.default.useMemo(()=>{let e=m(x);return{href:e,as:w?m(w):e}},[x,w]);if(T){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=a.default.Children.only(r)}let V=T?i&&"object"==typeof i&&i.ref:I,H=a.default.useCallback(e=>(null!==j&&(b.current=(0,f.mountLinkInstance)(e,B,j,F,N,v)),()=>{b.current&&((0,f.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,f.unmountPrefetchableInstance)(e)}),[N,B,j,F,v]),$={ref:(0,c.useMergedRef)(H,V),onClick(t){T||"function"!=typeof M||M(t),T&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!j||t.defaultPrevented||function(t,n,r,i,o,s,l){if("undefined"!=typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(n)){o&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(793848);a.default.startTransition(()=>{d(r||n,o?"replace":"push",s??!0,i.current)})}}(t,B,z,b,C,E,R)},onMouseEnter(e){T||"function"!=typeof A||A(e),T&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),j&&N&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){T||"function"!=typeof P||P(e),T&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),j&&N&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(z)?$.href=z:T&&!S&&("a"!==i.type||"href"in i.props)||($.href=(0,h.addBasePath)(z)),o=T?a.default.cloneElement(i,$):(0,s.jsx)("a",{...L,...$,children:r}),(0,s.jsx)(y.Provider,{value:l,children:o})}e.r(256716);let y=(0,a.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,a.useContext)(y);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},180806,e=>{"use strict";e.s(["RECCE_SUPPORT_CALENDAR_URL",0,"https://cal.com/team/recce/chat"])},23995,928296,e=>{"use strict";var t=e.i(19483),n=e.i(76130),r=e.i(11321),i=e.i(772510),o=e.i(845209),s=e.i(427938),a=e.i(721739),l=e.i(180806);function u(e,t="verbose"){let n,r={hours:Math.floor((n=Math.floor(e))/3600),minutes:Math.floor(n%3600/60),seconds:n%60};return"compact"===t?function({hours:e,minutes:t,seconds:n}){return e>0?`${e}:${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${t}:${n.toString().padStart(2,"0")}`}(r):function({hours:e,minutes:t,seconds:n}){let r=[];return e>0&&r.push(`${e} hour${1!==e?"s":""}`),t>0&&r.push(`${t} min${1!==t?"s":""}`),0===e&&(0===r.length||n>0)&&r.push(`${n} second${1!==n?"s":""}`),r.join(" ")}(r)}function c({connect:e,idleSeconds:a}){let l=null!=a&&a>0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.default,{children:"Server Disconnected"}),(0,t.jsx)(i.default,{children:l?(0,t.jsxs)(s.default,{children:["The server has been idle for ",u(a)," and was automatically stopped. Please restart the Recce server to continue."]}):(0,t.jsx)(s.default,{children:"The server connection has been lost. Please restart the Recce server and try again."})}),(0,t.jsx)(r.default,{children:(0,t.jsx)(n.default,{color:"iochmara",variant:"contained",onClick:()=>{e()},children:"Retry"})})]})}function d({shareUrl:e,mode:u}){let c={"read only":{title:"Share Instance Expired",body:"This Share Instance has expired. Please restart the share instance.",action:"Restart",link:e},"metadata only":{title:"Preview Instance Expired",body:"This Preview Instance has expired. To browse more, please book a meeting with us.",action:"Contact us",link:l.RECCE_SUPPORT_CALENDAR_URL}}[u];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.default,{children:c.title}),(0,t.jsx)(i.default,{children:(0,t.jsx)(s.default,{children:c.body})}),(0,t.jsx)(r.default,{children:"read only"===u?(0,t.jsx)(a.default,{href:c.link,passHref:!0,children:(0,t.jsx)(n.default,{color:"iochmara",variant:"contained",children:c.action})}):(0,t.jsx)(n.default,{color:"iochmara",variant:"contained",onClick:()=>window.open(c.link,"_blank"),children:c.action})})]})}e.s(["formatDuration",()=>u],928296),e.s(["RecceInstanceDisconnectedModalContent",()=>d,"ServerDisconnectedModalContent",()=>c],23995)},912007,473788,e=>{"use strict";var t=e.i(19483),n=e.i(187725),r=e.i(830520);let i={mode:null,disableSaveToFile:!1,disableExportStateFile:!1,disableImportStateFile:!1,disableUpdateChecklist:!1,disableDatabaseQuery:!1,disableViewActionDropdown:!1,disableNodeActionDropdown:!1,disableShare:!1},o=(0,n.createContext)({singleEnv:!1,authed:!1,lifetimeExpiredAt:void 0,featureToggles:i,shareUrl:void 0,sessionId:void 0});function s({children:e}){let{data:s,isLoading:a}=(0,r.useRecceInstanceInfo)(),[l,u]=(0,n.useState)(i),[c,d]=(0,n.useState)(!1),[h,f]=(0,n.useState)(!1),[p,g]=(0,n.useState)(),[m,v]=(0,n.useState)(),[y,b]=(0,n.useState)(),[x,w]=(0,n.useState)(s);if(!a&&s&&s!==x){w(s),d(s.single_env),f(s.authed),v(s.share_url),b(s.session_id),s.lifetime_expired_at&&(g(new Date(s.lifetime_expired_at)),console.log("lifetime expired at",s.lifetime_expired_at));let e={...i};"read-only"===s.server_mode?(e.mode="read only",e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!0,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!0,e.disableNodeActionDropdown=!0,e.disableShare=!0):"preview"===s.server_mode&&(e.mode="metadata only",e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!1,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!1,e.disableNodeActionDropdown=!1,e.disableShare=!0),s.single_env&&(e.disableUpdateChecklist=!0,e.disableShare=!0),s.cloud_instance&&(e.disableShare=!0),u(e)}return(0,t.jsx)(o.Provider,{value:{featureToggles:l,singleEnv:c,authed:h,lifetimeExpiredAt:p,shareUrl:m,sessionId:y},children:e})}e.s(["RecceInstanceInfoProvider",()=>s,"useRecceInstanceContext",0,()=>(0,n.useContext)(o)],912007);var a=e.i(705443);async function l(){return(await a.axiosClient.get("/api/flag")).data}async function u(){try{await a.axiosClient.post("/api/relaunch-hint/completed")}catch(e){}}e.s(["getServerFlag",()=>l,"markRelaunchHintCompleted",()=>u],473788)},838208,e=>{"use strict";let{Axios:t,AxiosError:n,CanceledError:r,isCancel:i,CancelToken:o,VERSION:s,all:a,Cancel:l,isAxiosError:u,spread:c,toFormData:d,AxiosHeaders:h,HttpStatusCode:f,formToJSON:p,getAdapter:g,mergeConfig:m}=e.i(31368).default;e.s(["AxiosError",()=>n,"isAxiosError",()=>u])},420856,e=>{"use strict";e.i(838208);var t=e.i(705443);async function n(){return(await t.axiosClient.get("/api/info")).data}async function r(e){return(await t.axiosClient.get(`/api/model/${e}`)).data}e.s(["getModelInfo",()=>r,"getServerInfo",()=>n])},484404,(e,t,n)=>{!function(r,i){"use strict";var o="function",s="undefined",a="object",l="string",u="model",c="name",d="type",h="vendor",f="version",p="architecture",g="console",m="mobile",v="tablet",y="smarttv",b="wearable",x="embedded",w="Amazon",_="Apple",k="ASUS",S="BlackBerry",C="Browser",O="Chrome",E="Firefox",M="Google",A="Huawei",P="Microsoft",T="Motorola",R="Opera",I="Samsung",D="Sharp",L="Sony",j="Xiaomi",N="Zebra",F="Facebook",B=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},z=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},V=function(e,t){return typeof e===l&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,350)},W=function(e,t){for(var n,r,i,s,l,u,c=0;c<t.length&&!l;){var d=t[c],h=t[c+1];for(n=r=0;n<d.length&&!l;)if(l=d[n++].exec(e))for(i=0;i<h.length;i++)u=l[++r],typeof(s=h[i])===a&&s.length>0?2===s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):void 0:this[s[0]]=u?s[1].call(this,u,s[2]):void 0:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||void 0;c+=2}},U=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(V(t[n][r],e))return"?"===n?void 0:n}else if(V(t[n],e))return"?"===n?void 0:n;return e},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+C],f],[/\bfocus\/([\w\.]+)/i],[f,[c,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[f,[c,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+C],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,F],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,O+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,O+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,U,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,H]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[h,I],[d,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,I],[d,m]],[/((ipod|iphone)\d+,\d+)/i],[u,[h,_],[d,m]],[/(ipad\d+,\d+)/i],[u,[h,_],[d,v]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[h,_],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,_],[d,v]],[/(macintosh);/i],[u,[h,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,A],[d,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[h,A],[d,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[h,j],[d,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,j],[d,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[d,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[h,T],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,T],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,"LG"],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,"LG"],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[u,[h,M],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,M],[d,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,L],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,L],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,w],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,w],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,S],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,k],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,k],[d,m]],[/(nexus 9)/i],[u,[h,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[d,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,D],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[d,m]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,u,[d,v]],[/(surface duo)/i],[u,[h,P],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[u,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[d,v]],[/\b(k88) b/i],[u,[h,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[d,v]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[d,m]],[/\b(ph-1) /i],[u,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[h,u,[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,P],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,N],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,N],[d,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[d,g]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[u,[h,L],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,P],[d,g]],[/smart-tv.+(samsung)/i],[h,[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,I],[d,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,"LG"],[d,y]],[/(apple) ?tv/i],[h,[u,_+" TV"],[d,y]],[/crkey/i],[[u,O+"cast"],[h,M],[d,y]],[/droid.+aft(\w)( bui|\))/i],[u,[h,w],[d,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[h,D],[d,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[h,L],[d,y]],[/(mitv-\w{5}) bui/i],[u,[h,j],[d,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,$],[u,$],[d,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,y]],[/((pebble))app/i],[h,u,[d,b]],[/droid.+; (glass) \d/i],[u,[h,M],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,N],[d,b]],[/(quest( 2)?)/i],[u,[h,F],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,U,q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,U,q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,O+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},K=function(e,t){if(typeof e===a&&(t=e,e=void 0),!(this instanceof K))return new K(e,t).getResult();var n=e||(typeof r!==s&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?B(Q,t):Q;return this.getBrowser=function(){var e,t={};return t[c]=void 0,t[f]=void 0,W.call(t,n,i.browser),t.major=typeof(e=t.version)===l?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,t},this.getCPU=function(){var e={};return e[p]=void 0,W.call(e,n,i.cpu),e},this.getDevice=function(){var e={};return e[h]=void 0,e[u]=void 0,e[d]=void 0,W.call(e,n,i.device),e},this.getEngine=function(){var e={};return e[c]=void 0,e[f]=void 0,W.call(e,n,i.engine),e},this.getOS=function(){var e={};return e[c]=void 0,e[f]=void 0,W.call(e,n,i.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===l&&e.length>350?$(e,350):e,this},this.setUA(n),this};if(K.VERSION="0.7.33",K.BROWSER=z([c,f,"major"]),K.CPU=z([p]),K.DEVICE=z([u,h,d,g,m,y,v,b,x]),K.ENGINE=K.OS=z([c,f]),typeof n!==s)t.exports&&(n=t.exports=K),n.UAParser=K;else if(typeof define===o&&define.amd)e.r,void 0!==K&&e.v(K);else typeof r!==s&&(r.UAParser=K);var G=typeof r!==s&&(r.jQuery||r.Zepto);if(G&&!G.ua){var X=new K;G.ua=X.getResult(),G.ua.get=function(){return X.getUA()},G.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)G.ua[n]=t[n]}}}("object"==typeof window?window:e.e)},203158,e=>{"use strict";let t,n,r,i,o;e.i(316575);var s,a,l,u,c,d,h,f,p,g,m,v,y,b,x,w,_,k,S,C,O,E,M,A,P,T,R,I,D,L,j,N,F,B,z,V,H,$,W,U,q,Q,K,G,X,Y,Z,J,ee,et,en,er,ei,eo,es,ea,el,eu,ec=e.i(824627);(s=$||($={})).SET="$set",s.SET_ONCE="$setOnce",s.ADD="$add",s.APPEND="$append",s.PREPEND="$prepend",s.REMOVE="$remove",s.PREINSERT="$preInsert",s.POSTINSERT="$postInsert",s.UNSET="$unset",s.CLEAR_ALL="$clearAll",(a=W||(W={})).IDENTIFY="$identify",a.GROUP_IDENTIFY="$groupidentify",a.REVENUE="revenue_amount";var ed="".concat("AMP","_unsent"),eh="$default_instance",ef="https://api2.amplitude.com/2/httpapi",ep="dclid",eg="fbclid",em="gbraid",ev="gclid",ey="ko_click_id",eb="li_fat_id",ex="msclkid",ew="rdt_cid",e_="ttclid",ek="twclid",eS="wbraid",eC={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eO=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],eE=["authorization","cookie","set-cookie"],eM=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!eA(t,n))return!1}return!0},eA=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,ec.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&eM(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return eM(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},eP=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,ec.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(U.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(U.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(U.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(U.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(U.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(U.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(U.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(U.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(U.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[U.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[U.CLEAR_ALL]||this._propertySet.has(t))&&(e===U.ADD?"number"==typeof n:e===U.UNSET||e===U.REMOVE||eA(t,n))},e}();(l=U||(U={})).SET="$set",l.SET_ONCE="$setOnce",l.ADD="$add",l.APPEND="$append",l.PREPEND="$prepend",l.REMOVE="$remove",l.PREINSERT="$preInsert",l.POSTINSERT="$postInsert",l.UNSET="$unset",l.CLEAR_ALL="$clearAll";var eT=[U.CLEAR_ALL,U.UNSET,U.SET,U.SET_ONCE,U.ADD,U.APPEND,U.PREPEND,U.PREINSERT,U.POSTINSERT,U.REMOVE];(u=q||(q={})).Unknown="unknown",u.Skipped="skipped",u.Success="success",u.RateLimit="rate_limit",u.PayloadTooLarge="payload_too_large",u.Invalid="invalid",u.Failed="failed",u.Timeout="Timeout",u.SystemError="SystemError";var eR=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=q.Unknown),{event:e,code:t,message:n}},eI=e.i(153029),eD=(0,ec.__spreadArray)([],(0,ec.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),eL=function(e){var t,n=(0,eI.getGlobalScope)();if(!(null==(t=null==n?void 0:n.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,eL);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,ec.__spreadArray)([],(0,ec.__read)(r.entries()),!1).map(function(e){var t=(0,ec.__read)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(eD[r]):eD[r]}).join("")},ej=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=eL(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!=(n=e.type)?n:"enrichment",[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null==(n=i.teardown)?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s,a,l,u,c,d,h,f,p,g;return(0,ec.__generator)(this,function(m){switch(m.label){case 0:if(!e)return[2];t=(0,ec.__read)(e,1)[0],n=(0,ec.__read)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),m.label=1;case 1:m.trys.push([1,6,7,8]),o=(i=(0,ec.__values)(r)).next(),m.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute((0,ec.__assign)({},t))];case 3:if(null===(a=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),m.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return h={error:m.sent()},[3,8];case 7:try{o&&!o.done&&(f=i.return)&&f.call(i)}finally{if(h)throw h.error}return[7];case 8:l=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),m.label=9;case 9:m.trys.push([9,14,15,16]),c=(u=(0,ec.__values)(l)).next(),m.label=10;case 10:if(c.done)return[3,13];if(!(s=c.value).execute)return[3,12];return[4,s.execute((0,ec.__assign)({},t))];case 11:if(null===(a=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),m.label=12;case 12:return c=u.next(),[3,10];case 13:return[3,16];case 14:return p={error:m.sent()},[3,16];case 15:try{c&&!c.done&&(g=u.return)&&g.call(u)}finally{if(p)throw p.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(d.map(function(e){var n=(0,ec.__assign)({},t);return e.execute(n).catch(function(e){return eR(n,0,String(e))})})).then(function(e){var r=(0,ec.__read)(e,1)[0]||eR(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onIdentityChanged)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),eN=function(e,t){return(0,ec.__assign)((0,ec.__assign)({},t),{event_type:W.IDENTIFY,user_properties:e.getUserProperties()})},eF=function(e,t,n,r){var i;return(0,ec.__assign)((0,ec.__assign)({},r),{event_type:W.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},eB=function(e,t,n){var r,i=new eP;return i.set(e,t),(0,ec.__assign)((0,ec.__assign)({},n),{event_type:W.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},ez=function(e){return{promise:e||Promise.resolve()}},eV=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ej(this),this.name=e}return e.prototype._init=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,8,9,10]),r=(n=(0,ec.__values)(t)).next(),a.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return a.sent(),[3,6];case 4:return[4,i];case 5:a.sent(),a.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:a.sent(),a.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,ec.__assign)((0,ec.__assign)((0,ec.__assign)({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return ez(this.dispatch(r))},e.prototype.identify=function(e,t){var n=eN(e,t);return ez(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=eF(e,t,n,r);return ez(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=eB(e,t,n);return ez(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,ec.__assign)((0,ec.__assign)({},t),{event_type:W.REVENUE,event_properties:e.getEventProperties()});return ez(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),ez())},e.prototype._addPlugin=function(e){return ez(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),ez())},e.prototype._removePlugin=function(e){return ez(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eR(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,ec.__generator)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var n={};return Object.keys(e).forEach(function(t){Object.values($).includes(t)||(n[t]=e[t])}),eT.forEach(function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case $.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;case $.UNSET:Object.keys(r).forEach(function(e){delete t[e]});break;case $.SET:Object.assign(t,r)}}}),Object.assign(t,n),t},e.prototype.process=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,eR(e,0,"Event skipped due to optOut config")];return e.event_type===W.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)];case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return r=String(i.sent()),this.config.loggerProvider.error(r),[2,n=eR(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=!!e)},e.prototype.flush=function(){return ez(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eH=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])};(c=Q||(Q={}))[c.None=0]="None",c[c.Error=1]="Error",c[c.Warn=2]="Warn",c[c.Verbose=3]="Verbose",c[c.Debug=4]="Debug";var e$="Amplitude Logger ",eW=function(){function e(){this.logLevel=Q.None}return e.prototype.disable=function(){this.logLevel=Q.None},e.prototype.enable=function(e){void 0===e&&(e=Q.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Q.Verbose||console.log("".concat(e$,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Q.Warn||console.warn("".concat(e$,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Q.Error||console.error("".concat(e$,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Q.Debug||console.log("".concat(e$,"[Debug]: ").concat(e.join(" ")))},e}(),eU=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:eh,logLevel:Q.Warn,loggerProvider:new eW,offline:!1,optOut:!1,serverUrl:ef,serverZone:"US",useBatch:!1}},eq=function(){function e(e){this._optOut=!1;var t,n,r,i,o=eU();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(r=e.optOut)?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=eQ(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),eQ=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=eU().serverZone),void 0===n&&(n=eU().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:eU().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":r?"https://api2.amplitude.com/batch":ef)}},eK=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eG(e){return e>=200&&e<300}var eX=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},eY=function(e){return function(){var t=(0,ec.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},eZ=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,ec.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},eJ=function(e,t){return function(){var n,r,i={};try{for(var o=(0,ec.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=eZ(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},e0=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<Q.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:eX(1),time:{start:new Date().toISOString()},states:{}};r&&c.states&&(c.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))}):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),d}};function e1(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var e2=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(ed,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=eL()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,eH(t,this.config.flushQueueSize).reduce(function(t,n){return(0,ec.__awaiter)(r,void 0,void 0,function(){return(0,ec.__generator)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,ec.__rest)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eK,a.label=1;case 1:return a.trys.push([1,3,,4]),i=eQ(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:if(null===(o=a.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(e1(o))):this.fulfillRequest(e,o.statusCode,o.status),[2];return this.handleResponse(o,e),[3,4];case 3:var l;return s=(l=a.sent())instanceof Error?l.message:String(l),this.config.loggerProvider.error(s),null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:s,stack_trace:eX()}),this.handleResponse({status:q.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){eG(e.statusCode)||null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:e1(e),stack_trace:eX()});var n,r=e.status;switch(r){case q.Success:this.handleSuccessResponse(e,t);break;case q.Invalid:this.handleInvalidResponse(e,t);break;case q.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case q.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var r=new Set((0,ec.__spreadArray)((0,ec.__spreadArray)((0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,ec.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,ec.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,ec.__read)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!r.has(i)||void n.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(e1(e));var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(e1(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),l=new Set(o),u=t.filter(function(t,r){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(l.has(r)&&(t.timeout=n.throttleTimeout),!0)});u.length>0&&this.config.loggerProvider.warn(e1(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;eG(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(r=this.diagnosticsClient)||r.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:eX()})),this.removeEvents(e),e.forEach(function(e){return e.callback(eR(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),e5=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return eM(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?(0,ec.__assign)({},this.properties):{};return e[K.REVENUE_PRODUCT_ID]=this.productId,e[K.REVENUE_QUANTITY]=this.quantity,e[K.REVENUE_PRICE]=this.price,e[K.REVENUE_TYPE]=this.revenueType,e[K.REVENUE_CURRENCY]=this.currency,e[K.REVENUE]=this.revenue,e[K.RECEIPT]=this.receipt,e[K.RECEIPT_SIG]=this.receiptSig,e},e}();(d=K||(K={})).REVENUE_PRODUCT_ID="$productId",d.REVENUE_QUANTITY="$quantity",d.REVENUE_PRICE="$price",d.REVENUE_TYPE="$revenueType",d.REVENUE_CURRENCY="$currency",d.REVENUE="$revenue",d.RECEIPT="$receipt",d.RECEIPT_SIG="$receiptSig";var e3=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:e4(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),e4=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e8=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),e6=function(){return(e6=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function e7(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function e9(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var te=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=e7(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(a&&l){for(var u=0;u<e.length;u++)if(!te(e[u],t[u]))return!1}else{if(!te(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){te(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var tt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=e6({},this.identity.userProperties),n=e6(e6({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,l=n.userProperties||{};try{for(var u=e7(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=e9(c.value,2),h=d[0],f=d[1];switch(h){case"$set":try{for(var p=(i=void 0,e7(Object.entries(f))),g=p.next();!g.done;g=p.next()){var m=e9(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,e7(Object.keys(f))),x=b.next();!x.done;x=b.next()){var v=x.value;delete l[v]}}catch(e){s={error:e}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return e6({},this.identity)},e.prototype.setIdentity=function(e){var t=e6({},this.identity);this.identity=e6({},e),te(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),tn="undefined"!=typeof globalThis?globalThis:e.g,tr=function(){function e(){this.identityStore=new tt,this.eventBridge=new e8,this.applicationContextProvider=new e3}return e.getInstance=function(t){return tn.analyticsConnectorInstances||(tn.analyticsConnectorInstances={}),tn.analyticsConnectorInstances[t]||(tn.analyticsConnectorInstances[t]=new e),tn.analyticsConnectorInstances[t]},e}(),ti=function(e){return void 0===e&&(e=eh),tr.getInstance(e)},to=function(e,t){ti(t).identityStore.editIdentity().setUserId(e).commit()},ts=function(e,t){ti(t).identityStore.editIdentity().setDeviceId(e).commit()},ta=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},tl=function(){function e(){this.name="identity",this.type="before",this.identityStore=ti().identityStore}return e.prototype.execute=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return e.instanceName&&(this.identityStore=ti(e.instanceName).identityStore),[2]})})},e}(),tu=function(){var e,t=(0,eI.getGlobalScope)();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=tc(n[0]),i=tc(n[1]);return i&&(e[r]=i),e},{}):{}},tc=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},td=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),th=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new td(e,t)}return e.prototype.subscribe=function(e,t,n){var r=eL(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r,i,o,s,a,l=this;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,u,c;return(0,ec.__generator)(this,function(d){switch(d.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:if((a=d.sent()).ok)return[3,4];return[4,a.text()];case 3:return u=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(u)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(c=d.sent())instanceof Error&&"AbortError"===c.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),c),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!(r<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(n))})];case 10:d.sent(),d.label=11;case 11:return[2]}})},o=this,s=0,u.label=1;case 1:if(!(s<e))return[3,4];return[5,i(s)];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];u.label=3;case 3:return s++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),tf="tags",tp="counters",tg="histograms",tm="events",tv="internal",ty="last_flush_timestamp",tb=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null==(e=(0,eI.getGlobalScope)())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(tf)||e.createObjectStore(tf,{keyPath:"key"}),e.objectStoreNames.contains(tp)||e.createObjectStore(tp,{keyPath:"key"}),e.objectStoreNames.contains(tg)||e.createObjectStore(tg,{keyPath:"key"}),e.objectStoreNames.contains(tm)||e.createObjectStore(tm,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(tv)||e.createObjectStore(tv,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tf],"readwrite")).objectStore(tf),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),r()},o.forEach(function(e){var t=(0,ec.__read)(e,2),r=t[0],o=t[1];n.put({key:r,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,o,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",r),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tp],"readwrite")).objectStore(tp),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),r()},o.forEach(function(e){var t=(0,ec.__read)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",r),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tg],"readwrite")).objectStore(tg),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),r()},o.forEach(function(e){var t=(0,ec.__read)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:r,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tm],"readwrite")).objectStore(tm),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var o=n.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",r),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r,i;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(n=o.sent().transaction([tv],"readwrite")).objectStore(tv),[2,new Promise(function(i,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var s=r.put({key:e,value:t});s.onsuccess=function(){return i()},s.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=i.sent().transaction([tv],"readonly")).objectStore(tv),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return r=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",r),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(ty)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(ty,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=a.sent().transaction([tf,tp,tg,tm],"readwrite"),[4,Promise.all([this.getAllFromStore(e,tf),this.getAllFromStore(e,tp),this.getAllFromStore(e,tg),this.getAllFromStore(e,tm)])];case 2:return n=(t=ec.__read.apply(void 0,[a.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,tp),this.clearTable(e,tg),this.clearTable(e,tm)])];case 3:return a.sent(),[2,{tags:n,counters:r,histogramStats:i,events:o}];case 4:return s=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",s),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(Error("Failed to get all from ".concat(t)))}})},e}(),tx=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t},tw=function(e,t){return 31*Math.abs(tx(e.toString()))%1e5/1e5<t},t_=function(){var e=(0,eI.getGlobalScope)();return null==e?void 0:e.__AMPLITUDE_SCRIPT_URL__},tk=function(e){var t=(0,eI.getGlobalScope)();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,ec.__assign)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=tS({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=tC(i),s=tS({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!=(t=null==r?void 0:r.message)?t:tO(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},tS=function(e){var t=t_();if(t){if(e.filename&&e.filename.includes(t))return"filename";if(e.stack&&e.stack.includes(t))return"stack"}},tC=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},tO=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},tE=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=(0,ec.__assign)({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=tw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,tb.isSupported()?this.storage=new tb(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),tk(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,ec.__assign)({},this.inMemoryTags),t=(0,ec.__assign)({},this.inMemoryCounters),n=(0,ec.__assign)({},this.inMemoryHistograms),r=(0,ec.__spreadArray)([],(0,ec.__read)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l,u;return(0,ec.__generator)(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={},n.forEach(function(e){s[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),l=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===l.length)return[2];return u={tags:o,histogram:a,counters:s,events:l},this.fetch(u),[2]}})})},e.prototype.fetch=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(0,eI.getGlobalScope)())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t,n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-n),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=tw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),tM=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},tA=function(e){return tM(e,"attribution")},tP=function(e){return tM(e,"pageViews")},tT=function(e){return tM(e,"sessions")},tR=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tI=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},tD=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tL=function(e){if(tI(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tj=function(e){if(tD(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tN=function(e){var t;if(tR(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),(0,ec.__assign)((0,ec.__assign)({},n),{captureRules:null==(t=null==n?void 0:n.captureRules)?void 0:t.map(function(t){var n,r,i;if((null==(n=t.urls)?void 0:n.length)&&(null==(r=t.hosts)?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,ec.__assign)((0,ec.__assign)({},t),{hosts:void 0})}return t})})}},tF=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return tP(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},tB=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},tz=function(e){return e&&void 0!==e._q},tV=function(){if("undefined"==typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!=(r=null!=(n=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?n:i)?r:""},tH="2.30.0",t$="amplitude-ts",tW=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(t$,"/").concat(tH),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,ec.__generator)(this,function(s){return r=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(n=e.event_id)?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,(0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tV()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:eL(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),tU=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tq=function(){function e(e){this.options=(0,ec.__assign)({},e)}return e.prototype.isEnabled=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(!(0,eI.getGlobalScope)())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=i.sent()))return[2,void 0];try{if(r=null!=(t=tQ(n))?t:tK(n),void 0===r)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0];return[2,JSON.parse(r)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}}})})},e.prototype.getRaw=function(e){var t,n;return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,ec.__generator)(this,function(o){return(i=(null!=(n=null==(t=null==(r=(0,eI.getGlobalScope)())?void 0:r.document)?void 0:t.cookie.split("; "))?n:[]).find(function(t){return 0===t.indexOf(e+"=")}))?[2,i.substring(e.length+1)]:[2,void 0]})})},e.prototype.set=function(e,t){var n;return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,l,u;return(0,ec.__generator)(this,function(c){try{r=null!=(n=this.options.expirationDays)?n:0,i=null!==t?r:-1,o=void 0,i&&((s=new Date).setTime(s.getTime()+24*i*36e5),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(l=(0,eI.getGlobalScope)())&&(l.document.cookie=a)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]})})},e.prototype.remove=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return[2]})})},e}(),tQ=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tK=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tG=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},tX=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,s,a,l,u,c,d,h,f,p,g,m,v,y,b,x,w,_,k=e.code||0,S=this.buildStatus(k);switch(S){case q.Success:return{status:S,statusCode:k,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case q.Invalid:return{status:S,statusCode:k,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(s=e.events_with_invalid_fields)?s:{},eventsWithMissingFields:null!=(a=e.events_with_missing_fields)?a:{},eventsWithInvalidIdLengths:null!=(l=e.events_with_invalid_id_lengths)?l:{},epsThreshold:null!=(u=e.eps_threshold)?u:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(h=e.silenced_events)?h:[],throttledDevices:null!=(f=e.throttled_devices)?f:{},throttledEvents:null!=(p=e.throttled_events)?p:[]}};case q.PayloadTooLarge:return{status:S,statusCode:k,body:{error:null!=(g=e.error)?g:""}};case q.RateLimit:return{status:S,statusCode:k,body:{error:null!=(m=e.error)?m:"",epsThreshold:null!=(v=e.eps_threshold)?v:0,throttledDevices:null!=(y=e.throttled_devices)?y:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(x=e.exceeded_daily_quota_devices)?x:{},exceededDailyQuotaUsers:null!=(w=e.exceeded_daily_quota_users)?w:{},throttledEvents:null!=(_=e.throttled_events)?_:[]}};case q.Timeout:default:return{status:S,statusCode:k}}},e.prototype.buildStatus=function(e){return eG(e)?q.Success:429===e?q.RateLimit:413===e?q.PayloadTooLarge:408===e?q.Timeout:e>=400&&e<500?q.Invalid:e>=500?q.Failed:q.Unknown},e}(),tY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,ec.__extends)(t,e),t.prototype.send=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}}})})},t}(tX),tZ=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),tJ=function(e){function t(t){var n,r,i,o=this;try{i=null==(n=(0,eI.getGlobalScope)())?void 0:n.localStorage}catch(e){null==(r=null==t?void 0:t.loggerProvider)||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,ec.__extends)(t,e),t.prototype.set=function(t,n){var r;return(0,ec.__awaiter)(this,void 0,void 0,function(){var i;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null==(r=this.loggerProvider)||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(tZ),t0=function(e){function t(){var t;return e.call(this,null==(t=(0,eI.getGlobalScope)())?void 0:t.sessionStorage)||this}return(0,ec.__extends)(t,e),t}(tZ),t1=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return(0,ec.__extends)(t,e),t.prototype.send=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,ec.__generator)(this,function(r){return[2,new Promise(function(r,i){"undefined"==typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))})]})})},t}(tX),t2=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,ec.__extends)(t,e),t.prototype.send=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,ec.__generator)(this,function(r){return[2,new Promise(function(r,i){var o=(0,eI.getGlobalScope)();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,JSON.stringify(t)))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tX),t5=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},t3=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},t4="[Amplitude]",t8="".concat(t4," Form Started"),t6="".concat(t4," Form Submitted"),t7="".concat(t4," File Downloaded"),t9="session_start",ne="session_end",nt="".concat(t4," File Extension"),nn="".concat(t4," File Name"),nr="".concat(t4," Link ID"),ni="".concat(t4," Link Text"),no="".concat(t4," Link URL"),ns="".concat(t4," Form ID"),na="".concat(t4," Form Name"),nl="".concat(t4," Form Destination"),nu="cookie",nc=function(e){function t(t,n,r,i,o,s,a,l,u,c,d,h,f,p,g,m,v,y,b,x,w,_,k,S,C,O,E,M,A,P,T,R,I,D,L,j,N,F,B,z){void 0===r&&(r=new tU),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===d&&(d=nu),void 0===m&&(m=new eW),void 0===v&&(v=Q.Warn),void 0===b&&(b=!1),void 0===x&&(x=!1),void 0===k&&(k=""),void 0===S&&(S="US"),void 0===O&&(O=18e5),void 0===E&&(E=new tJ({loggerProvider:m})),void 0===M&&(M={ipAddress:!0,language:!0,platform:!0}),void 0===A&&(A="fetch"),void 0===P&&(P=!1),void 0===T&&(T=!0),void 0===N&&(N=!0),void 0===F&&(F=0);var V=e.call(this,{apiKey:t,storageProvider:E,transportProvider:nh(A)})||this;return V.apiKey=t,V.appVersion=n,V.cookieOptions=i,V.defaultTracking=o,V.autocapture=s,V.flushIntervalMillis=l,V.flushMaxRetries=u,V.flushQueueSize=c,V.identityStorage=d,V.ingestionMetadata=h,V.instanceName=f,V.loggerProvider=m,V.logLevel=v,V.minIdLength=y,V.offline=b,V.partnerId=w,V.plan=_,V.serverUrl=k,V.serverZone=S,V.sessionTimeout=O,V.storageProvider=E,V.trackingOptions=M,V.transport=A,V.useBatch=P,V.fetchRemoteConfig=T,V.networkTrackingOptions=L,V.identify=j,V.enableDiagnostics=N,V.diagnosticsSampleRate=F,V.diagnosticsClient=B,V.remoteConfig=z,V.version=tH,V._optOut=!1,V._cookieStorage=r,V.deviceId=a,V.lastEventId=p,V.lastEventTime=g,V.optOut=x,V.sessionId=C,V.pageCounter=I,V.userId=R,V.debugLogsEnabled=D,V.loggerProvider.enable(D?Q.Debug:V.logLevel),V.networkTrackingOptions=L,V.identify=j,V.enableDiagnostics=N,V.diagnosticsSampleRate=F,V.diagnosticsClient=B,T&&(V.remoteConfig||(V.remoteConfig={fetchRemoteConfig:T}),V.remoteConfig.fetchRemoteConfig||(V.remoteConfig.fetchRemoteConfig=T)),V}return(0,ec.__extends)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(tG(this.apiKey),e)},t}(eq),nd=function(e,t){switch(void 0===e&&(e=nu),void 0===t&&(t={}),e){case"localStorage":return new tJ;case"sessionStorage":return new t0;case"none":return new tU;default:return new tq((0,ec.__assign)((0,ec.__assign)({},t),{expirationDays:t.expiration}))}},nh=function(e){return"xhr"===e?new t1:"beacon"===e?new t2:new tY},nf="data-amp-mask",np="*****",ng=/\b(?:\d[ -]*?){13,16}\b/,nm=/(\d{3}-?\d{2}-?\d{4})/g,nv=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,ny=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(ng,np)).replace(nm,np)).replace(nv,np);try{for(var o=(0,ec.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,np)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},nb=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(nf)?np:e?e(document.title):document.title},nx=function(){function e(){}return e.prototype.parse=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return[2,(0,ec.__assign)((0,ec.__assign)((0,ec.__assign)((0,ec.__assign)({},eC),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=tu();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=tu();return(e={})[ep]=t[ep],e[eg]=t[eg],e[em]=t[em],e[ev]=t[ev],e[ey]=t[ey],e[eb]=t[eb],e[ex]=t[ex],e[ew]=t[ew],e[e_]=t[e_],e[ek]=t[ek],e[eS]=t[eS],e},e}(),nw=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},n_=function(e){void 0===e&&(e={});var t,n,r=(0,eI.getGlobalScope)(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,l=e.eventType,u=void 0===l?"[Amplitude] Page Viewed":l,c=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:return e=c("undefined"!=typeof location&&location.href||""),n={event_type:u},t=[{}],[4,nk()];case 1:return[2,(n.event_properties=ec.__assign.apply(void 0,[ec.__assign.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&c(location.pathname)||"","[Amplitude] Page Title":nb(ny),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},h=function(){return void 0===s||"function"==typeof s&&s()},f="undefined"!=typeof location?location.href:null,p=function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,n,r,o;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:if(n=nC(a,e=location.href,f||"")&&h(),f=e,!n)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}})})},g=function(){p()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var a,l;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:if(t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",g),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,ec.__read)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&p()}})),!h())return[3,2];return i.log("Tracking page view event"),l=(a=t).track,[4,d()];case 1:l.apply(a,[u.sent()]),u.label=2;case 2:return[2]}})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(!("attribution"===s&&nS(e)))return[3,2];return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:e.event_type=(t=r.sent()).event_type,e.event_properties=(0,ec.__assign)((0,ec.__assign)({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===u&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,ec.__assign)((0,ec.__assign)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return r&&(r.removeEventListener("popstate",g),o=!1),[2]})})}}},nk=function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(t){switch(t.label){case 0:return e=nw,[4,new nx().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},nS=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[$.SET]||{},r=t[$.UNSET]||{},i=(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(Object.keys(n)),!1),(0,ec.__read)(Object.keys(r)),!1);return Object.keys(eC).every(function(e){return i.includes(e)})}return!1},nC=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},nO=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,ec.__generator)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("undefined"!=typeof document){var i=function(e){var t=!1;n(e,"change",function(){var n,i=nM(e);t||r.track(t8,((n={})[ns]=nE(e.id),n[na]=nE(e.name),n[nl]=i,n)),t=!0}),n(e,"submit",function(){var n,i,o=nM(e);t||r.track(t8,((n={})[ns]=nE(e.id),n[na]=nE(e.name),n[nl]=o,n)),r.track(t6,((i={})[ns]=nE(e.id),i[na]=nE(e.name),i[nl]=o,i)),t=!1})};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=(0,eI.getGlobalScope)())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nE=function(e){if("string"==typeof e)return e},nM=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},nA=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,ec.__generator)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("undefined"!=typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),s=null==i?void 0:i[1];s&&n(e,"click",function(){var n;s&&r.track(t7,((n={})[nt]=s,n[nn]=t.pathname,n[nr]=e.id,n[ni]=e.text,n[no]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=(0,eI.getGlobalScope)())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nP=!1,nT=function(e){nP||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),nP=!0)},nR=function(){var e=(0,eI.getGlobalScope)(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,n("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return r(),[2]})})}}};function nI(e,t,n){var r,i,o=[];try{for(var s=(0,ec.__values)(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}var nD=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],nL="data-amp-track-",nj=["div","span","h1","h2","h3","h4","h5","h6"],nN="[Amplitude] Element Clicked",nF="[Amplitude] Rage Click",nB="[Amplitude] Element Tag",nz="[Amplitude] Element Text",nV="[Amplitude] Page URL",nH="https://app.amplitude.com",n$={US:nH,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},nW="data-amp-mask-attributes",nU=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function nq(e){return"function"==typeof e}function nQ(e){return nq(null==e?void 0:e.then)}function nK(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var nG=nK(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function nX(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var nY=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,n,r,i,o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=(0,ec.__values)(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(nq(l))try{l()}catch(e){i=e instanceof nG?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var c=(0,ec.__values)(u),d=c.next();!d.done;d=c.next()){var h=d.value;try{n0(h)}catch(e){i=null!=i?i:[],e instanceof nG?i=(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(i)),(0,ec.__read)(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}if(i)throw new nG(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)n0(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(n=this._finalizers)?n:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&nX(t,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&nX(n,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),nZ=nY.EMPTY;function nJ(e){return e instanceof nY||e&&"closed"in e&&nq(e.remove)&&nq(e.add)&&nq(e.unsubscribe)}function n0(e){nq(e)?e():e.unsubscribe()}var n1=void 0,n2={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n2.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,(0,ec.__spreadArray)([e,t],(0,ec.__read)(n))):setTimeout.apply(void 0,(0,ec.__spreadArray)([e,t],(0,ec.__read)(n)))},clearTimeout:function(e){var t=n2.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function n5(e){n2.setTimeout(function(){!1;throw e})}function n3(){}var n4=n8("C",void 0,void 0);function n8(e,t,n){return{kind:e,value:t,error:n}}var n6=null;function n7(e){var t,n,r,i;1;e()}var n9=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,nJ(t)&&t.add(n)):n.destination=rs,n}return(0,ec.__extends)(t,e),t.create=function(e,t,n){return new rr(e,t,n)},t.prototype.next=function(e){this.isStopped?ro(n8("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ro(n8("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ro(n4,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(nY),re=Function.prototype.bind;function rt(e,t){return re.call(e,t)}var rn=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){ri(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ri(e)}else ri(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ri(e)}},e}(),rr=function(e){function t(t,n,r){var i,o,s=e.call(this)||this;return nq(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:i=t,s.destination=new rn(i),s}return(0,ec.__extends)(t,e),t}(n9);function ri(e){1;n5(e)}function ro(e,t){}var rs={closed:!0,next:n3,error:function(e){throw e},complete:n3},ra="function"==typeof Symbol&&Symbol.observable||"@@observable";function rl(e){return e}var ru=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=!function(e){return e&&e instanceof n9||e&&nq(e.next)&&nq(e.error)&&nq(e.complete)&&nJ(e)}(e)?new rr(e,t,n):e;return n7(function(){var e=r.operator,t=r.source;i.add(e?e.call(i,t):t?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=rc(t))(function(t,r){var i=new rr({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[ra]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===e.length?rl:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=rc(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function rc(e){var t;return null!=(t=null!=e?e:n1)?t:Promise}function rd(e){return Symbol.asyncIterator&&nq(null==e?void 0:e[Symbol.asyncIterator])}function rh(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var rf="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function rp(e){return nq(null==e?void 0:e[rf])}function rg(e){return(0,ec.__asyncGenerator)(this,arguments,function(){var t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,ec.__await)(t.read())];case 3:if(r=(n=i.sent()).value,!n.done)return[3,5];return[4,(0,ec.__await)(void 0)];case 4:return[2,i.sent()];case 5:return[4,(0,ec.__await)(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function rm(e){return nq(null==e?void 0:e.getReader)}function rv(e){if(e instanceof ru)return e;if(null!=e){var t,n,r,i;if(nq(e[ra])){return t=e,new ru(function(e){var n=t[ra]();if(nq(n.subscribe))return n.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if(nU(e)){return n=e,new ru(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}if(nQ(e)){return r=e,new ru(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,n5)})}if(rd(e))return ry(e);if(rp(e)){return i=e,new ru(function(e){var t,n;try{for(var r=(0,ec.__values)(i),o=r.next();!o.done;o=r.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e.complete()})}if(rm(e))return ry(rg(e))}throw rh(e)}function ry(e){return new ru(function(t){(function(e,t){var n,r,i,o;return(0,ec.__awaiter)(this,void 0,void 0,function(){var s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=(0,ec.__asyncValues)(e),a.label=1;case 1:return[4,n.next()];case 2:if((r=a.sent()).done)return[3,4];if(s=r.value,t.next(s),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:a.sent()},[3,11];case 6:if(a.trys.push([6,,9,10]),!(r&&!r.done&&(o=n.return)))return[3,8];return[4,o.call(n)];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function rb(e){return function(t){if(nq(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function rx(e,t,n,r,i){return new rw(e,t,n,r,i)}var rw=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return(0,ec.__extends)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),n||null==(t=this.onFinalize)||t.call(this)}},t}(n9);function r_(e,t){return rb(function(n,r){var i=0;n.subscribe(rx(r,function(n){r.next(e.call(t,n,i++))}))})}function rk(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function rS(e,t,n){return(void 0===n&&(n=1/0),nq(t))?rS(function(n,r){return r_(function(e,i){return t(n,e,r,i)})(rv(e(n,r)))},n):("number"==typeof t&&(n=t),rb(function(t,r){var i,o,s,a,l,u,c,d;return i=n,o=[],s=0,a=0,l=!1,u=function(){!l||o.length||s||r.complete()},c=function(e){return s<i?d(e):o.push(e)},d=function(t){s++;var n=!1;rv(e(t,a++)).subscribe(rx(r,function(e){r.next(e)},function(){n=!0},void 0,function(){if(n)try{for(s--;o.length&&s<i;)!function(){var e=o.shift();d(e)}();u()}catch(e){r.error(e)}}))},t.subscribe(rx(r,c,function(){l=!0,u()})),function(){}}))}var rC=Array.isArray,rO=["addListener","removeListener"],rE=["addEventListener","removeEventListener"],rM=["on","off"];function rA(e,t,n,r){if(nq(n)&&(r=n,n=void 0),r){return rA(e,t,n).pipe((i=r,r_(function(e){return rC(e)?i.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(e))):i(e)})))}var i,o,s,a,l=(0,ec.__read)(nq((o=e).addEventListener)&&nq(o.removeEventListener)?rE.map(function(r){return function(i){return e[r](t,i,n)}}):nq((s=e).addListener)&&nq(s.removeListener)?rO.map(rP(e,t)):nq((a=e).on)&&nq(a.off)?rM.map(rP(e,t)):[],2),u=l[0],c=l[1];if(!u&&nU(e))return rS(function(e){return rA(e,t,n)})(rv(e));if(!u)throw TypeError("Invalid event target");return new ru(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return u(t),function(){return c(t)}})}function rP(e,t){return function(n){return function(r){return e[n](t,r)}}}var rT=nK(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),rR=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,ec.__extends)(t,e),t.prototype.lift=function(e){var t=new rI(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rT},t.prototype.next=function(e){var t=this;n7(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=(0,ec.__values)(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;n7(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;n7(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this.hasError,r=this.isStopped,i=this.observers;return n||r?nZ:(this.currentObservers=null,i.push(e),new nY(function(){t.currentObservers=null,nX(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,n=this.thrownError,r=this.isStopped;t?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new ru;return e.source=this,e},t.create=function(e,t){return new rI(e,t)},t}(ru),rI=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,ec.__extends)(t,e),t.prototype.next=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.next)||n.call(t,e)},t.prototype.error=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.error)||n.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!=(n=null==(t=this.source)?void 0:t.subscribe(e))?n:nZ},t}(rR);function rD(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new rR}:t,r=e.resetOnError,i=void 0===r||r,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,l=void 0===a||a;return function(e){var t,r,o,a=0,u=!1,c=!1,d=function(){null==r||r.unsubscribe(),r=void 0},h=function(){d(),t=o=void 0,u=c=!1},f=function(){var e=t;h(),null==e||e.unsubscribe()};return rb(function(e,p){a++,c||u||d();var g=o=null!=o?o:n();p.add(function(){0!=--a||c||u||(r=rL(f,l))}),g.subscribe(p),!t&&a>0&&(t=new rr({next:function(e){return g.next(e)},error:function(e){c=!0,d(),r=rL(h,i,e),g.error(e)},complete:function(){u=!0,d(),r=rL(h,s),g.complete()}}),rv(e).subscribe(t))})(e)}}function rL(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0===t)return void e();if(!1!==t){var i=new rr({next:function(){i.unsubscribe(),e()}});return rv(t.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(n)))).subscribe(i)}}var rj=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},rN=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},rF=["input","select","textarea"],rB=function(e,t){var n,r=null==(n=null==window?void 0:window.getComputedStyle)?void 0:n.call(window,e);return(null==r?void 0:r.getPropertyValue("cursor"))==="pointer"&&"click"===t},rz=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null==(s=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:s.call(o);if(!c)return!1;if(u)return u(r,i);if(!rj(window.location.href,a)||l&&l.length>0&&rj(window.location.href,l))return!1;var d=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof d)switch(d.toLowerCase()){case"hidden":case"password":return!1}var h=rB(i,r);if(n&&h)return!0;if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:if(h)return!0;return"click"===r}}},rV=function(e){var t,n,r,i=null==(n=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:n.call(t),o=e instanceof HTMLElement&&(null==(r=e.getAttribute("contenteditable"))?void 0:r.toLowerCase())==="true";return!rF.includes(i)&&!o},rH=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null!=r&&("object"!=typeof r||0!==Object.keys(r).length)&&("string"!=typeof r||0!==r.trim().length)&&(t[n]=r),t},{})},r$=function(e,t){return e?t.some(function(t){var n;return null==(n=null==e?void 0:e.matches)?void 0:n.call(e,t)})?e:r$(null==e?void 0:e.parentElement,t):null},rW=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor},rU="1.17.0",rq=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",nW,nf]),rQ=["type"],rK=["svg","path","g"],rG=["password","hidden"],rX=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;if(e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector)return n.querySelector(e.selector);return n}}catch(e){}},rY=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},rZ=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return ny(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s=performance.now(),a=[];if(!e)return[];for(var l=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),u=new Map,c=l.length-1;c>=0;c--){var d=l[c];if(d){var h,f=(h=d.getAttribute(nW))?h.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],p=c===l.length-1?[]:null!=(r=u.get(l[c+1]))?r:new Set,g=new Set((0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(p),!1),(0,ec.__read)(f),!1));u.set(d,g)}}a=l.map(function(e){var t;return function(e,t){if(null===e)return null;var n,r,i,o,s,a,l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null==(a=null==(s=e.previousElementSibling)?void 0:s.tagName)?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var h=e.getAttribute("id");h&&(u.id=String(h));var f=Array.from(e.classList);f.length&&(u.classes=f);var p={},g=Array.from(e.attributes).filter(function(e){return!rq.has(e.name)}),m=!rV(e);if(!rG.includes(String(e.getAttribute("type")))&&!rK.includes(l))try{for(var v=(0,ec.__values)(g),y=v.next();!y.done;y=v.next()){var b=y.value;if(!m||rQ.includes(b.name)){if(t.has(b.name)){p[b.name]=np;continue}p[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}return Object.keys(p).length&&(u.attrs=p),u}(e,null!=(t=u.get(e))?t:new Set)});var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=(0,ec.__read)(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))})};try{for(var v=(0,ec.__values)(a),y=v.next();!y.done;y=v.next()){var b=y.value;m(b)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}var x=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",x-s),a},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,l=null==(s=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:s.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),d=null==(a=c[0])?void 0:a.attrs,h=o.getNearestLabel(t),f=Object.entries(null!=d?d:{}).reduce(function(e,t){var r=(0,ec.__read)(t,2),i=r[0],o=r[1];if(i.startsWith(n)){var s=i.replace(n,"");s&&(e[s]=o||"")}return e},{}),p=((r={})["[Amplitude] Element Hierarchy"]=c,r[nB]=l,r[nz]=o.getText(t),r["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),r["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),r["[Amplitude] Element Attributes"]=f,r["[Amplitude] Element Parent Label"]=h,r[nV]=rN(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=nb(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return p["[Amplitude] Element ID"]=t.getAttribute("id")||"",p["[Amplitude] Element Class"]=t.getAttribute("class"),p["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement&&(p["[Amplitude] Element Href"]=o.replaceSensitiveString(t.href)),rH(p)},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s={event:e,timestamp:Date.now(),type:t};if(("click"===s.type||"change"===s.type)&&null!==s.event.target){if(i&&rB(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=r$(s.event.target,n);a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r))}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=rX(e,t);if(n){if("TEXT"===e.elementExtractType)return o.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.getText=function(e){if(null!==e.closest("[".concat(nf,"]")))return np;var t="";if(e.querySelector("[".concat(nf,"], [contenteditable]"))){var n=e.cloneNode(!0);n.querySelectorAll("[".concat(nf,"], [contenteditable]")).forEach(function(e){e.innerText=np}),t=n.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,n,r,i=null==(r=null==(n=null==e?void 0:e.tagName)?void 0:n.toLowerCase)?void 0:r.call(n);return rH(((t={})[nB]=i,t[nz]=o.getText(e),t[nV]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!=(i=e.maskTextRegex)?i:[],a=[];try{for(var l=(0,ec.__values)(s),u=l.next();!u.done;u=l.next()){var c=u.value;if(a.length>=25)break;if(c instanceof RegExp)a.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{a.push(RegExp(c.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a},rJ=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=nH,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?nH:t}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout(function(){s(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.setup=function(e){var t=this,n=void 0===e?{dataExtractor:new rZ({})}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,s=n.cssSelectorAllowlist,a=n.actionClickAllowlist,l=n.dataExtractor;this.logger=r,i&&this.endpoint===nH&&(this.endpoint=i);var u=null;window.addEventListener("message",function(e){if(null==(r=null==(n=t.logger)?void 0:n.debug)||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,c,d,h=null==e?void 0:e.data,f=null==h?void 0:h.action;if(f)if("id"in h)null==(c=null==(i=t.logger)?void 0:i.debug)||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(h);else if("ping"===f)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===f){var p,g=null==h?void 0:h.data;(p="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=p,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(p)})}),null==(n=document.head)||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;u=null==(e=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:e.call(window,{getEventTagProps:l.getEventTagProps,isElementSelectable:function(e){return!o||o((null==g?void 0:g.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:l.extractDataFromDataSource,dataExtractor:l,diagnostics:{autocapture:{version:rU}}}),t.notify({action:"selector-loaded"})}).catch(function(){var e;null==(e=t.logger)||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===f&&(null==(d=null==u?void 0:u.close)||d.call(u))}}),this.notify({action:"page-loaded"})},e}();function r0(e,t){return rb(function(n,r){var i=0;n.subscribe(rx(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}var r1=function(e){function t(t,n){return e.call(this)||this}return(0,ec.__extends)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(nY),r2={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=r2.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,(0,ec.__spreadArray)([e,t],(0,ec.__read)(n))):setInterval.apply(void 0,(0,ec.__spreadArray)([e,t],(0,ec.__read)(n)))},clearInterval:function(e){var t=r2.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r5=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,ec.__extends)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n,r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!=(n=this.id)?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),r2.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&r2.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nX(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(r1),r3={now:function(){return(r3.delegate||Date).now()},delegate:void 0},r4=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=r3.now,e}(),r8=new(function(e){function t(t,n){void 0===n&&(n=r4.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,ec.__extends)(t,e),t.prototype.flush=function(e){var t,n=this.actions;if(this._active)return void n.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift())if(this._active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(r4))(r5);function r6(e){return void 0===e&&(e=1/0),rS(rl,e)}var r7=new ru(function(e){return e.complete()});function r9(e){return e&&nq(e.schedule)}function ie(e){return e[e.length-1]}function it(e){return r9(ie(e))?e.pop():void 0}function ir(e,t){return void 0===t&&(t=0),rb(function(n,r){n.subscribe(rx(r,function(n){return rk(r,e,function(){return r.next(n)},t)},function(){return rk(r,e,function(){return r.complete()},t)},function(n){return rk(r,e,function(){return r.error(n)},t)}))})}function ii(e,t){return void 0===t&&(t=0),rb(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function io(e,t){if(!e)throw Error("Iterable cannot be null");return new ru(function(n){rk(n,t,function(){var r=e[Symbol.asyncIterator]();rk(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function is(e,t){return t?function(e,t){if(null!=e){if(nq(e[ra]))return rv(e).pipe(ii(t),ir(t));if(nU(e))return new ru(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})});if(nQ(e))return rv(e).pipe(ii(t),ir(t));if(rd(e))return io(e,t);if(rp(e))return new ru(function(n){var r;return rk(n,t,function(){r=e[rf](),rk(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return nq(null==r?void 0:r.return)&&r.return()}});if(rm(e))return io(rg(e),t)}throw rh(e)}(e,t):rv(e)}function ia(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=it(t),i=(e=1/0,"number"==typeof ie(t)?t.pop():e);return t.length?1===t.length?rv(t[0]):r6(i)(is(t,r)):r7}function il(e){return e<=0?function(){return r7}:rb(function(t,n){var r=0;t.subscribe(rx(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function iu(e){return e instanceof Date&&!isNaN(e)}function ic(e,t,n){void 0===e&&(e=0),void 0===n&&(n=r8);var r=-1;return null!=t&&(r9(t)?n=t:r=t),new ru(function(t){var i=iu(e)?e-n.now():e;i<0&&(i=0);var o=0;return n.schedule(function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())},i)})}var id=nK(function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function ih(e){throw new id(e)}var ip=function(){return new ru(function(e){var t=new MutationObserver(function(t){e.next(t)});return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},ig=function(e){return void 0===e&&(e="click"),rA(document,e,{capture:!0})},im=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},iv={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},iy=function(e){var t,n,r,i,o=Object.values(iv).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=(0,ec.__values)(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var u=(r=void 0,(0,ec.__values)(l.definition)),c=u.next();!c.done;c=u.next()){var d=iv[c.value.event_type];d&&o[d].add(l.id)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},ib=function(e){var t,n,r,i,o=new Map;try{for(var s=(0,ec.__values)(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var u=(r=void 0,(0,ec.__values)(l.conditions)),c=u.next();!c.done;c=u.next()){var d=c.value;if("LABELED_EVENT"===d.type){var h=d.match.eventId,f=o.get(h);f||(f=[],o.set(h,f)),f.push(l)}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},ix=function(e,t){var n,r,i,o,s=new Set;try{for(var a=(0,ec.__values)(e),l=a.next();!l.done;l=a.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var d=(i=void 0,(0,ec.__values)(c)),h=d.next();!h.done;h=d.next()){var f=h.value;s.add(f)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)},iw=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=ix(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return iv[t.event_type]===e.type&&t.filters.every(function(t){return im(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,ec.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value;rY(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}();(h=G||(G={})).ClickObservable="clickObservable",h.ChangeObservable="changeObservable",h.NavigateObservable="navigateObservable",h.MutationObservable="mutationObservable";var i_=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",rU);var n,r,i,o,s,a,l,u,c=e.dataAttributePrefix,d=void 0===c?nL:c,h=e.visualTaggingOptions,f=void 0===h?{enabled:!0,messenger:new rJ}:h;e.cssSelectorAllowlist=null!=(n=e.cssSelectorAllowlist)?n:nD,e.actionClickAllowlist=null!=(r=e.actionClickAllowlist)?r:nj,e.debounceTime=null!=(i=e.debounceTime)?i:0,e.pageUrlExcludelist=null==(o=e.pageUrlExcludelist)?void 0:o.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var p="@amplitude/plugin-autocapture-browser",g=[],m=new rZ(e,t),v=function(){var t,n,r=ig().pipe(r_(function(t){return m.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}),rD()),i=rA(document,"change",{capture:!0}).pipe(r_(function(t){return m.addAdditionalEventProperties(t,"change",e.cssSelectorAllowlist,d)}),rD());window.navigation&&(n=rA(window.navigation,"navigate").pipe(r_(function(t){return m.addAdditionalEventProperties(t,"navigate",e.cssSelectorAllowlist,d)}),rD()));var o=ip().pipe(r_(function(t){return m.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)}),rD());return(t={})[G.ClickObservable]=r,t[G.ChangeObservable]=i,t[G.NavigateObservable]=n,t[G.MutationObservable]=o,t},y=iy(Object.values(null!=(a=null==(s=e.pageActions)?void 0:s.labeledEvents)?a:{})),b=ib(null!=(u=null==(l=e.pageActions)?void 0:l.triggers)?u:[]),x=new iw(y,b,m,e),w=function(t){var n,r;t&&(e.pageActions=(0,ec.__assign)((0,ec.__assign)({},e.pageActions),t),y=iy(Object.values(null!=(n=e.pageActions.labeledEvents)?n:{})),b=ib(null!=(r=e.pageActions.triggers)?r:[]),x.update(y,b,e))};return{name:p,type:"enrichment",setup:function(t,n){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var r,i,o,s,a,l,u,c,h,y;return(0,ec.__generator)(this,function(b){var _,k,S,C,O,E,M,A,P,T,R,I,D,L,j,N,F,B,z,V,H,$,W,U,q,Q,K,G,X,Y,Z,J;return"undefined"==typeof document?[2]:(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(e){w(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=rz(e,e.cssSelectorAllowlist),i=rz(e,e.actionClickAllowlist),k=(_={allObservables:o=v(),options:e,amplitude:n,shouldTrackEvent:r,evaluateTriggers:x.evaluate.bind(x)}).amplitude,S=_.allObservables,C=_.options,O=_.shouldTrackEvent,E=_.evaluateTriggers,T=ia((M=S.clickObservable).pipe(rb(function(e,t){var n,r=!1;e.subscribe(rx(t,function(e){var i=n;n=e,r&&t.next([i,e]),r=!0}))}),r0(function(e){var t=(0,ec.__read)(e,2),n=t[0],r=t[1],i=n.event.target!==r.event.target,o=20>=Math.abs(r.event.screenX-n.event.screenX)&&20>=Math.abs(r.event.screenY-n.event.screenY);return i&&!o})),M.pipe((A=C.debounceTime,void 0===P&&(P=r8),rb(function(e,t){var n=null,r=null,i=null,o=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function s(){var e=i+A,r=P.now();if(r<e){n=this.schedule(void 0,e-r),t.add(n);return}o()}e.subscribe(rx(t,function(e){r=e,i=P.now(),n||(n=P.schedule(s,A),t.add(n))},function(){o(),t.complete()},void 0,function(){r=n=null}))})),r_(function(){return"timeout"}))),s=M.pipe((void 0===R&&(R=r8),I=ic(0,R),function e(t,n){return n?function(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r6(1)(is(e,it(e)))}(n.pipe(il(1),rb(function(e,t){e.subscribe(rx(t,n3))})),r.pipe(e(t)))}:rS(function(e,n){return rv(t(e,n)).pipe(il(1),r_(function(){return e}))})}(function(){return I})),r0(rW),r0(function(e){return O("click",e.closestTrackedAncestor)}),r_(function(e){return E(e)}),rb(function(e,t){var n=[];return e.subscribe(rx(t,function(e){return n.push(e)},function(){t.next(n),t.complete()})),rv(T).subscribe(rx(t,function(){var e=n;n=[],t.next(e)},n3)),function(){n=null}})).subscribe(function(e){var t,n,r=(e.length,nN);try{for(var i=(0,ec.__values)(e),o=i.next();!o.done;o=i.next()){var s=o.value;null==k||k.track(r,s.targetElementProperties)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),g.push(s),L=(D={allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:x.evaluate.bind(x)}).amplitude,j=D.allObservables,N=D.getEventProperties,F=D.shouldTrackEvent,B=D.evaluateTriggers,a=j.changeObservable.pipe(r0(rW),r0(function(e){return F("change",e.closestTrackedAncestor)}),r_(function(e){return B(e)})).subscribe(function(e){null==L||L.track("[Amplitude] Element Changed",N("change",e.closestTrackedAncestor))}),g.push(a),V=(z={allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}).amplitude,H=z.allObservables,$=z.options,W=z.getEventProperties,U=z.shouldTrackEvent,q=z.shouldTrackActionClick,Q=H.clickObservable,K=H.mutationObservable,G=H.navigateObservable,X=Q.pipe(r0(function(e){return!U("click",e.closestTrackedAncestor)}),r_(function(e){var t=r$(e.event.target,$.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=W(e.type,e.closestTrackedAncestor)),e}),r0(rW),r0(function(e){return q("click",e.closestTrackedAncestor)})),Y=[K],G&&Y.push(G),Z=ia.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(Y),!1)),l=X.pipe((J=function(e){return Z.pipe(il(1),function(e,t){var n=iu(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,o=n.with,s=void 0===o?ih:o,a=n.scheduler,l=void 0===a?r8:a,u=n.meta,c=void 0===u?null:u;if(null==r&&null==i)throw TypeError("No timeout provided.");return rb(function(e,t){var n,o,a=null,u=0,d=function(e){o=rk(t,l,function(){try{n.unsubscribe(),rv(s({meta:c,lastValue:a,seen:u})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(rx(t,function(e){null==o||o.unsubscribe(),u++,t.next(a=e),i>0&&d(i)},void 0,void 0,function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),a=null})),u||d(null!=r?"number"==typeof r?r:r-l.now():i)})}({first:500,with:function(){return r7}}),r_(function(){return e}))},rb(function(e,t){var n=null,r=0,i=!1,o=function(){return i&&!n&&t.complete()};e.subscribe(rx(t,function(e){null==n||n.unsubscribe(),rv(J(e,r++)).subscribe(n=rx(t,function(e){return t.next(e)},function(){n=null,o()}))},function(){i=!0,o()}))}))).subscribe(function(e){null==V||V.track(nN,W("click",e.closestTrackedAncestor))}),g.push(l),null==(h=null==t?void 0:t.loggerProvider)||h.log("".concat(p," has been successfully added.")),window.opener&&f.enabled&&(u=e.cssSelectorAllowlist,c=e.actionClickAllowlist,null==(y=f.messenger)||y.setup((0,ec.__assign)((0,ec.__assign)({dataExtractor:m,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:n$[t.serverZone]}),{isElementSelectable:rz(e,(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(u),!1),(0,ec.__read)(c),!1)),cssSelectorAllowlist:u,actionClickAllowlist:c}))),[2])})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,ec.__generator)(this,function(i){try{for(t=(e=(0,ec.__values)(g)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},ik=(0,ec.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,ec.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),iS=["*"],iC=Array.isArray;function iO(e,t){var n,r,i,o,s=t.event,a=s.clientX,l=s.clientY;e.yMin=Math.min(null!=(n=e.yMin)?n:l,l),e.yMax=Math.max(null!=(r=e.yMax)?r:l,l),e.xMin=Math.min(null!=(i=e.xMin)?i:a,a),e.xMax=Math.max(null!=(o=e.xMax)?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function iE(e){var t=e[0],n=e[e.length-1];return{rageClickEvent:(0,ec.__assign)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}var iM=function(e){void 0===e&&(e={});var t,n,r,i,o,s="@amplitude/plugin-frustration-browser",a=[],l=null!=(n=null==(t=e.rageClicks)?void 0:t.cssSelectorAllowlist)?n:iS,u=null!=(i=null==(r=e.deadClicks)?void 0:r.cssSelectorAllowlist)?i:ik,c=null!=(o=e.dataAttributePrefix)?o:nL,d=new rZ(e),h=(0,ec.__spreadArray)([],(0,ec.__read)(new Set((0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(l),!1),(0,ec.__read)(u),!1))),!1),f=function(){var e,t,n=ig("pointerdown").pipe(r_(function(e){return d.addAdditionalEventProperties(e,"click",h,c,!0)}),rD());window.navigation&&(t=rA(window.navigation,"navigate").pipe(r_(function(e){return d.addAdditionalEventProperties(e,"navigate",h,c)}),rD()));var r=ip().pipe(r_(function(e){return d.addAdditionalEventProperties(e,"mutation",h,c)}),rD());return(e={})[G.ClickObservable]=n,e[G.ChangeObservable]=new ru,e[G.NavigateObservable]=t,e[G.MutationObservable]=r,e};return{name:s,type:"enrichment",setup:function(t,n){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var r,i,o,h,p,g;return(0,ec.__generator)(this,function(m){var v,y,b,x,w,_,k,S,C,O,E,M,A,P,T;return"undefined"==typeof document?[2]:(r=rz(e,l),i=rz(e,u),h=function(e){var t,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=[],a={};function l(e){s=[],a={},e&&(iO(a,e),s.push(e))}return o.pipe(r0(rW),r0(function(e){return i("click",e.closestTrackedAncestor)}),r_(function(e){if(t&&clearTimeout(t),iO(a,e),0===s.length)return s.push(e),null;if((r=s).length>0&&r[r.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=s).length-4+1),u=i[o],e.timestamp-u.timestamp>=1e3)||a.isOutOfBounds){var r,i,o,u,c=s.length>=4?iE(s):null;return l(e),c}return s.push(e),s.length>=4&&(t=setTimeout(function(){var e=iE(s),t=e.rageClickEvent,r=e.time;n.track(nF,t,{time:r}),l()},1e3)),null}),r0(function(e){return null!==e})).subscribe(function(e){null!==e&&n.track(nF,e.rageClickEvent,{time:e.time})})}({allObservables:o=f(),amplitude:n,shouldTrackRageClick:r}),a.push(h),y=(v={amplitude:n,allObservables:o,getEventProperties:function(e,t){return d.getEventProperties(e,t,c)},shouldTrackDeadClick:i}).amplitude,b=v.allObservables,x=v.getEventProperties,w=v.shouldTrackDeadClick,_=b.clickObservable,k=b.mutationObservable,S=b.navigateObservable,C=_.pipe(r0(rW),r0(function(e){return w("click",e.closestTrackedAncestor)}),r0(function(e){return null===e.event.target.closest('a[target="_blank"]')})),O=[k],S&&O.push(S),E=ia.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(O),!1)),p=C.pipe(rS(function(e){var t;return(function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return 1===(n=1===(t=n).length&&iC(t[0])?t[0]:t).length?rv(n[0]):new ru((e=n,function(t){for(var n=[],r=function(r){n.push(rv(e[r]).subscribe(rx(t,function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)})))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}))})(new ru(function(n){return t=setTimeout(function(){return n.next(e)},3e3),function(){clearTimeout(t)}}),E.pipe(il(1),r_(function(){return null}))).pipe(r0(function(e){return null!==e}))}),(void 0===M&&(M=r8),A=ic(3e3,M),P=function(){return A},T=void 0,rb(function(e,t){var n=null!=T?T:{},r=n.leading,i=void 0===r||r,o=n.trailing,s=void 0!==o&&o,a=!1,l=null,u=null,c=!1,d=function(){null==u||u.unsubscribe(),u=null,s&&(p(),c&&t.complete())},h=function(){u=null,c&&t.complete()},f=function(e){return u=rv(P(e)).subscribe(rx(t,d,h))},p=function(){if(a){a=!1;var e=l;l=null,t.next(e),c||f(e)}};e.subscribe(rx(t,function(e){a=!0,l=e,u&&!u.closed||(i?p():f(e))},function(){c=!0,s&&a&&u&&!u.closed||t.complete()}))}))).subscribe(function(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};y.track("[Amplitude] Dead Click",(0,ec.__assign)((0,ec.__assign)({},x("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}),a.push(p),null==(g=null==t?void 0:t.loggerProvider)||g.log("".concat(s," has been successfully added.")),[2])})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,ec.__generator)(this,function(i){try{for(t=(e=(0,ec.__values)(a)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function iA(e,t,n){e&&function e(t){var n,r,i=t.json,o=t.targetObject,s=t.allowlist,a=t.excludelist,l=t.ancestors,u=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var h=(0,ec.__values)(d),f=h.next();!f.done;f=h.next()){var p,g=f.value,m=(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(l),!1),[g],!1);(p=o[g],"string"==typeof p||"number"==typeof p||"boolean"==typeof p||null==p)?(!iT(m,s)||iT(m,a))&&delete o[g]:e({json:i,targetObject:o[g],allowlist:s,excludelist:a,ancestors:m,parentObject:o,targetKey:g})}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}0===Object.keys(o).length&&u&&c&&delete u[c]}({json:e,allowlist:t.map(iP),excludelist:n.map(iP),ancestors:[]})}function iP(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function iT(e,t){return t.some(function(t){return function e(t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),i===n.length)return r===t.length;if(r===t.length){for(;i<n.length&&"**"===n[i];)i++;return i===n.length}var o=n[i];if("**"===o){if(i+1===n.length)return!0;for(var s=r;s<=t.length;s++)if(e(t,n,s,i+1))return!0;return!1}return("*"===o||o===t[r])&&e(t,n,r+1,i+1)}(e,t)})}var iR=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=(0,ec.__read)(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var o=(0,ec.__values)(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=(0,ec.__read)(s.value,2),l=a[0],u=a[1];i[l]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iB(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=(0,eI.getGlobalScope)();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=iD(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return 0===e.length?[2,null]:[2,iN(this.body,e,t)]})})},e}(),iI=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),iB(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return iD(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return 0===e.length?[2,null]:[2,iN(this.body,e,t)]})})},e}();function iD(e,t){var n,r,i,o,s=(0,eI.getGlobalScope)(),a=null==s?void 0:s.TextEncoder;if(a){if("string"==typeof e)o=e,i=new a().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(e instanceof URLSearchParams)o=e,i=new a().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if(e instanceof FormData){var l=0,u=0;try{for(var c=(0,ec.__values)(e.entries()),d=c.next();!d.done;d=c.next()){var h=(0,ec.__read)(d.value,2),f=h[0],p=h[1];if(l+=f.length,"string"==typeof p)l+=new a().encode(p).length;else{if(!(p instanceof Blob))return;l+=p.size}if(++u>=t)return}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=l}else if(e instanceof ReadableStream){o=e;return}return i}}var iL=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null==(t=null==n?void 0:n.forEach)||t.call(n,function(e,t){r[t]=e}),iB(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,iN(n.sent(),e,t)]}})})},e}(),ij=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},i=this.headersString.split("\r\n");try{for(var o=(0,ec.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value,l=(0,ec.__read)(a.split(": "),2),u=l[0],c=l[1];u&&c&&(r[u]=c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iB(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ec.__awaiter)(this,void 0,void 0,function(){var n;return(0,ec.__generator)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(iA(n,e,t),[2,n]):[2,null]})})},e}();function iN(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return iA(r,t,n),r}catch(e){return null}}(f=X||(X={})).REDACT="redact",f.REMOVE="remove";var iF="[REDACTED]",iB=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?X.REMOVE:s,l=(0,ec.__spreadArray)([],(0,ec.__read)(eE),!1),u={};try{for(var c=(0,ec.__values)(Object.keys(e)),d=c.next();!d.done;d=c.next()){var h=d.value;!function(t){var n=t.toLowerCase();l.find(function(e){return e.toLowerCase()===n})?a===X.REDACT&&(u[t]=iF):o.find(function(e){return e.toLowerCase()===n})?u[t]=e[t]:a===X.REDACT&&(u[t]=iF)}(h)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return u},iz=function(){function e(e,t,n,r,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,n,r;return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers((0,ec.__spreadArray)([],(0,ec.__read)(eO),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers((0,ec.__spreadArray)([],(0,ec.__read)(eO),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=(0,ec.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),iV=function(e,t){void 0===t&&(t=eL()),this.callback=e,this.id=t},iH=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=(0,eI.getGlobalScope)();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=(0,eI.getGlobalScope)();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,l,u,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var h=null==(i=null==(r=null==(n=this.globalScope)?void 0:n.XMLHttpRequest)?void 0:r.prototype)?void 0:i.open,f=null==(a=null==(s=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:s.prototype)?void 0:a.send,p=null==(c=null==(u=null==(l=this.globalScope)?void 0:l.XMLHttpRequest)?void 0:u.prototype)?void 0:c.setRequestHeader;h&&f&&p&&this.observeXhr(h,f,p);var g=null==(d=this.globalScope)?void 0:d.fetch;g&&this.observeFetch(g),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){var r;try{n.callback(e)}catch(e){null==(r=t.logger)||r.debug("an unexpected error occurred while triggering event callbacks",e)}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){if(void 0!==o&&void 0!==s){var a,l,u,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(l=t.url,d=t.method):l=null==(a=null==t?void 0:t.toString)?void 0:a.call(t),l)try{var h=new URL(l);l="".concat(h.protocol,"//").concat(h.host).concat(h.pathname).concat(h.search).concat(h.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(u=r.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var f=Math.floor(performance.now()-s),p=Math.floor(o+f),g=new iz(e,d,o,o,l,n,u,f,r,c,p);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,ec.__awaiter)(t,void 0,void 0,function(){var t,i,o,s,a;return(0,ec.__generator)(this,function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){null==(s=this.logger)||s.debug("an unexpected error occurred while retrieving timestamps",e)}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=l.sent(),[3,4];case 3:return o=l.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new iR(r):void 0,i?new iL(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null==(a=this.logger)||a.debug("an unexpected error occurred while handling fetch",e)}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var n,r;try{if("json"===e.responseType){if(null==(n=t.globalScope)?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){n instanceof Error&&"InvalidStateError"===n.name&&(null==(r=t.logger)||r.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'")))}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=(0,ec.__read)(r,2),a=s[0],l=s[1];try{this.$$AmplitudeAnalyticsEvent=(0,ec.__assign)({method:a,url:null==(e=null==l?void 0:l.toString)?void 0:e.call(l),headers:{}},o.getTimestamps())}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,r)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",function(){var e;try{var t=i.getAllResponseHeaders(),n=i.getResponseHeader("content-length"),r=new ij(i.status,t,n?parseInt(n,10):void 0,s),u=i.$$AmplitudeAnalyticsEvent.headers,c=new iI(a,u);l.status=i.status,o.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,r,void 0,l.startTime,l.durationStart)}catch(t){null==(e=o.logger)||e.error("an unexpected error occurred while handling xhr send",t)}}),n.apply(i,t)},i.setRequestHeader=function(e,t){var n;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr setRequestHeader",e)}r.apply(this,[e,t])}}},e}()),i$="[Amplitude] Network Request",iW="500-599";function iU(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function iq(e,t){var n,r,i=t.split(",");try{for(var o=(0,ec.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value,l=(0,ec.__read)(a.split("-").map(Number),2),u=l[0],c=l[1];if(e===u&&void 0===c||e>=u&&e<=c)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function iQ(e){var t;if(e)try{var n=null==(t=(0,eI.getGlobalScope)())?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;r.hash="",r.search="";var l=r.href;return{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:l,host:a}}catch(e){return}}function iK(e){return"object"!=typeof e||null===e?e?(0,ec.__spreadArray)([],(0,ec.__read)(eO),!1):void 0:0!==e.length?e:void 0}function iG(e){var t,n;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(n=null==e?void 0:e.blocklist)?void 0:n.length)}(Y||(Y={})).NetworkObservable="networkObservable";var iX=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=[],i=function(){var e,n=new ru(function(e){var n=new iV(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return iH.subscribe(n,t),function(){iH.unsubscribe(n)}});return(e={})[Y.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(o,s){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var a,l;return(0,ec.__generator)(this,function(u){var c,d,h,f,p;return"undefined"==typeof document?[2]:(a=i(),t=null==o?void 0:o.loggerProvider,d=(c={allObservables:a,networkTrackingOptions:e,amplitude:s,loggerProvider:t}).allObservables,h=c.networkTrackingOptions,f=c.amplitude,p=c.loggerProvider,l=d.networkObservable.pipe(r0(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=iQ(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(iU(o,"*.amplitude.com")||iU(o,"amplitude.com"))||(null==(n=t.ignoreHosts)?void 0:n.find(function(e){return iU(o,e)})))&&(!!t.captureRules||void 0===e.status||!!iq(e.status,iW))&&(!t.captureRules||((0,ec.__spreadArray)([],(0,ec.__read)(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return iU(t,e)}))&&(!r||!e.urls||rj(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!n&&0!==n||!!iq(n,e.statusCodeRange||iW))&&!0}(t,o,e.status,e.url,e.method)){var n=iK(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var s=iK(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!iG(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!iG(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==r}),!!r))&&!(e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===i$}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,h)})).subscribe(function(e){var t,n,r,i=e.event,o=iQ(i.url);if(o){var s=null==(n=i.responseWrapper)?void 0:n.bodySize,a=null==(r=i.requestWrapper)?void 0:r.bodySize;!function(e,t,n,r){(0,ec.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=ec.__read.apply(void 0,[a.sent(),2]))[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(i$,e),[2]}})})}(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=a,t["[Amplitude] Response Body Size"]=s,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,f,p)}}),r.push(l),null==t||t.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,ec.__generator)(this,function(o){try{for(t=(e=(0,ec.__values)(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};let iY=-1,iZ=e=>{addEventListener("pageshow",t=>{t.persisted&&(iY=t.timeStamp,e(t))},!0)},iJ=(e,t,n,r)=>{let i,o;return s=>{let a;t.value>=0&&(s||r)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,a=t.value,t.rating=a>n[1]?"poor":a>n[0]?"needs-improvement":"good",e(t))}},i0=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},i1=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},i2=()=>{let e=i1();return e?.activationStart??0},i5=(e,t=-1)=>{let n=i1(),r="navigate";return iY>=0?r="back-forward-cache":n&&(document.prerendering||i2()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:r}},i3=new WeakMap;function i4(e,t){return i3.get(e)||i3.set(e,new t),i3.get(e)}class i8{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let i6=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},i7=e=>{let t=!1;return()=>{t||(e(),t=!0)}},i9=-1,oe=new Set,ot=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,on=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of oe)e();isFinite(i9)||(i9="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",on,!0))}},or=()=>{if(i9<0){let e=i2();i9=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??ot(),addEventListener("visibilitychange",on,!0),addEventListener("prerenderingchange",on,!0),iZ(()=>{setTimeout(()=>{i9=ot()})})}return{get firstHiddenTime(){return i9},onHidden(e){oe.add(e)}}},oi=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},oo=[1800,3e3],os=(e,t={})=>{oi(()=>{let n=or(),r,i=i5("FCP"),o=i6("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-i2(),0),i.entries.push(t),r(!0)))});o&&(r=iJ(e,i,oo,t.reportAllChanges),iZ(n=>{r=iJ(e,i=i5("FCP"),oo,t.reportAllChanges),i0(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},oa=[.1,.25],ol=0,ou=1/0,oc=0,od=e=>{for(let t of e)t.interactionId&&(ou=Math.min(ou,t.interactionId),ol=(oc=Math.max(oc,t.interactionId))?(oc-ou)/7+1:0)},oh=()=>t?ol:performance.interactionCount??0,of=0;class op{u=[];l=new Map;m;p;v(){of=oh(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((oh()-of)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(n)}}}let og=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=i7(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},om=[200,500];class ov{m;h(e){this.m?.(e)}}let oy=[2500,4e3],ob=[800,1800],ox=e=>{document.prerendering?oi(()=>ox(e)):"complete"!==document.readyState?addEventListener("load",()=>ox(e),!0):setTimeout(e)};function ow(e){var t,n;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((n=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+n)),navigationStart:Math.floor(performance.timeOrigin)}}var o_=function(){var e=null,n=(0,eI.getGlobalScope)(),r=null==n?void 0:n.document,i=null==n?void 0:n.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(n,o){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var s,a,l;return(0,ec.__generator)(this,function(u){return s=function(e){if(!e)return"";var t,r=e;try{r=decodeURI(e)}catch(e){null==(t=n.loggerProvider)||t.error("Malformed URI sequence: ",e)}return r},void 0===r||(a=s(null==i?void 0:i.href),l={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":s(null==i?void 0:i.pathname),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":a.split("?")[0]},((e,t={})=>{oi(()=>{let n=or(),r,i=i5("LCP"),o=i4(t,ov),s=e=>{for(let s of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(s),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-i2(),0),i.entries=[s],r())},a=i6("largest-contentful-paint",s);if(a){r=iJ(e,i,oy,t.reportAllChanges);let n=i7(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(og(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});iZ(n=>{r=iJ(e,i=i5("LCP"),oy,t.reportAllChanges),i0(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){l["[Amplitude] LCP"]=ow(e)}),os(function(e){l["[Amplitude] FCP"]=ow(e)}),((e,n={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let r=or();oi(()=>{"interactionCount"in performance||t||(t=i6("event",od,{type:"event",buffered:!0,durationThreshold:0}));let i,o=i5("INP"),s=i4(n,op),a=e=>{og(()=>{for(let t of e)s.h(t);let t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},l=i6("event",a,{durationThreshold:n.durationThreshold??40});i=iJ(e,o,om,n.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(l.takeRecords()),i(!0)}),iZ(()=>{s.v(),i=iJ(e,o=i5("INP"),om,n.reportAllChanges)}))})})(function(e){l["[Amplitude] INP"]=ow(e)}),((e,t={})=>{let n=or();os(i7(()=>{let r,i=i5("CLS",0),o=i4(t,i8),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=i6("layout-shift",s);a&&(r=iJ(e,i,oa,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),iZ(()=>{o.i=0,r=iJ(e,i=i5("CLS",0),oa,t.reportAllChanges),i0(()=>r())}),setTimeout(r))}))})(function(e){l["[Amplitude] CLS"]=ow(e)}),((e,t={})=>{let n=i5("TTFB"),r=iJ(e,n,ob,t.reportAllChanges);ox(()=>{let i=i1();i&&(n.value=Math.max(i.responseStart-i2(),0),n.entries=[i],r(!0),iZ(()=>{(r=iJ(e,n=i5("TTFB",0),ob,t.reportAllChanges))(!0)}))})})(function(e){l["[Amplitude] TTFB"]=ow(e)}),e=function(){"hidden"===r.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",l),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},ok=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},oS=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},oC=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=(0,ec.__rest)(e,["referrer","referring_domain"]),a=t||{},l=(a.referrer,a.referring_domain),u=(0,ec.__rest)(a,["referrer","referring_domain"]);if(oO(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var c=JSON.stringify(s)!==JSON.stringify(u),d=oS(o||"")!==oS(l||""),h=!t||c||d;return h?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),h},oO=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},oE=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},oM=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=(0,ec.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:oE(null==(n=t.cookieOptions)?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=ok(t.apiKey,"MKTG"),this.webExpStorageKey=ok(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eC,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=ec.__read.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ta(this.sessionTimeout,this.lastEventTime),!oC(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new nx().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,eN(Object.entries((0,ec.__assign)((0,ec.__assign)({},eC),t)).reduce(function(e,t){var r,i=(0,ec.__read)(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!=(r=null!=s?s:n.initialEmptyValue)?r:"EMPTY"),s)?e.set(o,s):e.unset(o)},new eP)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),oA="AMP_CURRENT_PAGE",oP="AMP_PREVIOUS_PAGE",oT="AMP_URL_INFO";(p=Z||(Z={})).Direct="direct",p.Internal="internal",p.External="external";var oR=new Set([W.IDENTIFY,W.GROUP_IDENTIFY,W.REVENUE]),oI=function(){var e=(0,eI.getGlobalScope)(),t=void 0,n=!1,r=void 0,i=!1,o=!1,s=function(e){var t;try{var n=rN(e,r);t=new URL(n).hostname}catch(e){null==r||r.error("Could not parse URL: ",e)}return t},a=function(e){var t="undefined"!=typeof location&&location.hostname||"";switch(e?s(e):void 0){case void 0:return Z.Direct;case t:return Z.Internal;default:return Z.External}},l=function(){(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,r,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(!(t&&n))return[3,3];return[4,t.get(oT)];case 1:return e=a.sent(),r=rN("undefined"!=typeof location&&location.href||""),i=(null==e?void 0:e[oA])||"",o=void 0,o=r===i?(null==e?void 0:e[oP])||"":i||document.referrer||"",[4,t.set(oT,((s={})[oA]=r,s[oP]=o,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(s,a){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if((r=s.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),o=!0,!e)return[3,2];return[4,(t=new tZ(e.sessionStorage)).isEnabled()];case 1:n=a.sent(),e.addEventListener("popstate",l),i||(e.history.pushState=new Proxy(e.history.pushState,{apply:function(e,t,n){var r=(0,ec.__read)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&l()}}),e.history.replaceState=new Proxy(e.history.replaceState,{apply:function(e,t,n){var r=(0,ec.__read)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&l()}}),i=!0),a.label=2;case 2:return[2]}})})},execute:function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var r,i,o,s,l;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:if(r=rN("undefined"!=typeof location&&location.href||""),!(t&&n))return[3,5];return[4,t.get(oT)];case 1:if(null==(i=u.sent())?void 0:i[oA])return[3,3];return[4,t.set(oT,((l={})[oA]=r,l[oP]=document.referrer||"",l))];case 2:u.sent(),u.label=3;case 3:return[4,t.get(oT)];case 4:if(o=u.sent(),s="",o&&(s=o[oP]||""),oR.has(e.event_type))return[2,e];e.event_properties=(0,ec.__assign)((0,ec.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":oD(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":oD(e,"[Amplitude] Page Location",r),"[Amplitude] Page Path":oD(e,"[Amplitude] Page Path","undefined"!=typeof location&&rN(location.pathname)||""),"[Amplitude] Page Title":oD(e,"[Amplitude] Page Title",nb(ny)),"[Amplitude] Page URL":oD(e,"[Amplitude] Page URL",r.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":a(s)}),u.label=5;case 5:return[2,e]}})})},teardown:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(e&&(e.removeEventListener("popstate",l),o=!1),!(t&&n))return[3,2];return[4,t.set(oT,{})];case 1:r.sent(),r.label=2;case 2:return[2]}})})}}};function oD(e,t,n){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?n:e.event_properties[t]}var oL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,ec.__extends)(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),ez(this._init((0,ec.__assign)((0,ec.__assign)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s;return(0,ec.__awaiter)(this,void 0,void 0,function(){var a,l,u,c,d,h,f,p,g,m=this;return(0,ec.__generator)(this,function(v){var y,b,x,w,_;switch(v.label){case 0:if(this.initializing)return[2];return this.initializing=!0,[4,(y=t.apiKey,b=t,x=this,void 0===b&&(b={}),(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l,u,c,d,h,f,p,g,m,v,w,_,k,S,C,O,E,M,A,P,T,R,I,D,L,j,N,F,B,z,V,H,$,W,U,q,Q;return(0,ec.__generator)(this,function(K){switch(K.label){case 0:if(e=b.identityStorage||nu,k={},e===nu)return[3,1];return n="",[3,5];case 1:if(null==(C=null==(S=b.cookieOptions)?void 0:S.domain))return[3,2];return r=C,[3,4];case 2:return[4,(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:return[4,new tq().isEnabled()];case 1:if(!s.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=(0,location.hostname).split("."),t=[],n="AMP_TLDTEST",r=e.length-2;r>=0;--r)t.push(e.slice(r).join("."));r=0,s.label=2;case 2:if(!(r<t.length))return[3,7];return[4,(o=new tq({domain:"."+(i=t[r])})).set(n,1)];case 3:return s.sent(),[4,o.get(n)];case 4:if(!s.sent())return[3,6];return[4,o.remove(n)];case 5:return s.sent(),[2,"."+i];case 6:return r++,[3,2];case 7:return[2,""]}})})];case 3:r=K.sent(),K.label=4;case 4:n=r,K.label=5;case 5:var G,X;return t=ec.__assign.apply(void 0,[(k.domain=n,k.expiration=365,k.sameSite="Lax",k.secure=!1,k.upgrade=!0,k),b.cookieOptions]),[4,(G=i=nd(b.identityStorage,t),void 0===(X=null==(E=null==(O=b.cookieOptions)?void 0:O.upgrade)||E)&&(X=!0),(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:return e="".concat("amp","_").concat(y.substring(0,6)),[4,G.getRaw(e)];case 1:if(!(t=u.sent()))return[2,{optOut:!1}];if(!X)return[3,3];return[4,G.remove(e)];case 2:u.sent(),u.label=3;case 3:return r=(n=(0,ec.__read)(t.split("."),6))[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],[2,{deviceId:r,userId:t3(i),sessionId:t5(s),lastEventId:t5(l),lastEventTime:t5(a),optOut:!!o}]}})}))];case 6:return o=K.sent(),[4,i.get(tG(y))];case 7:return s=K.sent(),u=!(l=(a=tu()).ampTimestamp?Number(a.ampTimestamp):void 0)||Date.now()<l,c=null!=(R=null!=(T=null!=(P=null!=(M=b.deviceId)?M:u?null!=(A=a.ampDeviceId)?A:a.deviceId:void 0)?P:null==s?void 0:s.deviceId)?T:o.deviceId)?R:eL(),d=null!=(I=null==s?void 0:s.lastEventId)?I:o.lastEventId,h=null!=(D=null==s?void 0:s.lastEventTime)?D:o.lastEventTime,f=null!=(j=null!=(L=b.optOut)?L:null==s?void 0:s.optOut)?j:o.optOut,p=null!=(N=null==s?void 0:s.sessionId)?N:o.sessionId,g=null!=(B=null!=(F=b.userId)?F:null==s?void 0:s.userId)?B:o.userId,x.previousSessionDeviceId=null!=(z=null==s?void 0:s.deviceId)?z:o.deviceId,x.previousSessionUserId=null!=(V=null==s?void 0:s.userId)?V:o.userId,m={ipAddress:null==($=null==(H=b.trackingOptions)?void 0:H.ipAddress)||$,language:null==(U=null==(W=b.trackingOptions)?void 0:W.language)||U,platform:null==(Q=null==(q=b.trackingOptions)?void 0:q.platform)||Q},v=null==s?void 0:s.pageCounter,w=null==s?void 0:s.debugLogsEnabled,void 0!==b.autocapture&&(b.defaultTracking=b.autocapture),[4,(_=new nc(y,b.appVersion,i,t,b.defaultTracking,b.autocapture,c,b.flushIntervalMillis,b.flushMaxRetries,b.flushQueueSize,e,b.ingestionMetadata,b.instanceName,d,h,b.loggerProvider,b.logLevel,b.minIdLength,b.offline,f,b.partnerId,b.plan,b.serverUrl,b.serverZone,p,b.sessionTimeout,b.storageProvider,m,b.transport,b.useBatch,b.fetchRemoteConfig,g,v,w,b.networkTrackingOptions,b.identify,b.enableDiagnostics,void 0,void 0,b.remoteConfig)).storageProvider.isEnabled()];case 8:return K.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new tU),[2,_]}})}))];case 1:if(!(null==(n=(a=v.sent()).remoteConfig)?void 0:n.fetchRemoteConfig))return[3,3];return l=new th(a.apiKey,a.loggerProvider,a.serverZone,null==(r=a.remoteConfig)?void 0:r.serverUrl),[4,new Promise(function(e){null==l||l.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){a.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var n,r,i,o,s,a,l,u,c,d,h,f=Object.keys(t);try{for(var p=(0,ec.__values)(f),g=p.next();!g.done;g=p.next()){var m=g.value;try{var v=t[m];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(t[m]=!0)):t[m]=!1),e(v)}catch(e){}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{if(null==(c=null==(u=null==(l=t.autocapture)?void 0:l.networkTracking)?void 0:u.captureRules)?void 0:c.length)try{for(var y=(0,ec.__values)(t.autocapture.networkTracking.captureRules),b=y.next();!b.done;b=y.next()){var x=b.value;try{for(var w=(s=void 0,(0,ec.__values)(["responseHeaders","requestHeaders"])),_=w.next();!_.done;_=w.next()){var k=_.value,S=null!=(d=x[k])?d:{},C=S.captureSafeHeaders,O=S.allowlist;if(C||O){if(void 0!==O&&!Array.isArray(O)){delete x[k];continue}x[k]=(0,ec.__spreadArray)((0,ec.__spreadArray)([],(0,ec.__read)(C?eO:[]),!1),(0,ec.__read)(null!=O?O:[]),!1)}}}catch(e){s={error:e}}finally{try{_&&!_.done&&(a=w.return)&&a.call(w)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}catch(e){}var E=null==(h=t.autocapture)?void 0:h.frustrationInteractions;E&&(E.rageClick&&(E.rageClicks=E.rageClick,delete E.rageClick),E.deadClick&&(E.deadClicks=E.deadClick,delete E.deadClick))}}(e);try{var n,r,i,o,s,a,l;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var u=(0,ec.__assign)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){u.elementInteractions=(0,ec.__assign)({},e.autocapture.elementInteractions);var c=u.elementInteractions,d=null!=(o=c.pageUrlAllowlist)?o:[],h=e.autocapture.elementInteractions.pageUrlAllowlistRegex;c.pageUrlAllowlist=nI(d,h,t),delete c.pageUrlAllowlistRegex}if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(s=e.autocapture.networkTracking.captureRules)?void 0:s.length)){u.networkTracking=(0,ec.__assign)({},e.autocapture.networkTracking);var f=null!=(a=u.networkTracking.captureRules)?a:[];try{for(var p=(0,ec.__values)(f),g=p.next();!g.done;g=p.next()){var m=g.value;m.urls=nI(null!=(l=m.urls)?l:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=(0,ec.__assign)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},u)),"object"==typeof t.autocapture&&(t.autocapture=(0,ec.__assign)((0,ec.__assign)({},t.autocapture),u))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,a),e()})})];case 2:v.sent(),v.label=3;case 3:return(u=new tE(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(t$,"/").concat(tH)),[4,e.prototype._init.call(this,a)];case 4:if(v.sent(),this.logBrowserOptions(a),this.config.diagnosticsClient=u,this.config.remoteConfigClient=l,!tA(this.config.defaultTracking))return[3,6];return c=tA((w=this.config).defaultTracking)&&w.defaultTracking&&"object"==typeof w.defaultTracking&&w.defaultTracking.attribution&&"object"==typeof w.defaultTracking.attribution?(0,ec.__assign)({},w.defaultTracking.attribution):{},this.webAttribution=new oM(c,this.config),[4,this.webAttribution.init()];case 5:v.sent(),v.label=6;case 6:if(f=!(h=(d=tu()).ampTimestamp?Number(d.ampTimestamp):void 0)||Date.now()<h,this.config.identify&&this.identify(this.config.identify),p=f&&!Number.isNaN(Number(d.ampSessionId))?Number(d.ampSessionId):void 0,this.setSessionId(null!=(s=null!=(o=null!=(i=t.sessionId)?i:p)?o:this.config.sessionId)?s:Date.now()),(g=ti(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,8];return[4,this.add(nR()).promise];case 7:v.sent(),v.label=8;case 8:return[4,this.add(new e2({diagnosticsClient:u})).promise];case 9:return v.sent(),[4,this.add(new tW).promise];case 10:return v.sent(),[4,this.add(new tl).promise];case 11:if(v.sent(),nT(this.config),!tM(this.config.defaultTracking,"fileDownloads"))return[3,13];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(nA()).promise];case 12:v.sent(),v.label=13;case 13:if(!tM(this.config.defaultTracking,"formInteractions"))return[3,15];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(nO()).promise];case 14:v.sent(),v.label=15;case 15:if(!tP(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(n_(tF(this.config))).promise];case 16:v.sent(),v.label=17;case 17:if(!tI(this.config.autocapture))return[3,19];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(i_(tL(this.config),{diagnosticsClient:u})).promise];case 18:v.sent(),v.label=19;case 19:if(!tD(this.config.autocapture))return[3,21];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(iM(tj(this.config))).promise];case 20:v.sent(),v.label=21;case 21:if(!tR(this.config.autocapture))return[3,23];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(iX(tN(this.config))).promise];case 22:v.sent(),v.label=23;case 23:if(!("boolean"==typeof(_=this.config.autocapture)?_:"object"==typeof _&&!0===_.webVitals))return[3,25];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(o_()).promise];case 24:v.sent(),v.label=25;case 25:if(!tM(this.config.autocapture,"pageUrlEnrichment"))return[3,27];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(oI()).promise];case 26:v.sent(),v.label=27;case 27:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 28:return v.sent(),g.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=(0,ec.__rest)(t,["time"]);m.track(e.eventType,r,"number"==typeof n?{time:n}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),to(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null==(e=this.config)?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),ts(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(eL()),this.setUserId(void 0)},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?void 0:t.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),ez(Promise.resolve());if(e===this.config.sessionId)return ez(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!=(t=this.config.lastEventId)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,tT(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ne,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return tT(this.config.defaultTracking)&&n.push(this.track(t9,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ez(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=nh(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(tz(t)){var r=t._q;t._q=[],t=tB(new eP,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(tz(r)){var o=r._q;r._q=[],r=tB(new eP,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(tz(t)){var r=t._q;t._q=[],t=tB(new e5,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r,i;return(0,ec.__generator)(this,function(o){return n=Date.now(),r=ta(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==t9&&t.event_type!==ne&&(!t.session_id||t.session_id===this.getSessionId())&&(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),t.event_type===W.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,ec.__assign)((0,ec.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(eV);(g=J||(J={})).US="US",g.EU="EU",g.STAGING="STAGING";var oj="[Amplitude]",oN="".concat(oj," Session Replay ID"),oF=J.US,oB={enabled:!0},oz="".concat(oj," Session Replay Debug"),oV="amp-mask";(m=ee||(ee={})).GET_SR_PROPS="get-sr-props",m.DEBUG_INFO="debug-info",m.FETCH_REQUEST="fetch-request",m.METADATA="metadata",m.TARGETING_DECISION="targeting-decision";var oH=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){if(!this.logger)return function(){};var t,n=this.logger[e];return"function"==typeof n?(null!=(t=n.__rrweb_original__)?t:n).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),o$="medium",oW=function(e,t,n){switch(t){case"light":if("input"!==e)return!0;var r,i,o=n?(i=(r=n).type,r.hasAttribute("data-rr-is-password")?"password":i?i.toLowerCase():null):"";if(!o)return!1;if(["password","hidden","email","tel"].includes(o)||n.autocomplete.startsWith("cc-"))return!0;return!1;case"medium":case"conservative":return!0;default:return oW(e,o$,n)}},oU=function(e,t,n){var r,i,o;if(void 0===t&&(t={defaultMaskLevel:o$}),n){if(n.closest("."+oV)||(null!=(r=t.maskSelector)?r:[]).some(function(e){return n.closest(e)}))return!0;if(n.closest(".amp-unmask")||(null!=(i=t.unmaskSelector)?i:[]).some(function(e){return n.closest(e)}))return!1}return oW(e,null!=(o=t.defaultMaskLevel)?o:o$,n)},oq=function(e,t){return function(n,r){return oU(e,t,r)?n.replace(/[^\s]/g,"*"):n}},oQ=function(){var e=(0,eI.getGlobalScope)();return(null==e?void 0:e.location)?e.location.href:""},oK=function(e,t){return t||(e===J.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===J.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},oG=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},oX=function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){var t;return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t)}))throw Error("ugcFilterRules must be an array of objects with valid globs")},oY=function(e,t){var n,r;try{for(var i=(0,ec.__values)(t),o=i.next();!o.done;o=i.next()){var s=o.value,a=oG(s.selector);if(a.test(e))return e.replace(a,s.replacement)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},oZ=function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,3,,4]),!(e=(0,eI.getGlobalScope)()))return[3,2];return[4,e.navigator.storage.estimate()];case 1:return n=(t=i.sent()).usage,r=t.quota,[2,{totalStorageSize:n?Math.round(n/1024):0,percentOfQuota:n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,usageDetails:JSON.stringify(t.usageDetails)}];case 2:return[3,4];case 3:return i.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},oJ=function(e){var t=(0,ec.__assign)({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},o0=function(){return{flushMaxRetries:2,logLevel:Q.Warn,loggerProvider:new eW,transportProvider:new tY}},o1=function(e){function t(t,n){var r,i,o,s,a,l=this,u=o0();return(l=e.call(this,(0,ec.__assign)((0,ec.__assign)({transportProvider:u.transportProvider,loggerProvider:new oH(n.loggerProvider||u.loggerProvider)},n),{apiKey:t}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=u.flushMaxRetries?n.flushMaxRetries:u.flushMaxRetries,l.apiKey=t,l.sampleRate=n.sampleRate||0,l.serverZone=n.serverZone||oF,l.configServerUrl=n.configServerUrl,l.trackServerUrl=n.trackServerUrl,l.shouldInlineStylesheet=n.shouldInlineStylesheet,l.version=n.version,l.performanceConfig=n.performanceConfig||oB,l.storeType=null!=(r=n.storeType)?r:"idb",l.applyBackgroundColorToBlockedElements=null!=(i=n.applyBackgroundColorToBlockedElements)&&i,l.enableUrlChangePolling=null!=(o=n.enableUrlChangePolling)&&o,l.urlChangePollingInterval=null!=(s=n.urlChangePollingInterval)?s:1e3,l.captureDocumentTitle=null!=(a=n.captureDocumentTitle)&&a,n.privacyConfig&&(l.privacyConfig=n.privacyConfig),n.interactionConfig&&(l.interactionConfig=n.interactionConfig,l.interactionConfig.ugcFilterRules&&oX(l.interactionConfig.ugcFilterRules)),n.debugMode&&(l.debugMode=n.debugMode),n.experimental&&(l.experimental=n.experimental),n.omitElementTags&&(l.omitElementTags=n.omitElementTags),l}return(0,ec.__extends)(t,e),t}(eq),o2=((v=o2||{})[v.DomContentLoaded=0]="DomContentLoaded",v[v.Load=1]="Load",v[v.FullSnapshot=2]="FullSnapshot",v[v.IncrementalSnapshot=3]="IncrementalSnapshot",v[v.Meta=4]="Meta",v[v.Custom=5]="Custom",v[v.Plugin=6]="Plugin",v),o5=((y=o5||{})[y.Mutation=0]="Mutation",y[y.MouseMove=1]="MouseMove",y[y.MouseInteraction=2]="MouseInteraction",y[y.Scroll=3]="Scroll",y[y.ViewportResize=4]="ViewportResize",y[y.Input=5]="Input",y[y.TouchMove=6]="TouchMove",y[y.MediaInteraction=7]="MediaInteraction",y[y.StyleSheetRule=8]="StyleSheetRule",y[y.CanvasMutation=9]="CanvasMutation",y[y.Font=10]="Font",y[y.Log=11]="Log",y[y.Drag=12]="Drag",y[y.StyleDeclaration=13]="StyleDeclaration",y[y.Selection=14]="Selection",y[y.AdoptedStyleSheet=15]="AdoptedStyleSheet",y[y.CustomElement=16]="CustomElement",y),o3=((b=o3||{})[b.MouseUp=0]="MouseUp",b[b.MouseDown=1]="MouseDown",b[b.Click=2]="Click",b[b.ContextMenu=3]="ContextMenu",b[b.DblClick=4]="DblClick",b[b.Focus=5]="Focus",b[b.Blur=6]="Blur",b[b.TouchStart=7]="TouchStart",b[b.TouchMove_Departed=8]="TouchMove_Departed",b[b.TouchEnd=9]="TouchEnd",b[b.TouchCancel=10]="TouchCancel",b),o4=((x=o4||{})[x.Mouse=0]="Mouse",x[x.Pen=1]="Pen",x[x.Touch=2]="Touch",x),o8=((w=o8||{})[w["2D"]=0]="2D",w[w.WebGL=1]="WebGL",w[w.WebGL2=2]="WebGL2",w),o6=((_=o6||{})[_.Play=0]="Play",_[_.Pause=1]="Pause",_[_.Seeked=2]="Seeked",_[_.VolumeChange=3]="VolumeChange",_[_.RateChange=4]="RateChange",_),o7=((k=o7||{}).Start="start",k.Pause="pause",k.Resume="resume",k.Resize="resize",k.Finish="finish",k.FullsnapshotRebuilded="fullsnapshot-rebuilded",k.LoadStylesheetStart="load-stylesheet-start",k.LoadStylesheetEnd="load-stylesheet-end",k.SkipStart="skip-start",k.SkipEnd="skip-end",k.MouseInteraction="mouse-interaction",k.EventCast="event-cast",k.CustomEvent="custom-event",k.Flush="flush",k.StateChange="state-change",k.PlayBack="play-back",k.Destroy="destroy",k),o9=((S=o9||{})[S.Document=0]="Document",S[S.DocumentType=1]="DocumentType",S[S.Element=2]="Element",S[S.Text=3]="Text",S[S.CDATA=4]="CDATA",S[S.Comment=5]="Comment",S),se=function(e,t){var n=document.createDocumentFragment(),r=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{n.querySelector(e)}catch(n){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},st=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,n;return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,l,u,c,d,h,f,p,g,m,v,y,b=this;return(0,ec.__generator)(this,function(x){switch(x.label){case 0:return(r=(0,ec.__assign)({},this.localConfig)).optOut=this.localConfig.optOut,r.captureEnabled=!0,[4,new Promise(function(e){b.remoteConfigClient.subscribe("configs.sessionReplay","all",function(t,n){var o;if(b.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(t,null,2)),t){var s=t.sr_sampling_config,a=t.sr_privacy_config,l=t.sr_targeting_config,u=null==(o=r.interactionConfig)?void 0:o.ugcFilterRules;r.interactionConfig=t.sr_interaction_config,r.interactionConfig&&u&&(r.interactionConfig.ugcFilterRules=u),r.loggingConfig=t.sr_logging_config,(s||a||l)&&(i={},s&&(i.sr_sampling_config=s),a&&(i.sr_privacy_config=a),l&&(i.sr_targeting_config=l))}e()})})];case 1:if(x.sent(),!i)return[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}];if(o=i.sr_sampling_config,s=i.sr_privacy_config,a=i.sr_targeting_config,o&&Object.keys(o).length>0?(Object.prototype.hasOwnProperty.call(o,"capture_enabled")?r.captureEnabled=o.capture_enabled:r.captureEnabled=!1,Object.prototype.hasOwnProperty.call(o,"sample_rate")&&(r.sampleRate=o.sample_rate)):(r.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),s){l=null!=(e=r.privacyConfig)?e:{},u={defaultMaskLevel:null!=(n=null!=(t=s.defaultMaskLevel)?t:l.defaultMaskLevel)?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},c=function(e){var t,n,r,i,o,s,a,l,u,c={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=(0,ec.__values)(null!=(a=e.blockSelector)?a:[]),h=d.next();!h.done;h=d.next()){var f=h.value;c[f]="block"}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}try{for(var p=(0,ec.__values)(null!=(l=e.maskSelector)?l:[]),g=p.next();!g.done;g=p.next()){var f=g.value;c[f]="mask"}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var m=(0,ec.__values)(null!=(u=e.unmaskSelector)?u:[]),v=m.next();!v.done;v=m.next()){var f=v.value;c[f]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return c},d=(0,ec.__assign)((0,ec.__assign)({},c(l)),c(s));try{for(f=(h=(0,ec.__values)(Object.entries(d))).next();!f.done;f=h.next())g=(p=(0,ec.__read)(f.value,2))[0],m=p[1],"mask"===m?u.maskSelector.push(g):"block"===m?u.blockSelector.push(g):"unmask"===m&&u.unmaskSelector.push(g)}catch(e){v={error:e}}finally{try{f&&!f.done&&(y=h.return)&&y.call(h)}finally{if(v)throw v.error}}r.privacyConfig=se(u,this.localConfig.loggerProvider)}return a&&Object.keys(a).length>0&&(r.targetingConfig=a),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:oJ(r)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}]}})})},e}(),sn=Uint8Array,sr=Uint16Array,si=Uint32Array,so=new sn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ss=new sn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sa=new sn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sl=function(e,t){for(var n=new sr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new si(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},su=sl(so,2),sc=su[0],sd=su[1];sc[28]=258,sd[258]=28;for(var sh=sl(ss,0),sf=(sh[0],sh[1]),sp=new sr(32768),sg=0;sg<32768;++sg){var sm=(43690&sg)>>>1|(21845&sg)<<1;sm=(61680&(sm=(52428&sm)>>>2|(13107&sm)<<2))>>>4|(3855&sm)<<4,sp[sg]=((65280&sm)>>>8|(255&sm)<<8)>>>1}for(var sv=function(e,t,n){for(var r,i=e.length,o=0,s=new sr(t);o<i;++o)++s[e[o]-1];var a=new sr(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new sr(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var u=o<<4|e[o],c=t-e[o],d=a[e[o]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)r[sp[d]>>>l]=u}else for(o=0,r=new sr(i);o<i;++o)r[o]=sp[a[e[o]-1]++]>>>15-e[o];return r},sy=new sn(288),sg=0;sg<144;++sg)sy[sg]=8;for(var sg=144;sg<256;++sg)sy[sg]=9;for(var sg=256;sg<280;++sg)sy[sg]=7;for(var sg=280;sg<288;++sg)sy[sg]=8;for(var sb=new sn(32),sg=0;sg<32;++sg)sb[sg]=5;var sx=sv(sy,9,0),sw=sv(sb,5,0),s_=function(e){return(e/8|0)+(7&e&&1)},sk=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof sr?sr:e instanceof si?si:sn)(n-t);return r.set(e.subarray(t,n)),r},sS=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},sC=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},sO=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new sn(0),0];if(1==i){var s=new sn(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[d].f?u++:d++],l=n[u!=c&&n[u].f<n[d].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var h=o[0].s,r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var f=new sr(h+1),p=sE(n[c-1],f,0);if(p>t){var r=0,g=0,m=p-t,v=1<<m;for(o.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var y=o[r].s;if(f[y]>t)g+=v-(1<<p-f[y]),f[y]=t;else break}for(g>>>=m;g>0;){var b=o[r].s;f[b]<t?g-=1<<t-f[b]++-1:++r}for(;r>=0&&g;--r){var x=o[r].s;f[x]==t&&(--f[x],++g)}p=t}return[new sn(f),p]},sE=function(e,t,n){return -1==e.s?Math.max(sE(e.l,t,n+1),sE(e.r,t,n+1)):t[e.s]=n},sM=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new sr(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},sA=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},sP=function(e,t,n){var r=n.length,i=s_(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},sT=function(e,t,n,r,i,o,s,a,l,u,c){sS(t,c++,n),++i[256];for(var d,h,f,p,g=sO(i,15),m=g[0],v=g[1],y=sO(o,15),b=y[0],x=y[1],w=sM(m),_=w[0],k=w[1],S=sM(b),C=S[0],O=S[1],E=new sr(19),M=0;M<_.length;++M)E[31&_[M]]++;for(var M=0;M<C.length;++M)E[31&C[M]]++;for(var A=sO(E,7),P=A[0],T=A[1],R=19;R>4&&!P[sa[R-1]];--R);var I=u+5<<3,D=sA(i,sy)+sA(o,sb)+s,L=sA(i,m)+sA(o,b)+s+14+3*R+sA(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(I<=D&&I<=L)return sP(t,c,e.subarray(l,l+u));if(sS(t,c,1+(L<D)),c+=2,L<D){d=sv(m,v,0),h=m,f=sv(b,x,0),p=b;var j=sv(P,T,0);sS(t,c,k-257),sS(t,c+5,O-1),sS(t,c+10,R-4),c+=14;for(var M=0;M<R;++M)sS(t,c+3*M,P[sa[M]]);c+=3*R;for(var N=[_,C],F=0;F<2;++F)for(var B=N[F],M=0;M<B.length;++M){var z=31&B[M];sS(t,c,j[z]),c+=P[z],z>15&&(sS(t,c,B[M]>>>5&127),c+=B[M]>>>12)}}else d=sx,h=sy,f=sw,p=sb;for(var M=0;M<a;++M)if(r[M]>255){var z=r[M]>>>18&31;sC(t,c,d[z+257]),c+=h[z+257],z>7&&(sS(t,c,r[M]>>>23&31),c+=so[z]);var V=31&r[M];sC(t,c,f[V]),c+=p[V],V>3&&(sC(t,c,r[M]>>>5&8191),c+=ss[V])}else sC(t,c,d[r[M]]),c+=h[r[M]];return sC(t,c,d[256]),c+h[256]},sR=new si([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sI=function(e,t,n,r,i,o){var s=e.length,a=new sn(r+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?u=sP(l,u,e.subarray(c,d)):(l[c]=o,u=sP(l,u,e.subarray(c,s)))}else{for(var h=sR[t-1],f=h>>>13,p=8191&h,g=(1<<n)-1,m=new sr(32768),v=new sr(g+1),y=Math.ceil(n/3),b=2*y,x=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},w=new si(25e3),_=new sr(288),k=new sr(32),S=0,C=0,c=0,O=0,E=0,M=0;c<s;++c){var A=x(c),P=32767&c,T=v[A];if(m[P]=T,v[A]=P,E<=c){var R=s-c;if((S>7e3||O>24576)&&R>423){u=sT(e,l,0,w,_,k,C,O,M,c-M,u),O=S=C=0,M=c;for(var I=0;I<286;++I)_[I]=0;for(var I=0;I<30;++I)k[I]=0}var D=2,L=0,j=p,N=P-T&32767;if(R>2&&A==x(c-N))for(var F=Math.min(f,R)-1,B=Math.min(32767,c),z=Math.min(258,R);N<=B&&--j&&P!=T;){if(e[c+D]==e[c+D-N]){for(var V=0;V<z&&e[c+V]==e[c+V-N];++V);if(V>D){if(D=V,L=N,V>F)break;for(var H=Math.min(N,V-2),$=0,I=0;I<H;++I){var W=c-N+I+32768&32767,U=m[W],q=W-U+32768&32767;q>$&&($=q,T=W)}}}T=m[P=T],N+=P-T+32768&32767}if(L){w[O++]=0x10000000|sd[D]<<18|sf[L];var Q=31&sd[D],K=31&sf[L];C+=so[Q]+ss[K],++_[257+Q],++k[K],E=c+D,++S}else w[O++]=e[c],++_[e[c]]}}u=sT(e,l,o,w,_,k,C,O,M,c-M,u)}return sk(a,0,r+s_(u)+i)},sD=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)r+=n[s],i+=r;r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+((255&e)<<23)*2}}},sL=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},sj=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},sN=function(){function e(e,t,n,r){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t,n,r,i,o;return JSON.stringify(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return new TextDecoder().decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):n+=String.fromCharCode(55296|(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&i)}return n}((t=function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e);for(var r=new sn(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new sn(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128?o(l):(l<2048?o(192|l>>>6):(l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63)):o(224|l>>>12),o(128|l>>>6&63)),o(128|63&l))}return sk(r,0,i)}(JSON.stringify({...e,v:"v1"})),void 0===n&&(n={}),(r=sD()).p(t),sj(o=sI(t,null==(i=n).level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,2,4,!0),n),sL(o,o.length-4,r.d()),o),!0))},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(n){"DataCloneError"===n.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",n)}else{var n=o.compressEvent(e);o.addCompressedEventToManager(n,t)}},this.terminate=function(){var e;null==(e=o.worker)||e.terminate()};var s=(0,eI.getGlobalScope)();if(this.canUseIdleCallback=s&&"requestIdleCallback"in s,this.eventsManager=e,this.config=t,this.deviceId=n,this.timeout=(null==(i=t.performanceConfig)?void 0:i.timeout)||2e3,r){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,n=t.compressedEvent,r=t.sessionId;o.addCompressedEventToManager(n,r)},this.worker=a}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var n;this.canUseIdleCallback&&(null==(n=this.config.performanceConfig)?void 0:n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var r=n.event,i=n.sessionId;this.addCompressedEvent(r,i)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),sF="Failed to store session replay events in IndexedDB",sB="1.29.3",sz=function(){function e(e){var t=e.trackServerUrl,n=e.loggerProvider,r=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=n,this.payloadBatcher=r||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue((0,ec.__assign)((0,ec.__assign)({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){(e.queue=e.queue.concat(t),0===t.timeout)?e.schedule(0):setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:return t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return r.send(t,e)}))];case 1:return i.sent(),[2]}})})},e.prototype.send=function(e,t){var n,r;return void 0===t&&(t=!0),(0,ec.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,l,u,c,d,h,f,p,g;return(0,ec.__generator)(this,function(m){switch(m.label){case 0:if(!(i=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(s=oQ(),a=sB,l=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),c="".concat((null==(n=e.version)?void 0:n.type)||"standalone","/").concat((null==(r=e.version)?void 0:r.version)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];m.label=1;case 1:return m.trys.push([1,3,,4]),h={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i),"X-Client-Version":a,"X-Client-Library":c,"X-Client-Url":s.substring(0,1e3),"X-Client-Sample-Rate":"".concat(l)},body:JSON.stringify(d),method:"POST"},[4,fetch("".concat(oK(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),h)];case 2:if(null===(f=m.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(f.status,e);else{p="";try{p=JSON.stringify(f.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(f.status,": ").concat(p)})}return[3,4];case 3:return g=m.sent(),this.completeRequest({context:e,err:g}),[3,4];case 4:return[2]}})})},e.prototype.handleReponse=function(e,t){switch(new tX().buildStatus(e)){case q.Success:this.handleSuccessResponse(t);break;case q.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue((0,ec.__assign)((0,ec.__assign)({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,n=e.err,r=e.success;t.onComplete(),n?this.loggerProvider.warn(n):r&&this.loggerProvider.log(r)},e}(),sV=e.i(601217),sH=function(){function e(e){var t,n,r,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var n=i.getStringSize(t);return i.getEventsArraySize(e)+n>=i.maxPersistedEventsSize||Date.now()-i.timeAtLastSplit>i.interval&&!!e.length&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!=(t=e.minInterval)?t:this.minInterval,this.maxInterval=null!=(n=e.maxInterval)?n:this.maxInterval,this.maxPersistedEventsSize=null!=(r=e.maxPersistedEventsSize)?r:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,n,r=0;try{for(var i=(0,ec.__values)(e),o=i.next();!o.done;o=i.next()){var s=o.value;r+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r+(2+Math.max(0,e.length-1)+2*e.length)},e}();(C=et||(et={})).RECORDING="recording",C.SENT="sent";var s$="sessionCurrentSequence",sW="sequencesToSend",sU=function(){var e=(0,eI.getGlobalScope)();return new Promise(function(t,n){if(!e)return n(Error("Global scope not found"));if(!e.indexedDB)return n(Error("Session Replay: cannot find indexedDB"));try{var r=e.indexedDB.open("keyval-store");r.onupgradeneeded=function(){1===r.result.version&&(r.result.close(),r.transaction&&r.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},r.onsuccess=function(){t(r.result)},r.onerror=function(){n(r.error)}}catch(e){n(e)}})},sq=function(e){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){switch(t.label){case 0:if(!(e.length>0))return[3,2];return[4,Promise.all(e.splice(0,10))];case 1:return t.sent(),[3,0];case 2:return[2]}})})},sQ=function(e){var t,n;return e.objectStoreNames.contains(s$)||(n=e.createObjectStore(s$,{keyPath:"sessionId"})),e.objectStoreNames.contains(sW)||(t=e.createObjectStore(sW,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:n}},sK=function(e){function t(t){var n=e.call(this,t)||this;return n.getSequencesToSend=function(){return(0,ec.__awaiter)(n,void 0,void 0,function(){var e,t,n,r,i,o;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:if(!t)return[3,4];return r=(n=t.value).sessionId,i=n.events,e.push({events:i,sequenceId:t.key,sessionId:r}),[4,t.continue()];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(sF,": ").concat(o)),[3,6];case 6:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return(0,ec.__awaiter)(n,void 0,void 0,function(){var t,n,r;return(0,ec.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(s$,e)];case 1:if(!(t=i.sent()))return[2,void 0];return[4,this.db.put(sW,{sessionId:e,events:t.events})];case 2:return n=i.sent(),[4,this.db.put(s$,{sessionId:e,events:[]})];case 3:return i.sent(),[2,(0,ec.__assign)((0,ec.__assign)({},t),{sessionId:e,sequenceId:n})];case 4:return r=i.sent(),this.loggerProvider.warn("".concat(sF,": ").concat(r)),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return(0,ec.__awaiter)(n,void 0,void 0,function(){var n,r,i,o,s,a;return(0,ec.__generator)(this,function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(n=this.db.transaction(s$,"readwrite")).store.get(e)];case 1:if(r=l.sent())return[3,3];return[4,n.store.put({sessionId:e,events:[t]})];case 2:return l.sent(),[2];case 3:if(i=void 0,!this.shouldSplitEventsList(r.events,t))return[3,5];return i=r.events,[4,n.store.put({sessionId:e,events:[t]})];case 4:return l.sent(),[3,7];case 5:return o=r.events.concat(t),[4,n.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,n.done];case 8:if(l.sent(),!i)return[2,void 0];return[4,this.storeSendingEvents(e,i)];case 9:if(!(s=l.sent()))return[2,void 0];return[2,{events:i,sessionId:e,sequenceId:s}];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(sF,": ").concat(a)),[3,11];case 11:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return(0,ec.__awaiter)(n,void 0,void 0,function(){var n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.db.put(sW,{sessionId:e,events:t})];case 1:return[2,r.sent()];case 2:return n=r.sent(),this.loggerProvider.warn("".concat(sF,": ").concat(n)),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return(0,ec.__awaiter)(n,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:if(!t)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.db.delete(sW,t)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),this.loggerProvider.warn("".concat(sF,": ").concat(e)),[3,4];case 4:return[2]}})})},n.transitionFromKeyValStore=function(e){return(0,ec.__awaiter)(n,void 0,void 0,function(){var t,n,r,i,o,s,a,l=this;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,sU()];case 1:if(!(t=u.sent()))return[2];n=function(e,t){return(0,ec.__awaiter)(l,void 0,void 0,function(){var n,r,i=this;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:return n=t.sessionSequences,r=[],Object.keys(n).forEach(function(o){var s=parseInt(o,10),a=n[s];if(s===t.currentSequenceId){var l=a.events.map(function(t){return(0,ec.__awaiter)(i,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return[2,this.addEventToCurrentSequence(e,t)]})})});r.push.apply(r,(0,ec.__spreadArray)([],(0,ec.__read)(l),!1))}else a.status!==et.SENT&&r.push(i.storeSendingEvents(e,a.events))}),[4,sq(r)];case 1:return o.sent(),[2]}})})},r="".concat(ed,"_").concat(this.apiKey.substring(0,10)),u.label=2;case 2:return u.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(r),[4,new Promise(function(t){i.onsuccess=function(r){return(0,ec.__awaiter)(l,void 0,void 0,function(){var i,o,s,a=this;return(0,ec.__generator)(this,function(l){switch(l.label){case 0:if(!(o=(i=r&&r.target.result)&&i[0]))return[3,2];return s=[],Object.keys(o).forEach(function(t){var r=parseInt(t,10),i=o[r];if(e===r)s.push(n(r,i));else{var l=i.sessionSequences;Object.keys(l).forEach(function(e){var t=parseInt(e,10);l[t].status!==et.SENT&&s.push(a.storeSendingEvents(r,l[t].events))})}}),[4,sq(s)];case 1:l.sent(),l.label=2;case 2:return t(),[2]}})})}})];case 3:return u.sent(),(o=(0,eI.getGlobalScope)())&&o.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return s=u.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(s)),[3,5];case 5:return[3,7];case 6:return a=u.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(a,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},n.apiKey=t.apiKey,n.db=t.db,n}return(0,ec.__extends)(t,e),t.new=function(e,n,r){return(0,ec.__awaiter)(this,void 0,void 0,function(){var i,o,s,a;return(0,ec.__generator)(this,function(l){switch(l.label){case 0:var u;return l.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),[4,(u="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,sV.openDB)(u,1,{upgrade:sQ})];case 1:return[2,e.sent()]}})}))];case 1:return o=l.sent(),[4,(s=new t((0,ec.__assign)((0,ec.__assign)({},n),{db:o}))).transitionFromKeyValStore(r)];case 2:return l.sent(),[2,s];case 3:return a=l.sent(),n.loggerProvider.warn("".concat(sF,": ").concat(a)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(!e)return[3,2];return[4,this.db.get("sessionCurrentSequence",e)];case 1:if(!(t=a.sent()))return[2,void 0];return[2,[t]];case 2:n=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=(r=ec.__values.apply(void 0,[a.sent()])).next(),a.label=5;case 5:if(i.done)return[3,7];t=i.value,n.push(t),a.label=6;case 6:return i=r.next(),[3,5];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}return[7];case 10:return[2,n]}})})},t}(sH),sG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return(0,ec.__extends)(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,n=(0,ec.__spreadArray)([],(0,ec.__read)(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:n},this.resetCurrentSequence(e),{sequenceId:t,events:n,sessionId:e}},t.prototype.getSequencesToSend=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=(0,ec.__read)(e,2),n=t[0],r=t[1],i=r.sessionId,o=r.events;return{sequenceId:Number(n),sessionId:i,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){var n;return(0,ec.__generator)(this,function(r){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(n=this.addSequence(e)),this.sequences[e].push(t),[2,n]})})},t.prototype.storeSendingEvents=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(sH),sX=function(e){var t=e.config,n=e.sessionId,r=e.minInterval,i=e.maxInterval,o=e.type,s=e.payloadBatcher,a=e.storeType;return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e,l,u,c,d;function h(t){return void 0===t&&(t=!1),(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return[2,e.flush(t)]})})}return(0,ec.__generator)(this,function(f){switch(f.label){case 0:if(e=new sz((0,ec.__assign)((0,ec.__assign)({},t),{loggerProvider:t.loggerProvider,payloadBatcher:s})),l=function(){return new sG({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:r})},"idb"!==a)return[3,2];return[4,(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:return[4,sK.new(o,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:i,apiKey:t.apiKey},n)];case 1:return e=s.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:l()]}})})];case 1:return c=f.sent(),[3,3];case 2:c=l(),f.label=3;case 3:return u=c,d=function(n){var r=n.events,i=n.sessionId,s=n.deviceId,a=n.sequenceId;t.debugMode&&oZ().then(function(e){var n=e.totalStorageSize,r=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(n," KB, percentage of quota: ").concat(r,"%, usage details: ").concat(i))}).catch(function(){}),e.sendEventsList({events:r,sessionId:i,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:o,onComplete:function(){return(0,ec.__awaiter)(void 0,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){switch(e.label){case 0:return[4,u.cleanUpSessionEventsStore(i,a)];case 1:return e.sent(),[2]}})})}})},[2,{sendCurrentSequenceEvents:function(e){var n=e.sessionId,r=e.deviceId;u.storeCurrentSequence(n).then(function(e){e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},addEvent:function(e){var n=e.event,r=e.sessionId,i=e.deviceId;u.addEventToCurrentSequence(r,n.data).then(function(e){return e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},sendStoredEvents:function(e){var t=e.deviceId;return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return[4,u.getSequencesToSend()];case 1:return(e=n.sent())&&e.forEach(function(e){d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},flush:h}]}})})},sY=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new Map;e.forEach(function(e){n.set(e.name,e.manager)}),this.managers=n}return e.prototype.sendStoredEvents=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,n=e.sessionId,r=e.event,i=e.deviceId;null==(t=this.managers.get(r.type))||t.addEvent({sessionId:n,event:r,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,n=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:n})})},e.prototype.flush=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t;return(0,ec.__generator)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.flush(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e}();let sZ={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sJ={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},s0={};function s1(e){var t,n;let r;if(s0[e])return s0[e];let i=((r=null==(n=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:n.call(t,e))&&globalThis[r]?globalThis[r]:void 0)||globalThis[e],o=i.prototype,s=e in sZ?sZ[e]:void 0,a=!!(s&&s.every(e=>{var t,n;return!!(null==(n=null==(t=Object.getOwnPropertyDescriptor(o,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),l=e in sJ?sJ[e]:void 0,u=!!(l&&l.every(e=>{var t;return"function"==typeof o[e]&&(null==(t=o[e])?void 0:t.toString().includes("[native code]"))}));if(a&&u)return s0[e]=i.prototype,i.prototype;try{let t=document.createElement("iframe");document.body.appendChild(t);let n=t.contentWindow;if(!n)return i.prototype;let r=n[e].prototype;if(document.body.removeChild(t),!r)return o;return s0[e]=r}catch{return o}}let s2={},s5=function(e){var t,n="Node",r=e,i="parentElement";let o=`${n}.${String(i)}`;if(s2[o])return s2[o].call(r);let s=null==(t=Object.getOwnPropertyDescriptor(s1(n),i))?void 0:t.get;return s?(s2[o]=s,s.call(r)):r[i]};function s3(){var e=(0,eI.getGlobalScope)();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function s4(){var e=(0,eI.getGlobalScope)();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function s8(e,t,n){for(var r=null,i=[],o=e,s=0;o&&"break"!==function(){var e,a,l,u,c=new Date().getTime()-ei.getTime();if(void 0!==en.timeoutMs&&c>en.timeoutMs)throw Error("Timeout: Can't find a unique selector after ".concat(c,"ms"));var d=ai((e=o.getAttribute("id"))&&en.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||ai.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(Array.from(o.attributes).filter(function(e){return en.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||ai.apply(void 0,(0,ec.__spreadArray)([],(0,ec.__read)(Array.from(o.classList).filter(en.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||ai((a=o.tagName.toLowerCase(),en.tagName(a)?{name:a,penalty:2}:null))||[at()],h=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(o);if("all"==t)h&&(d=d.concat(d.filter(ar).map(function(e){return an(e,h)})));else if("two"==t)d=d.slice(0,1),h&&(d=d.concat(d.filter(ar).map(function(e){return an(e,h)})));else if("one"==t){var f=(0,ec.__read)(d=d.slice(0,1),1)[0];h&&ar(f)&&(d=[an(f,h)])}else"none"==t&&(d=[at()],h&&(d=[an(d[0],h)]));try{for(var p=(l=void 0,(0,ec.__values)(d)),g=p.next();!g.done;g=p.next()){var f=g.value;f.level=s}}catch(e){l={error:e}}finally{try{g&&!g.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}if(i.push(d),i.length>=en.seedMinLength&&(r=s6(i,n)))return"break";o=o.parentElement,s++}(););return(r||(r=s6(i,n)),!r&&n)?n():r}function s6(e,t){var n,r,i=as(function e(t,n){var r,i,o,s,a;return void 0===n&&(n=[]),(0,ec.__generator)(this,function(l){switch(l.label){case 0:if(!(t.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),i=(r=(0,ec.__values)(t[0])).next(),l.label=2;case 2:if(i.done)return[3,5];return o=i.value,[5,(0,ec.__values)(e(t.slice(1,t.length),n.concat(o)))];case 3:l.sent(),l.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return s={error:l.sent()},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,n];case 10:l.sent(),l.label=11;case 11:return[2]}})}(e));if(i.length>en.threshold)return t?t():null;try{for(var o=(0,ec.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(ae(a))return a}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function s7(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function s9(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function ae(e){var t=s7(e);switch(er.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function at(){return{name:"*",penalty:3}}function an(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function ar(e){return"html"!==e.name&&!e.name.startsWith("#")}function ai(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(ao);return n.length>0?n:null}function ao(e){return null!=e}function as(e){return(0,ec.__spreadArray)([],(0,ec.__read)(e),!1).sort(function(e,t){return s9(e)-s9(t)})}var aa=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&r.push(t)}),{version:t,events:r}},al=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&r.push(t)}),{version:t,events:Object.values(r.reduce(function(e,t){var n=t.x,r=t.y,i=t.selector,o=t.timestamp,s=o-o%36e5,a="".concat(n,":").concat(r,":").concat(null!=i?i:"",":").concat(s);return e[a]?e[a].count+=1:e[a]=(0,ec.__assign)((0,ec.__assign)({},t),{timestamp:s,count:1}),e},{}))}},au=function(e,t){var n=t.eventsManager,r=t.sessionId,i=t.deviceIdFn,o=t.mirror,s=t.ugcFilterRules;return function(t){if(t.type!==o3.Click)return;var a,l=(0,eI.getGlobalScope)();if(l){var u=l.location,c=l.innerHeight,d=l.innerWidth;if(u){var h=t.x,f=t.y;if(void 0!==h&&void 0!==f){var p,g,m,v,y,b=o.getNode(t.id);if(b)try{a=function(e,t){if(ei=new Date,e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n,r,i={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};n=(en=(0,ec.__assign)((0,ec.__assign)({},i),void 0)).root,r=i,er=n.nodeType===Node.DOCUMENT_NODE?n:n===r.root?n.ownerDocument:n;var o=s8(e,"all",function(){return s8(e,"two",function(){return s8(e,"one",function(){return s8(e,"none")})})});if(o){var s=as(function e(t,n,r){var i,o,s;return void 0===r&&(r={counter:0,visited:new Map}),(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(!(t.length>2&&t.length>en.optimizedMinLength))return[3,5];i=1,a.label=1;case 1:var l,u;if(!(i<t.length-1))return[3,5];if(r.counter>en.maxNumberOfTries||(r.counter+=1,(o=(0,ec.__spreadArray)([],(0,ec.__read)(t),!1)).splice(i,1),s=s7(o),r.visited.has(s)))return[2];if(!(ae(o)&&(l=o,u=n,er.querySelector(s7(l))===u)))return[3,4];return[4,o];case 2:return a.sent(),r.visited.set(s,!0),[5,(0,ec.__values)(e(o,n,r))];case 3:a.sent(),a.label=4;case 4:return i++,[3,1];case 5:return[2]}})}(o,e));return s.length>0&&(o=s[0]),s7(o)}throw Error("Selector was not found.")}(b)}catch(t){e.debug("error resolving selector from finder")}var x={left:(y=l.document).scrollingElement?y.scrollingElement.scrollLeft:void 0!==l.pageXOffset?l.pageXOffset:y.documentElement.scrollLeft||(null==y?void 0:y.body)&&(null==(p=s5(y.body))?void 0:p.scrollLeft)||(null==(g=null==y?void 0:y.body)?void 0:g.scrollLeft)||0,top:y.scrollingElement?y.scrollingElement.scrollTop:void 0!==l.pageYOffset?l.pageYOffset:(null==y?void 0:y.documentElement.scrollTop)||(null==y?void 0:y.body)&&(null==(m=s5(y.body))?void 0:m.scrollTop)||(null==(v=null==y?void 0:y.body)?void 0:v.scrollTop)||0},w={x:h+x.left,y:f+x.top,selector:a,viewportHeight:c,viewportWidth:d,pageUrl:oY(u.href,s),timestamp:Date.now(),type:"click"},_=i();_&&n.addEvent({sessionId:r,event:{type:"interaction",data:JSON.stringify(w)},deviceId:_})}}}}},ac=function(){function e(e,t){var n=(0,eI.getGlobalScope)();n&&n.navigator&&"function"==typeof n.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(n.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var n=new XMLHttpRequest;return n.open("POST",e,!0),n.setRequestHeader("Accept","*/*"),n.send(JSON.stringify(t)),!0},this.basePageUrl=oK(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var n=this.context,r=n.sessionId,i=n.type,o=new URLSearchParams({device_id:e,session_id:String(r),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}(),ad=function(){function e(e,t){var n=this;this.timestamp=Date.now(),this.hook=function(e){n.update(e)},this.send=function(e){return function(t){var r,i,o=e(),s=(0,eI.getGlobalScope)();s&&o&&n.transport.send(o,{version:1,events:[{maxScrollX:n._maxScrollX,maxScrollY:n._maxScrollY,maxScrollWidth:n._maxScrollWidth,maxScrollHeight:n._maxScrollHeight,viewportHeight:s3(),viewportWidth:s4(),pageUrl:oY(s.location.href,null!=(i=null==(r=n.config.interactionConfig)?void 0:r.ugcFilterRules)?i:[]),timestamp:n.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=s4(),this._maxScrollHeight=s3(),this.config=t,this.transport=e}return e.default=function(t,n){return new e(new ac(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var n=s4();this._maxScrollX=e.x;var r=e.x+n;r>this._maxScrollWidth&&(this._maxScrollWidth=r),this.timestamp=t}if(e.y>this._maxScrollY){var i=s3();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ah=function(e){var t=e.sessionId,n=e.deviceId;this.deviceId=n,this.sessionId=t,t&&n&&(this.sessionReplayId="".concat(n,"/").concat(t))},af=new function(){var e=this;this.dbs={},this.createStore=function(t){return(0,ec.__awaiter)(e,void 0,void 0,function(){return(0,ec.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,sV.openDB)(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return(0,ec.__awaiter)(e,void 0,void 0,function(){var e,n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(this.dbs&&this.dbs[t])return[2,this.dbs[t]];return e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)];case 1:return n=r.sent(),this.dbs[t]=n,[2,n]}})})},this.getTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId;return(0,ec.__awaiter)(e,void 0,void 0,function(){var e,t,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),n.warn("Failed to get targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId,o=t.targetingMatch;return(0,ec.__awaiter)(e,void 0,void 0,function(){var e,t,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),n.warn("Failed to store targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.currentSessionId;return(0,ec.__awaiter)(e,void 0,void 0,function(){var e,t,o,s,a,l,u,c;return(0,ec.__generator)(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(r)];case 1:return e=d.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=d.sent(),a=0,d.label=3;case 3:if(!(a<s.length))return[3,6];if(l=s[a],u=Date.now()-l.lastUpdated,!(l.sessionId!==t&&u>1728e5))return[3,5];return[4,o.store.delete(l.sessionId)];case 4:d.sent(),d.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return d.sent(),[3,9];case 8:return c=d.sent(),n.warn("Failed to clear old targeting matches for sessions: ".concat(c)),[3,9];case 9:return[2]}})})}},ap=function(t){var n=t.sessionId,r=t.targetingConfig,i=t.loggerProvider,o=t.apiKey,s=t.targetingParams;return(0,ec.__awaiter)(void 0,void 0,void 0,function(){var t,a,l;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:return[4,af.clearStoreOfOldSessions({loggerProvider:i,apiKey:o,currentSessionId:n})];case 1:return u.sent(),[4,af.getTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:n})];case 2:if(!0===u.sent())return[2,!0];t=!0,u.label=3;case 3:return u.trys.push([3,6,,7]),[4,e.A(18737)];case 4:return[4,(0,u.sent().evaluateTargeting)((0,ec.__assign)((0,ec.__assign)({},s),{flag:r,sessionId:n,apiKey:o,loggerProvider:i}))];case 5:return(a=u.sent())&&a.sr_targeting_config&&(t="on"===a.sr_targeting_config.key),af.storeTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:n,targetingMatch:t}),[3,7];case 6:return l=u.sent(),i.warn(l.message),[3,7];case 7:return[2,t]}})})};function ag(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var i,o,s,a=(0,ec.__assign)((0,ec.__assign)({},e),r),l=a.ugcFilterRules||[],u=null!=(i=a.enablePolling)&&i,c=null!=(o=a.pollingInterval)?o:1e3,d=null!=(s=a.captureDocumentTitle)&&s;if(!n)return function(){};var h=void 0,f=function(){return n.location&&n.location.href||""},p=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=f(),o="";return d&&(o=(null==r?void 0:r.title)||""),{href:l.length>0?oY(i,l):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}},g=function(){var e=f();(void 0===h||e!==h)&&(h=e,t(p()))},m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.apply(this,t);return g(),r}},v=function(){g()};if(u){var y=n.setInterval(function(){g()},c);return g(),function(){y&&n.clearInterval(y)}}if(n.history){var b=n.history.pushState.bind(n.history),x=n.history.replaceState.bind(n.history);return n.history.pushState=m(b),n.history.replaceState=m(x),n.addEventListener("popstate",g),n.addEventListener("hashchange",v),g(),function(){n.history.pushState=b,n.history.replaceState=x,n.removeEventListener("popstate",g),n.removeEventListener("hashchange",v)}}return n.addEventListener("hashchange",v),g(),function(){n.removeEventListener("hashchange",v)}},options:e}}ag();var am=function(){function t(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var n=(0,eI.getGlobalScope)();n&&(n.removeEventListener("blur",e.blurListener),n.removeEventListener("focus",e.focusListener),t||n.addEventListener("blur",e.blurListener),t||n.addEventListener("focus",e.focusListener),n.self&&"onpagehide"in n.self?(n.removeEventListener("pagehide",e.pageLeaveListener),t||n.addEventListener("pagehide",e.pageLeaveListener)):(n.removeEventListener("beforeunload",e.pageLeaveListener),t||n.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!1),(0,ec.__awaiter)(e,void 0,void 0,function(){var e,i;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(!n)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];else this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");if(this.lastTargetingParams=t,!(this.config.targetingConfig&&!this.sessionTargetingMatch))return[3,2];return(e=t.event)&&Object.values(W).includes(e.event_type)&&(e=void 0),i=this,[4,ap({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})];case 1:i.sessionTargetingMatch=o.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),o.label=2;case 2:if(!n)return[3,3];return this.initialize(!0),[3,5];case 3:if(!(r||!this.recordCancelCallback))return[3,5];return this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()];case 4:o.sent(),o.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r=!0),(0,ec.__awaiter)(e,void 0,void 0,function(){var e,i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,3,,4]),e=void 0,!((i=this.config)&&t!==ee.METADATA)||(e={config:oJ(i),version:sB},!r))return[3,2];return[4,oZ()];case 1:o=a.sent(),e=(0,ec.__assign)((0,ec.__assign)({},o),e),a.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,(0,ec.__assign)((0,ec.__assign)({},n),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return s=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",s),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null==(t=e.networkObservers)||t.stop()}catch(t){e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new oH(new eW)}return t.prototype.init=function(e,t){return ez(this._init(e,t))},t.prototype._init=function(t,n){var r,i,o,s,a,l,u;return(0,ec.__awaiter)(this,void 0,void 0,function(){var c,d,h,f,p,g,m,v,y,b,x,w,_,k;return(0,ec.__generator)(this,function(S){switch(S.label){case 0:return this.loggerProvider=new oH(n.loggerProvider||new eW),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new ah({sessionId:n.sessionId,deviceId:n.deviceId}),c=this,[4,(0,ec.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ec.__generator)(this,function(r){return e=new o1(t,n),[2,new st(new th(t,e.loggerProvider,e.serverZone,n.configServerUrl),e)]})})];case 1:return c.joinedConfigGenerator=S.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:h=(d=S.sent()).joinedConfig,f=d.localConfig,p=d.remoteConfig,this.config=h,this.setMetadata(n.sessionId,h,f,p,null==(r=n.version)?void 0:r.version,sB,null==(i=n.version)?void 0:i.type),n.sessionId&&(null==(o=this.config.interactionConfig)?void 0:o.enabled)&&(g=ad.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[g.send(this.getDeviceId.bind(this)).bind(g)],this.scrollHook=g.hook.bind(g)),m=[],"idb"!==(v=this.config.storeType)||(null==(s=(0,eI.getGlobalScope)())?void 0:s.indexedDB)||(v="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(v," for event storage.")),S.label=3;case 3:return S.trys.push([3,5,,6]),[4,sX({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:v})];case 4:return y=S.sent(),m.push({name:"replay",manager:y}),[3,6];case 5:return b=S.sent(),this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(b.toString())),[3,6];case 6:if(!(null==(a=this.config.interactionConfig)?void 0:a.enabled))return[3,10];x=this.config.interactionConfig.batch?al:aa,S.label=7;case 7:return S.trys.push([7,9,,10]),[4,sX({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!=(l=this.config.interactionConfig.trackEveryNms)?l:3e4,maxInterval:6e4,payloadBatcher:x,storeType:v})];case 8:return w=S.sent(),m.push({name:"interaction",manager:w}),[3,10];case 9:return b=S.sent(),this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(b.toString())),[3,10];case 10:if(this.eventsManager=new(sY.bind.apply(sY,(0,ec.__spreadArray)([void 0],(0,ec.__read)(m),!1))),this.eventCompressor&&this.eventCompressor.terminate(),_=void 0,k=(0,eI.getGlobalScope)(),!((null==(u=this.config.experimental)?void 0:u.useWebWorker)&&k&&k.Worker))return[3,12];return[4,e.A(686224)];case 11:_=S.sent().compressionScript,S.label=12;case 12:return this.eventCompressor=new sN(this.eventsManager,this.config,this.getDeviceId(),_),[4,this.initializeNetworkObservers()];case 13:return S.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:n.userProperties},!0)];case 14:return S.sent(),[2]}})})},t.prototype.setSessionId=function(e,t){return ez(this.asyncSetSessionId(e,t))},t.prototype.asyncSetSessionId=function(e,t,n){var r;return(0,ec.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,ec.__generator)(this,function(a){switch(a.label){case 0:if(this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),o=t||this.getDeviceId(),this.identifiers=new ah({sessionId:e,deviceId:o}),!(this.joinedConfigGenerator&&i))return[3,2];return[4,this.joinedConfigGenerator.generateJoinedConfig()];case 1:s=a.sent().joinedConfig,this.config=s,a.label=2;case 2:if(!(null==(r=this.config)?void 0:r.targetingConfig))return[3,4];return[4,this.evaluateTargetingAndCapture({userProperties:null==n?void 0:n.userProperties},!1,!0)];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},t.prototype.getSessionReplayProperties=function(){var e,t=this.config,n=this.identifiers;if(!t||!n)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var r=this.getShouldRecord(),i={};return r&&((e={})[oN]=n.sessionReplayId?n.sessionReplayId:null,i=e,t.debugMode&&(i[oz]=JSON.stringify({appHash:tx(t.apiKey).toString()}))),this.addCustomRRWebEvent(ee.GET_SR_PROPS,{shouldRecord:r,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},t.prototype.sendEvents=function(e){var t,n=e||(null==(t=this.identifiers)?void 0:t.sessionId),r=this.getDeviceId();this.eventsManager&&n&&r&&this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:r})},t.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),(0,ec.__awaiter)(this,void 0,void 0,function(){var n;return(0,ec.__generator)(this,function(r){return(null==(t=this.identifiers)?void 0:t.sessionId)?(n=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:n}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},t.prototype.shouldOptOut=function(){if(null==(e=this.config)?void 0:e.instanceName){var e,t,n;n=ti(this.config.instanceName).identityStore.getIdentity().optOut}return void 0!==n?n:null==(t=this.config)?void 0:t.optOut},t.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,n=!1,r="",i=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(r="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(r),n=!0,i=!0):(r="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(r),n=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,31*Math.abs(tx(e.toString()))%1e6/1e6<t)?(n=!0,i=!0):(r="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(r),n=!1,i=!1),this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(ee.TARGETING_DECISION,{message:r,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},t.prototype.getBlockSelectors=function(){var e,t,n,r=null!=(n=null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.blockSelector)?n:[];if(0!==r.length)return r},t.prototype.getMaskTextSelectors=function(){if((null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.defaultMaskLevel)==="conservative")return"*";var e,t,n,r,i=null==(r=null==(n=this.config)?void 0:n.privacyConfig)?void 0:r.maskSelector;if(i)return i},t.prototype.getRecordingPlugins=function(t){var n,r,i,o,s,a;return(0,ec.__awaiter)(this,void 0,void 0,function(){var l,u,c,d;return(0,ec.__generator)(this,function(h){switch(h.label){case 0:l=[];try{u=ag({ugcFilterRules:(null==(r=null==(n=this.config)?void 0:n.interactionConfig)?void 0:r.ugcFilterRules)||[],enablePolling:(null==(i=this.config)?void 0:i.enableUrlChangePolling)||!1,pollingInterval:null==(o=this.config)?void 0:o.urlChangePollingInterval,captureDocumentTitle:null==(s=this.config)?void 0:s.captureDocumentTitle}),l.push(u)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null==(a=null==t?void 0:t.console)?void 0:a.enabled))return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e.A(525120)];case 2:return c=h.sent().getRecordConsolePlugin,l.push(c({level:t.console.levels})),[3,4];case 3:return d=h.sent(),this.loggerProvider.warn("Failed to load console plugin:",d),[3,4];case 4:return[2,l.length>0?l:void 0]}})})},t.prototype.getRecordFunction=function(){return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,ec.__generator)(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.A(197107)];case 2:return t=r.sent().record,this.recordFunction=t,[2,t];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},t.prototype.recordEvents=function(e){var t,n,r,i,o;return void 0===e&&(e=!0),(0,ec.__awaiter)(this,void 0,void 0,function(){var s,a,l,u,c,d,h,f,p,g,m,v,y,b=this;return(0,ec.__generator)(this,function(x){switch(x.label){case 0:if(s=this.config,a=this.getShouldRecord(),l=null==(t=this.identifiers)?void 0:t.sessionId,!a||!l||!s)return[2];return this.stopRecordingEvents(),[4,this.getRecordFunction()];case 1:if(!(u=x.sent()))return[2];return[4,this.initializeNetworkObservers()];case 2:x.sent(),null==(n=this.networkObservers)||n.start(function(e){b.addCustomRRWebEvent(ee.FETCH_REQUEST,e)}),c=s.privacyConfig,d=s.interactionConfig,h=s.loggingConfig,f=(null==d?void 0:d.enabled)?{mouseInteraction:this.eventsManager&&au(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:l,deviceIdFn:this.getDeviceId.bind(this),mirror:u.mirror,ugcFilterRules:null!=(r=d.ugcFilterRules)?r:[]}),scroll:this.scrollHook}:{},p=(null==d?void 0:d.enabled)&&d.ugcFilterRules?d.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(l,".")),x.label=3;case 3:return x.trys.push([3,5,,6]),g=this,m=u,y={emit:function(e){if(b.shouldOptOut()){b.loggerProvider.log("Opting session ".concat(l," out of recording due to optOut config.")),b.stopRecordingEvents(),b.sendEvents();return}e.type===o2.Meta&&(e.data.href=oY(e.data.href,p)),b.eventCompressor&&b.eventCompressor.enqueueEvent(e,l)},inlineStylesheet:s.shouldInlineStylesheet,hooks:f,maskAllInputs:!0,maskTextClass:oV,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:s.applyBackgroundColorToBlockedElements,maskInputFn:oq("input",c),maskTextFn:oq("text",c),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null==(i=s.omitElementTags)?void 0:i.script,comment:null==(o=s.omitElementTags)?void 0:o.comment},errorHandler:function(e){if(e.message.includes("insertRule")&&e.message.includes("CSSStyleSheet")||e._external_)throw e;return b.loggerProvider.warn("Error while capturing replay: ",e.toString()),!0}},[4,this.getRecordingPlugins(h)];case 4:return g.recordCancelCallback=m.apply(void 0,[(y.plugins=x.sent(),y)]),this.addCustomRRWebEvent(ee.DEBUG_INFO),e&&this.addCustomRRWebEvent(ee.METADATA,this.metadata),[3,6];case 5:return v=x.sent(),this.loggerProvider.warn("Failed to initialize session replay:",v),[3,6];case 6:return[2]}})})},t.prototype.getDeviceId=function(){var e;return null==(e=this.identifiers)?void 0:e.deviceId},t.prototype.getSessionId=function(){var e;return null==(e=this.identifiers)?void 0:e.sessionId},t.prototype.flush=function(e){var t;return void 0===e&&(e=!1),(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return[2,null==(t=this.eventsManager)?void 0:t.flush(e)]})})},t.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},t.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},t.prototype.setMetadata=function(e,t,n,r,i,o,s){var a=(null==e?void 0:e.toString())?tx(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:n,remoteConfig:r,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},t.prototype.initializeNetworkObservers=function(){var t,n,r;return(0,ec.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:if(!((null==(r=null==(n=null==(t=this.config)?void 0:t.loggingConfig)?void 0:n.network)?void 0:r.enabled)&&!this.networkObservers))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.A(33542)];case 2:return i=s.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return o=s.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",o),[3,4];case 4:return[2]}})})},t}(),av=function(e){return function(){var t=e.config||o0();return{logger:t.loggerProvider,logLevel:t.logLevel}}};let ay={init:e0((O=new am).init.bind(O),"init",av(O)),evaluateTargetingAndCapture:e0(O.evaluateTargetingAndCapture.bind(O),"evaluateTargetingAndRecord",av(O)),setSessionId:e0(O.setSessionId.bind(O),"setSessionId",av(O)),getSessionId:e0(O.getSessionId.bind(O),"getSessionId",av(O)),getSessionReplayProperties:e0(O.getSessionReplayProperties.bind(O),"getSessionReplayProperties",av(O)),flush:e0(O.flush.bind(O),"flush",av(O)),shutdown:e0(O.shutdown.bind(O),"shutdown",av(O))};var ab=ay.init,ax=ay.setSessionId,aw=ay.getSessionId,a_=ay.getSessionReplayProperties,ak=ay.flush,aS=ay.shutdown,aC=ay.evaluateTargetingAndCapture;(E=eo||(eo={})).SET="$set",E.SET_ONCE="$setOnce",E.ADD="$add",E.APPEND="$append",E.PREPEND="$prepend",E.REMOVE="$remove",E.PREINSERT="$preInsert",E.POSTINSERT="$postInsert",E.UNSET="$unset",E.CLEAR_ALL="$clearAll",(M=es||(es={})).REVENUE_PRODUCT_ID="$productId",M.REVENUE_QUANTITY="$quantity",M.REVENUE_PRICE="$price",M.REVENUE_TYPE="$revenueType",M.REVENUE_CURRENCY="$currency",M.REVENUE="$revenue",(A=ea||(ea={})).IDENTIFY="$identify",A.GROUP_IDENTIFY="$groupidentify",A.REVENUE="revenue_amount";var aO=[eo.SET,eo.SET_ONCE,eo.ADD,eo.APPEND,eo.PREPEND,eo.POSTINSERT],aE=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(n){if(aO.includes(n)){var r=e.user_properties&&e.user_properties[n];t=(0,ec.__assign)((0,ec.__assign)({},t),r)}}),t}},aM="1.23.1",aA=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:ak,getSessionId:aw,getSessionReplayProperties:a_,init:ab,setSessionId:ax,shutdown:aS,evaluateTargetingAndCapture:aC},this.options=(0,ec.__assign)({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var n,r,i,o,s,a;return(0,ec.__awaiter)(this,void 0,void 0,function(){var t,l;return(0,ec.__generator)(this,function(u){switch(u.label){case 0:var c;return u.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(aM,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=(0,ec.__assign)((0,ec.__assign)({},e.defaultTracking),{sessions:!0})),t=(void 0===(c=this.config.instanceName)&&(c="$default_instance"),tr.getInstance(c)).identityStore.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!=(n=this.options.deviceId)?n:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null==(r=this.config.remoteConfig)?void 0:r.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null==(i=this.options.privacyConfig)?void 0:i.blockSelector,maskSelector:null==(o=this.options.privacyConfig)?void 0:o.maskSelector,unmaskSelector:null==(s=this.options.privacyConfig)?void 0:s.unmaskSelector,defaultMaskLevel:null==(a=this.options.privacyConfig)?void 0:a.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:aM},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,userProperties:t,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return u.sent(),[3,3];case 2:return l=u.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(l.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return t.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){switch(t.label){case 0:if(this.config.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),!e)return[3,1];return this.sessionReplay.shutdown(),[3,3];case 1:return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.execute=function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){var n,r,i,o;return(0,ec.__generator)(this,function(s){switch(s.label){case 0:if(s.trys.push([0,9,,10]),!this.options.customSessionId)return[3,4];if(!(n=this.options.customSessionId(e)))return[3,3];if(n===this.sessionReplay.getSessionId())return[3,2];return[4,this.sessionReplay.setSessionId(n).promise];case 1:s.sent(),s.label=2;case 2:r=this.sessionReplay.getSessionReplayProperties(),e.event_properties=(0,ec.__assign)((0,ec.__assign)({},e.event_properties),r),s.label=3;case 3:return[3,8];case 4:if(!((n=this.config.sessionId)&&n!==this.sessionReplay.getSessionId()))return[3,6];return[4,this.sessionReplay.setSessionId(n).promise];case 5:s.sent(),s.label=6;case 6:if(!(n&&n===e.session_id))return[3,8];return i=void 0,e.event_type===W.IDENTIFY&&(i=aE(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:i})];case 7:s.sent(),r=this.sessionReplay.getSessionReplayProperties(),e.event_properties=(0,ec.__assign)((0,ec.__assign)({},e.event_properties),r),s.label=8;case 8:return[2,Promise.resolve(e)];case 9:return o=s.sent(),null==(t=this.config)||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(o.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null==(e=this.config)||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),aP=e.i(415306),aT=function(e,t){return(aT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function aR(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}aT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var aI=function(){return(aI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function aD(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}function aL(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){var u=[a,l];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function aj(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function aN(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function aF(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var aB="is not",az="contains",aV="does not contain",aH="less",a$="less or equal",aW="greater",aU="greater or equal",aq="version less",aQ="version less or equal",aK="version greater",aG="version greater or equal",aX="set is",aY="set is not",aZ="set contains",aJ="set does not contain",a0="set contains any",a1="set does not contain any",a2=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:((64512&i)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128):t[n++]=i>>12|224,t[n++]=i>>6&63|128),t[n++]=63&i|128)}return Uint8Array.from(t)},a5=function(e,t){void 0===t&&(t=0);for(var n=a2(e),r=n.length,i=r>>2,o=t,s=0;s<i;s++)o=a3(a6(n,s<<2),o);var a=i<<2,l=0;switch(r-a){case 3:l^=n[a+2]<<16,l^=n[a+1]<<8,l^=n[a],o^=l=Math.imul(l=a8(l=Math.imul(l,-0x3361d2af),15),0x1b873593);break;case 2:l^=n[a+1]<<8,l^=n[a],o^=l=Math.imul(l=a8(l=Math.imul(l,-0x3361d2af),15),0x1b873593);break;case 1:l^=n[a],o^=l=Math.imul(l=a8(l=Math.imul(l,-0x3361d2af),15),0x1b873593)}return a4(o^=r)>>>0},a3=function(e,t){var n=e,r=t;return r^=n=Math.imul(n=a8(n=Math.imul(n,-0x3361d2af),15),0x1b873593),(r=Math.imul(r=a8(r,13),5))+-0x19ab949c|0},a4=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-0x7a143595),t^=t>>>13,t=Math.imul(t,-0x3d4d51cb),t^=t>>>16},a8=function(e,t,n){void 0===n&&(n=32),t>n&&(t%=n);var r=(e&0xffffffff<<n-t>>>0)>>>0>>>n-t>>>0;return(e<<t|r)>>>0},a6=function(e,t){return void 0===t&&(t=0),a7(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},a7=function(e){return(-0x1000000&e)>>>24|(0xff0000&e)>>>8|(65280&e)<<8|(255&e)<<24},a9=function(e,t){var n,r;if(t&&0!==t.length){try{for(var i=aj(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}if(null==e)return;return e}},le="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),lt=function(){function e(e,t,n,r){void 0===r&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(le).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!(isNaN(r)||isNaN(i)))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){if(this.major>e.major)return 1;if(this.major<e.major)return -1;if(this.minor>e.minor)return 1;if(this.minor<e.minor)return -1;if(this.patch>e.patch)return 1;if(this.patch<e.patch||this.preRelease&&!e.preRelease)return -1;if(!this.preRelease&&e.preRelease)return 1;if(this.preRelease&&e.preRelease){if(this.preRelease>e.preRelease)return 1;if(this.preRelease<e.preRelease)return -1}return 0},e}(),ln=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},o={context:e,result:i};try{for(var s=aj(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlag=function(e,t){try{for(var n,r,i,o=aj(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=aI(aI(aI({},t.metadata),a.metadata),i.metadata);i=aI(aI({},i),{metadata:l});break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateSegment=function(e,t,n){if(!n.conditions){var r=this.bucket(e,n);return void 0!==r?t.variants[r]:void 0}if(this.evaluateConditions(e,n.conditions)){var r=this.bucket(e,n);if(void 0!==r)return t.variants[r]}},e.prototype.evaluateConditions=function(e,t){var n,r,i,o;try{for(var s=aj(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,aj(l)),d=c.next();!d.done;d=c.next()){var h=d.value;if(!(u=this.matchCondition(e,h)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.matchCondition=function(e,t){var n=a9(e,t.selector);if(null==n)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var r=this.coerceStringArray(n);return!!r&&this.matchSet(r,t.op,t.values)}var i=this.coerceString(n);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return a5(e)},e.prototype.bucket=function(e,t){if(!t.bucket)return t.variant;var n,r,i,o,s=this.coerceString(a9(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var d=aj(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var f=h.value,p=f.range[0],g=f.range[1];if(u>=p&&u<g)try{for(var m=(i=void 0,aj(f.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,b=y.range[0],x=y.range[1];if(c>=b&&c<x)return y.variant}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case"is":case az:case aH:case a$:case aW:case aU:case aq:case aQ:case aK:case aG:case aX:case aZ:case a0:return n;case aB:case aV:case aJ:case a1:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case aX:return this.setEquals(e,n);case aY:return!this.setEquals(e,n);case aZ:return this.matchesSetContainsAll(e,n);case aJ:return!this.matchesSetContainsAll(e,n);case a0:return this.matchesSetContainsAny(e,n);case a1:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case"is":return this.matchesIs(e,n);case aB:return!this.matchesIs(e,n);case az:return this.matchesContains(e,n);case aV:return!this.matchesContains(e,n);case aH:case a$:case aW:case aU:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case aq:case aQ:case aK:case aG:return this.matchesComparable(e,t,n,function(e){return lt.parse(e)},this.versionComparator);case"regex match":return this.matchesRegex(e,n);case"regex does not match":return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if("true"===n||"false"===n)return t.some(function(e){return e.toLowerCase()===n})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=aj(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var o=this,s=r(e),a=n.map(function(e){return r(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?n.some(function(n){return o.comparator(e,t,n)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,n){switch(t){case aH:case aq:return e<n;case a$:case aQ:return e<=n;case aW:case aK:return e>n;case aU:case aG:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case aH:case aq:return r<0;case a$:case aQ:return r<=0;case aW:case aK:return r>0;case aU:case aG:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return!!new RegExp(t).exec(e)})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!=(t=Number(e))?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e)){var n=e;return n.map(function(e){return t.coerceString(e)}).filter(Boolean)}var r=String(e);try{var i=JSON.parse(r);if(Array.isArray(i)){var n=e;return n.map(function(e){return t.coerceString(e)}).filter(Boolean)}var o=this.coerceString(r);return o?[o]:void 0}catch(e){var o=this.coerceString(r);return o?[o]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case aX:case aY:case aZ:case aJ:case a0:case a1:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&aF([],aN(r),!1).every(function(e){return n.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=aj(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=aj(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),lr=function(e,t){var n,r,i=aI({},e),o=[],s=t||Object.keys(i);try{for(var a=aj(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=li(u,i);c&&o.push.apply(o,aF([],aN(c),!1))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},li=function(e,t,n){void 0===n&&(n=[]);var r,i,o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];n.push(o.key);var s=[],a=function(e){if(n.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(n));var r=li(e,t,n);r&&s.push.apply(s,aF([],aN(r),!1))};try{for(var l=aj(o.dependencies),u=l.next();!u.done;u=l.next()){var c=u.value;a(c)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s.push(o),n.pop(),delete t[o.key],s}};let lo="function"==typeof aP.Buffer,ls="function"==typeof TextDecoder?new TextDecoder:void 0,la="function"==typeof TextEncoder?new TextEncoder:void 0,ll=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),lu=(n={},ll.forEach((e,t)=>n[e]=t),n),lc=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ld=String.fromCharCode.bind(String),lh="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),lf=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),lp="function"==typeof btoa?e=>btoa(e):lo?e=>aP.Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,i,o="",s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw TypeError("invalid character found");o+=ll[(t=n<<16|r<<8|i)>>18&63]+ll[t>>12&63]+ll[t>>6&63]+ll[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},lg=lo?e=>aP.Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(ld.apply(null,e.subarray(n,n+4096)));return lp(t.join(""))},lm=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?ld(192|t>>>6)+ld(128|63&t):ld(224|t>>>12&15)+ld(128|t>>>6&63)+ld(128|63&t)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return ld(240|t>>>18&7)+ld(128|t>>>12&63)+ld(128|t>>>6&63)+ld(128|63&t)},lv=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ly=lo?e=>aP.Buffer.from(e,"utf8").toString("base64"):la?e=>lg(la.encode(e)):e=>lp(e.replace(lv,lm)),lb=(e,t=!1)=>t?lf(ly(e)):ly(e),lx=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,lw=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return ld((t>>>10)+55296)+ld((1023&t)+56320);case 3:return ld((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return ld((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},l_="function"==typeof atob?e=>atob(e.replace(/[^A-Za-z0-9\+\/]/g,"")):lo?e=>aP.Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!lc.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n="",r,i;for(let o=0;o<e.length;)t=lu[e.charAt(o++)]<<18|lu[e.charAt(o++)]<<12|(r=lu[e.charAt(o++)])<<6|(i=lu[e.charAt(o++)]),n+=64===r?ld(t>>16&255):64===i?ld(t>>16&255,t>>8&255):ld(t>>16&255,t>>8&255,255&t);return n},lk=lo?e=>lh(aP.Buffer.from(e,"base64")):e=>lh(l_(e).split("").map(e=>e.charCodeAt(0))),lS=lo?e=>aP.Buffer.from(e,"base64").toString("utf8"):ls?e=>ls.decode(lk(e)):e=>l_(e).replace(lx,lw);var lC=function(e){function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return aR(t,e),t}(Error),lO=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return aR(t,e),t}(Error),lE=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return aD(this,void 0,void 0,function(){var n,r,i,o;return aL(this,function(s){switch(s.label){case 0:return n=lb(JSON.stringify(e),!0),r={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==t?void 0:t.flagKeys)&&(r["X-Amp-Exp-Flag-Keys"]=lb(JSON.stringify(t.flagKeys),!0)),(null==t?void 0:t.trackingOption)&&(r["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:r,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new lC(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),lM=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return aD(this,void 0,void 0,function(){var t,n;return aL(this,function(r){switch(r.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=lb(JSON.stringify(e.user),!0)),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(n=r.sent()).status)throw Error("Flags error response: status=".concat(n.status));return[2,JSON.parse(n.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),lA="undefined"!=typeof globalThis?globalThis:e.g||self,lP=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e.g},lT=function(){var e=lP();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){}return!1},lR=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=lA.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(lA.clearInterval(this.poller),this.poller=void 0)},e}(),lI=e.i(484404);function lD(e){this.amplitudeInstance=e}function lL(e){this.amplitudeInstance=e}lD.prototype.getUser=function(){var e,t,n,r,i,o,s,a,l,u;return{device_id:null==(t=null==(e=this.amplitudeInstance)?void 0:e.options)?void 0:t.deviceId,user_id:null==(r=null==(n=this.amplitudeInstance)?void 0:n.options)?void 0:r.userId,version:null==(o=null==(i=this.amplitudeInstance)?void 0:i.options)?void 0:o.versionName,language:null==(a=null==(s=this.amplitudeInstance)?void 0:s.options)?void 0:a.language,platform:null==(u=null==(l=this.amplitudeInstance)?void 0:l.options)?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},lD.prototype.getOs=function(){var e,t,n,r,i,o;return[null==(n=null==(t=null==(e=this.amplitudeInstance)?void 0:e._ua)?void 0:t.browser)?void 0:n.name,null==(o=null==(i=null==(r=this.amplitudeInstance)?void 0:r._ua)?void 0:i.browser)?void 0:o.major].filter(function(e){return null!=e}).join(" ")},lD.prototype.getDeviceModel=function(){var e,t,n;return null==(n=null==(t=null==(e=this.amplitudeInstance)?void 0:e._ua)?void 0:t.os)?void 0:n.name},lL.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},lL.prototype.setUserProperty=function(e){var t,n;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null==(n=e.variant)?void 0:n.value,t))},lL.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:((t={})[e.userProperty]="-",t)})};var lj=function(){return(lj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function lN(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}function lF(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){var u=[a,l];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function lB(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lz(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function lV(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var lH=function(e,t){void 0===t&&(t=!1);var n,r,i=lU(e,t),o=void 0,s=lA.document.cookie.split("; ");try{for(var a=lB(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=lz(u.split("=",2),2),d=c[0],h=c[1];d===i&&(o=decodeURIComponent(h))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(o)try{if(t){var f=atob(o);return JSON.parse(decodeURIComponent(f))}var p=o.split("."),g=void 0;return p.length>=2&&p[1]&&(g=atob(p[1])),{deviceId:p[0],userId:g}}catch(e){return}},l$=function(e){var t=lU(e,!0);try{var n=lA.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}},lW=function(e){var t=lU(e,!0);try{var n=lA.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}},lU=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},lq=function(){function e(e,t,n){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=n,this.loadPersistedState(),n<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return lN(this,void 0,void 0,function(){return lF(this,function(n){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=lH(this.apiKey,!0);return!!(e||(e=lH(this.apiKey,!1))||(e=l$(this.apiKey))||(e=lW(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return lN(this,void 0,void 0,function(){var t,n=this;return lF(this,function(r){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),n.identityStore.removeIdentityListener(t)};n.identityStore.addIdentityListener(t)}),new Promise(function(t,n){lA.setTimeout(n,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}(),lQ=lA.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),s.push([t,n]),a[t]=a[t]?a[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},lK=function(){function e(e){this.client=e}return e.prototype.request=function(e){return lN(this,void 0,void 0,function(){return lF(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),lG={request:function(e,t,n,r,i){var o;return o=lN(void 0,void 0,void 0,function(){var i,o;return lF(this,function(s){switch(s.label){case 0:return[4,lQ(e,{method:t,headers:n,body:r})];case 1:return o={status:(i=s.sent()).status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}})}),null==i||i<=0?o:new Promise(function(e,t){lA.setTimeout(function(){t(new lO("Request timeout after "+i+" milliseconds"))},i),o.then(e,t)})}};(P=el||(el={})).LocalStorage="localStorage",P.InitialVariants="initialVariants",(T=eu||(eu={})).LocalStorage="storage",T.InitialVariants="initial",T.SecondaryLocalStorage="secondary-storage",T.SecondaryInitialVariants="secondary-initial",T.FallbackInline="fallback-inline",T.FallbackConfig="fallback-config",T.LocalEvaluation="local-evaluation";var lX=function(e){return!e||e===eu.FallbackInline||e===eu.FallbackConfig||e===eu.SecondaryInitialVariants},lY={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:el.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:lG},lZ="1.18.0",lJ=function(){function e(e,t){var n,r=this;this.isReady=new Promise(function(e){r.resolve=e}),this.config=e,this.client=t;var i=null!=(n=e.instanceName)?n:lY.instanceName;this.queue=new l1(i),this.cache=new l0(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,n,r,i={eventType:"$exposure",eventProperties:e};return(null==(t=e.metadata)?void 0:t.exposureEvent)?i={eventType:null==(n=e.metadata)?void 0:n.exposureEvent,eventProperties:e}:(null==(r=e.metadata)?void 0:r.deliveryMethod)==="web"&&(i={eventType:"$impression",eventProperties:e}),i},e}(),l0=function(){function e(e){this.isSessionStorageAvailable=l2(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&lA.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){if((null==(t=e.metadata)?void 0:t.deliveryMethod)==="web")return!0;this.loadCache();var t,n=this.inMemoryCache[e.flag_key],r=!1;return n&&n.variant===e.variant||(r=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),r},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=lA.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&lA.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),l1=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=lT(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=lA.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var n=lB(this.inMemoryQueue),r=n.next();!r.done;r=n.next()){var i=r.value;try{if(!this.tracker(i))return}catch(e){return}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(lA.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=lA.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),lA.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),l2=function(){var e=lP();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){}return!1},l5=function(){function e(){this.globalScope=lP()}return e.prototype.get=function(e){var t;return null==(t=this.globalScope)?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var n;null==(n=this.globalScope)||n.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null==(t=this.globalScope)||t.localStorage.removeItem(e)},e}(),l3=function(e,t,n){var r=e.substring(e.length-6);return new l8("amp-exp-".concat(t,"-").concat(r),n,l6)},l4=function(e,t,n){void 0===n&&(n=new l5);var r=e.substring(e.length-6);return new l8("amp-exp-".concat(t,"-").concat(r,"-flags"),n)},l8=function(){function e(e,t,n){this.cache={},this.namespace=e,this.storage=t,this.transformer=n}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return lj({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=lB(Object.keys(e)),i=r.next();!i.done;i=r.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,n,r=this.storage.get(this.namespace);try{n=JSON.parse(r)||{}}catch(e){return}var i={};try{for(var o=lB(Object.keys(n)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(n[a]):n[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),l6=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,n=e.value,r=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:n&&(s.key=n),n&&(s.value=n),i&&(s.metadata=i),r&&(s.payload=r),o&&(s.expKey=o),s}},l7=function(){function e(){this.globalScope=lP()}return e.prototype.get=function(e){var t;return null==(t=this.globalScope)?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var n;null==(n=this.globalScope)||n.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null==(t=this.globalScope)||t.sessionStorage.removeItem(e)},e}(),l9=function(e,t,n,r){var i,o=null==n?void 0:n.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:n,userProperty:s,properties:{key:t,variant:o,source:r},userProperties:((i={})[s]=o,i)}},ue=function(e){return null==e},ut=function(e){return!!ue(e)||e&&0===Object.keys(e).length},un=function(e){if(!e||"object"!=typeof e)return{};var t,n,r={};try{for(var i=lB(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=lz(o.value,2),a=s[0],l=s[1];ue(l)||(r[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},ur=function(e){var t;return(null==(t=null==e?void 0:e.metadata)?void 0:t.evaluationMode)==="local"},ui=function(){function e(e,t,n,r){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=n,this.scalar=r}return e.prototype.start=function(e){return lN(this,void 0,void 0,function(){return lF(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,n){return lN(this,void 0,void 0,function(){var r=this;return lF(this,function(i){return this.done||(this.timeoutHandle=lA.setTimeout(function(){return lN(r,void 0,void 0,function(){var r,i;return lF(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(r=t+1)<this.attempts&&(i=Math.min(n*this.scalar,this.max),this.backoff(e,r,i)),[3,3];case 3:return[2]}})})},n)),[2]})})},e}(),uo=function(e){if(!e)return{};var t,n,r,i,o={user:e},s=lP();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=lB(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var h=d[0],f={group_name:h},p=null==(i=null==(r=e.group_properties)?void 0:r[c])?void 0:i[h];p&&Object.keys(p).length>0&&(f.group_properties=p),a[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o},us=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},ua=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},ul=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),uu=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var n={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,n)||(this.tracked={}),this.identity=n;var r=e.flag_key in this.tracked,i=this.tracked[e.flag_key];r&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),uc=function(){function e(e,t){var n,r,i,o,s,a=this;this.engine=new ln,this.isRunning=!1,this.apiKey=e,t=un(t),this.config=lj(lj(lj({},lY),t),{serverUrl:(null==t?void 0:t.serverUrl)||((null==(n=null==t?void 0:t.serverZone)?void 0:n.toLowerCase())==="eu"?"https://api.lab.eu.amplitude.com":lY.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||((null==(r=null==t?void 0:t.serverZone)?void 0:r.toLowerCase())==="eu"?"https://flag.lab.eu.amplitude.com":lY.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!=(i=t.flagConfigPollingIntervalMillis)?i:lY.flagConfigPollingIntervalMillis});var l=null==(o=this.config)?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new lR(function(){return a.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=l6(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new ul(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new uu(this.config.exposureTrackingProvider)),this.integrationManager=new lJ(this.config,this);var c=new lK(this.config.httpClient||lG);this.flagApi=new lM(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new lE(this.apiKey,this.config.serverUrl,c);var d=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;s=this.isWebExperiment?new l7:new l5,this.variants=l3(this.apiKey,d,s),this.flags=l4(this.apiKey,d,s);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return lN(this,void 0,void 0,function(){var t,n,r;return lF(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:if(i.trys.push([1,6,,7]),t=this.doFlags(),!(null==(r=this.config.fetchOnStart)||r))return[3,3];return[4,Promise.all([this.fetch(e),t])];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(n=i.sent(),this.config.throwOnError)throw n;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return lN(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),lF(this,function(r){switch(r.label){case 0:this.setUser(e||{}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),this.config.throwOnError)throw n;return this.config.debug&&(n instanceof lO?console.debug(n):console.error(n)),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){if(!this.apiKey)return{value:void 0};var n,r,i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null==(n=i.variant)?void 0:n.key)||(null==(r=i.variant)?void 0:r.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e)ur(this.flags.get(t))||delete e[t];return lj(lj(lj({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){if(!this.user)return this.user;if(null==(e=this.user)||!e.user_properties)return lj({},this.user);var e,t=lj({},this.user.user_properties);return lj(lj({},this.user),{user_properties:t})},e.prototype.setUser=function(e){var t;if(!e){this.user=null;return}if(null==(t=this.user)?void 0:t.user_properties){var n=lj({},e.user_properties);this.user=lj(lj({},e),{user_properties:n})}else this.user=lj({},e)},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,n,r=this.addContext(this.user),i=lr(this.flags.getAll(),e),o=uo(r),s=this.engine.evaluate(o,i),a={};try{for(var l=lB(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=ua(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var n={};this.config.source===el.LocalStorage?n=this.localStorageVariantAndSource(e,t):this.config.source===el.InitialVariants&&(n=this.initialVariantsVariantAndSource(e,t));var r=this.flags.get(e);return(ur(r)||!n.variant&&r)&&(n=this.localEvaluationVariantAndSource(e,r,t)),n},e.prototype.localEvaluationVariantAndSource=function(e,t,n){var r,i={},o=this.evaluate([t.key])[e],s=eu.LocalEvaluation,a=null==(r=null==o?void 0:o.metadata)?void 0:r.default;if(!ue(o)&&!a)return{variant:us(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:us(o),source:s,hasDefaultVariant:!0}),!ue(n))return{variant:us(n),source:eu.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ue(l))return{variant:us(l),source:eu.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=us(this.config.fallbackVariant),c={variant:u,source:eu.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return ut(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var n,r={},i=this.variants.get(e),o=null==(n=null==i?void 0:i.metadata)?void 0:n.default;if(!ue(i)&&!o)return{variant:us(i),source:eu.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:us(i),source:eu.LocalStorage,hasDefaultVariant:!0}),!ue(t))return{variant:us(t),source:eu.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=this.config.initialVariants[e];if(!ue(s))return{variant:us(s),source:eu.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var a=us(this.config.fallbackVariant),l={variant:a,source:eu.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ut(a)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!ue(i))return{variant:us(i),source:eu.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null==(n=null==o?void 0:o.metadata)?void 0:n.default;if(!ue(o)&&!s)return{variant:us(o),source:eu.LocalStorage,hasDefaultVariant:!1};if(s&&(r={variant:us(o),source:eu.LocalStorage,hasDefaultVariant:!0}),!ue(t))return{variant:us(t),source:eu.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=us(this.config.fallbackVariant),l={variant:a,source:eu.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ut(a)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return lN(this,void 0,void 0,function(){var i,o;return lF(this,function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(n)),n&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,r)];case 2:return i=s.sent(),[4,this.storeVariants(i,r)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),n&&this.shouldRetryFetch(o)&&this.startRetries(e,r),o;case 5:return[2]}})})},e.prototype.cleanUserPropsForFetch=function(e){var t=lj({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return lN(this,void 0,void 0,function(){var r,i,o,s,a,l,u;return lF(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,lj({timeoutMillis:t},n))];case 2:r=c.sent(),i={};try{for(s=(o=lB(Object.keys(r))).next();!s.done;s=o.next())i[a=s.value]=ua(r[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return lN(this,void 0,void 0,function(){var e,t,n;return lF(this,function(r){switch(r.label){case 0:if(r.trys.push([0,4,,5]),e=void 0,!this.isWebExperiment)return[3,2];return[4,this.addContextOrWait(this.getUser())];case 1:e=r.sent(),r.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:lZ,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=r.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if((n=r.sent())instanceof lO){if(this.config.debug&&console.debug(n),this.config.throwOnError)throw n}else throw n;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return lN(this,void 0,void 0,function(){var n,r,i,o;return lF(this,function(s){for(o in 0===(n=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),r=function(t){n=n.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)r(o);for(o in n)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return lN(this,void 0,void 0,function(){var n=this;return lF(this,function(r){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new ui(8,500,1e4,1.5),this.retriesBackoff.start(function(){return lN(n,void 0,void 0,function(){return lF(this,function(n){switch(n.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return n.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,n=null==(t=this.userProvider)?void 0:t.getUser(),r=this.integrationManager.getUser(),i=lj(lj(lj({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return lj(lj(lj(lj({library:"experiment-js-client/".concat(lZ)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return lN(this,void 0,void 0,function(){return lF(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==el.LocalStorage?this.variants.getAll():this.config.source==el.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==el.LocalStorage?this.config.initialVariants:this.config.source==el.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){if(null==(i=null==(r=null==(n=t.variant)?void 0:n.metadata)?void 0:r.trackExposure)||i){this.legacyExposureInternal(e,t.variant,t.source);var n,r,i,o,s,a,l,u,c,d={flag_key:e},h=lX(t.source);if(!h||t.hasDefaultVariant){(null==(o=t.variant)?void 0:o.expKey)&&(d.experiment_key=null==(s=t.variant)?void 0:s.expKey);var f=null==(a=t.variant)?void 0:a.metadata;if(h||(null==f?void 0:f.default)||((null==(l=t.variant)?void 0:l.key)?d.variant=t.variant.key:(null==(u=t.variant)?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment){var p=lP();if(null==p?void 0:p.location)try{var g=p.location.href;d.metadata.url=g.split("?")[0]||""}catch(e){}}var m=this.addContext(this.getUser());null==(c=this.userSessionExposureTracker)||c.track(d,m),this.integrationManager.track(d)}}},e.prototype.legacyExposureInternal=function(e,t,n){var r,i,o,s,a;if(this.analyticsProvider){var l=l9(this.addContext(this.getUser()),e,t,n);!lX(n)&&(null==t?void 0:t.value)?(null==t?void 0:t.value)&&(null==(s=null==(o=this.analyticsProvider)?void 0:o.setUserProperty)||s.call(o,l),null==(a=this.analyticsProvider)||a.track(l)):null==(i=null==(r=this.analyticsProvider)?void 0:r.unsetUserProperty)||i.call(r,l)}},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.config.debug&&console.debug.apply(console,lV([e],lz(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof lC)||e.statusCode<400||e.statusCode>=500||429===e.statusCode},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),ud=function(){function e(e,t){var n,r,i;this.globalScope=lP(),this.userAgent=void 0!==(null==(n=this.globalScope)?void 0:n.navigator)?null==(r=this.globalScope)?void 0:r.navigator.userAgent:void 0,this.ua=new lI.UAParser(this.userAgent).getResult(),this.localStorage=new l5,this.sessionStorage=new l7,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null==(i=this.apiKey)?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,n,r,i,o=(null==(e=this.userProvider)?void 0:e.getUser())||{};return lj({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!=(n=null==(t=this.ua.device)?void 0:t.type)?n:"desktop",referring_url:null==(i=null==(r=this.globalScope)?void 0:r.document)?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,n;return[null==(t=e.browser)?void 0:t.name,null==(n=e.browser)?void 0:n.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null==(t=e.os)?void 0:t.name},e.prototype.getBrowser=function(e){var t,n=null==(t=e.browser)?void 0:t.name;return(null==n?void 0:n.includes("Chrom"))&&(n="Chrome"),(null==n?void 0:n.includes("Firefox"))&&(n="Firefox"),(null==n?void 0:n.includes("Safari"))&&(n="Safari"),(null==n?void 0:n.includes("Edge"))&&(n="Edge"),(null==n?void 0:n.includes("Opera"))&&(n="Opera"),n},e.prototype.getCookie=function(){var e,t,n,r,i;if(null==(t=null==(e=this.globalScope)?void 0:e.document)?void 0:t.cookie)return Object.fromEntries(null==(i=null==(r=null==(n=this.globalScope)?void 0:n.document)?void 0:r.cookie)?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var n=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return n.landing_url||(n.landing_url=null==(t=null==(e=this.globalScope)?void 0:e.location)?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(n))),n.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){if(this.globalScope){var e,t,n,r={};try{var i=new URL(this.globalScope.location.href);try{for(var o=lB(i.searchParams),s=o.next();!s.done;s=o.next()){var a=lz(s.value,2),l=a[0],u=a[1];r[l]=lV(lV([],lz(null!=(n=r[l])?n:[]),!1),lz(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(r).reduce(function(e,t){var n=lz(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();lA.experimentInstances={};var uh=lA.experimentInstances,uf=function(e){return(null==e?void 0:e.instanceName)||lY.instanceName},up=function(e,t){var n=uf(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)},ug=function(e,t,n){var r=up(e,t),i=uh[r];return i?i:(i=new uc(e,lj(lj({},t),{userProvider:new ud(null==t?void 0:t.userProvider,e)})),n&&i.addPlugin(n()),uh[r]=i,i)};function um(){}um.prototype.getUser=function(){return{}},um.prototype.start=function(e){return lN(this,void 0,void 0,function(){return lF(this,function(e){return[2]})})},um.prototype.stop=function(){},um.prototype.setUser=function(e){},um.prototype.fetch=function(e,t){return lN(this,void 0,void 0,function(){return lF(this,function(e){return[2,this]})})},um.prototype.getUserProvider=function(){return null},um.prototype.setUserProvider=function(e){return this},um.prototype.variant=function(e,t){return lY.fallbackVariant},um.prototype.all=function(){return{}},um.prototype.clear=function(){},um.prototype.exposure=function(e){};var uv=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(t){var n,r;return this.experiment=ug(n=e.apiKey,r=this.config,function(){return new lq(n,tr.getInstance(uf(r)),1e4)}),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),uy=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ub(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ub=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ux=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),uw=function(){return(uw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u_(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function uk(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}var uS=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=u_(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(a&&l){for(var u=0;u<e.length;u++)if(!uS(e[u],t[u]))return!1}else{if(!uS(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){uS(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var uC=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=uw({},this.identity.userProperties),n=uw(uw({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,l=n.userProperties||{};try{for(var u=u_(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=uk(c.value,2),h=d[0],f=d[1];switch(h){case"$set":try{for(var p=(i=void 0,u_(Object.entries(f))),g=p.next();!g.done;g=p.next()){var m=uk(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,u_(Object.keys(f))),x=b.next();!x.done;x=b.next()){var v=x.value;delete l[v]}}catch(e){s={error:e}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return uw({},this.identity)},e.prototype.setIdentity=function(e){var t=uw({},this.identity);this.identity=uw({},e),uS(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),uO="u">typeof globalThis?globalThis:"u">typeof window?window:self,uE=function(){function e(){this.identityStore=new uC,this.eventBridge=new ux,this.applicationContextProvider=new uy}return e.getInstance=function(t){return uO.analyticsConnectorInstances||(uO.analyticsConnectorInstances={}),uO.analyticsConnectorInstances[t]||(uO.analyticsConnectorInstances[t]=new e),uO.analyticsConnectorInstances[t]},e}(),uM=["boot"],uA=((r=uA||{}).Local="https://local.amplitude.com:3010/",r.Staging="https://apps.stag2.amplitude.com/",r.Production="https://app.amplitude.com/",r.ProductionEU="https://app.eu.amplitude.com/",r),uP=((e=>{if("u">typeof window&&window.opener)for(let t of Object.values(uA))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),R=(e,t,n,r)=>(function(e,t,n,r){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",n&&e.setAttribute("nonce",n),t&&e.setAttribute("type",t),r&&(e.onerror=r),document.getElementsByTagName("head")[0].appendChild(e)}})([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,n,r),new Proxy(o={_q:null!=(I=null==(i="u">typeof window?window.engagement:void 0)?void 0:i._q)?I:[],_configuration:{apiKey:null!=(L=null==(D=null==i?void 0:i._configuration)?void 0:D.apiKey)?L:"",serverUrl:null==(j=null==i?void 0:i._configuration)?void 0:j.serverUrl,chatUrl:null==(N=null==i?void 0:i._configuration)?void 0:N.chatUrl,mediaUrl:null==(F=null==i?void 0:i._configuration)?void 0:F.mediaUrl,serverZone:null!=(z=null==(B=null==i?void 0:i._configuration)?void 0:B.serverZone)?z:"US",options:{...null==(V=null==i?void 0:i._configuration)?void 0:V.options}},_sentry:void 0,init(e,t){var n,r,i;let s;if(o._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");if(o._configuration={...o._configuration,...t,apiKey:e,options:{splitting:!0,...o._configuration.options,...null==t?void 0:t.options}},null!=(r=null==(n=o._configuration)?void 0:n.options)&&r.logger&&o._configuration.options.logger.enable(null!=(i=o._configuration.options.logLevel)?i:2),null!=t&&t.cdnUrl)s=o._configuration.options.splitting?`${t.cdnUrl}/engagement-browser/prod/split/index.js`:t.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===o._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";s=o._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let a=null,l=()=>{if(a&&(clearTimeout(a),a=null),o._q&&o._q.length>0)for(console.warn(`Engagement SDK failed to load within ${u}ms. Resolving pending calls gracefully.`);o._q.length>0;){let e=o._q.shift();if(!e)continue;let t=e[0];if(uM.includes(t)&&e[1]instanceof Function&&e[2]instanceof Function){let n=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),n(void 0)}}};R(s,o._configuration.options.splitting?"module":void 0,null==t?void 0:t.nonce,l);let u=1e4;a=setTimeout(()=>{l()},1e4)},plugin(e){let t=o.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(n,r){var i;let o=null!=(i=n.instanceName)?i:"$default_instance",s=uE.getInstance(o).identityStore;t(n.apiKey,{serverZone:n.serverZone,...e,options:{logLevel:n.logLevel,logger:n.loggerProvider,...null==e?void 0:e.options}});let a=[{track:e=>{r.track(e)}}];await window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:r.getUserId(),device_id:r.getDeviceId(),user_properties:e.userProperties,getSessionId:r.getSessionId}},integrations:a}),s.addIdentityListener(e=>{var t,n,i,o;null!=(t=window.engagement)&&t._.user&&null!=(n=window.engagement)&&n._analytics.hasBooted?(null==(o=null==(i=window.engagement)?void 0:i._.user)?void 0:o.user_id)!==e.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:r.getUserId(),device_id:r.getDeviceId(),user_properties:e.userProperties,getSessionId:r.getSessionId}},integrations:a})):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},{get:function(e,t){return t in o?o[t]:"then"!==t?"gs"===t||"rc"===t?new Proxy({},{get:function(e,n){return function(){let e=Array.from(arguments),r=`${t}.${n}`;e.unshift(r),o._q.push(e)}}}):uM.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((n,r)=>{e.unshift(t,n,r),o._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),o._q.push(e)}:void 0}}));let uT={_setDiagnosticsSampleRate:e0((H=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,ec.__extends)(t,e),t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(uv);return 0===e.length?void this.config.loggerProvider.debug("".concat(uv.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(uv.pluginName," are found."))}},t.prototype.initAll=function(t,n){return(0,ec.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,ec.__generator)(this,function(o){switch(o.label){case 0:return r={serverZone:null==n?void 0:n.serverZone,instanceName:null==n?void 0:n.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return(0,ec.__awaiter)(this,void 0,void 0,function(){return(0,ec.__generator)(this,function(n){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-beta.9","-").concat(null!=(t=e.library)?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,t,(0,ec.__assign)((0,ec.__assign)({},null==n?void 0:n.analytics),r)).promise];case 1:return o.sent(),[4,e.prototype.add.call(this,new aA((0,ec.__assign)((0,ec.__assign)({},null==n?void 0:n.sessionReplay),r))).promise];case 2:return o.sent(),[4,e.prototype.add.call(this,new uv((0,ec.__assign)((0,ec.__assign)({},null==n?void 0:n.experiment),r))).promise];case 3:let s;return o.sent(),void 0===(i=this.plugin(aA.pluginName))?this.config.loggerProvider.debug("".concat(aA.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,(s=(0,ec.__assign)((0,ec.__assign)({},null==n?void 0:n.engagement),r),"u">typeof window&&!window.engagement&&(window.engagement=uP),uP.plugin(s))).promise];case 4:return o.sent(),[2]}})})},t.prototype.init=function(t,n,r){return void 0===t&&(t=""),e.prototype.init.call(this,t,n,r)},t}(oL)))._setDiagnosticsSampleRate.bind(H),"_setDiagnosticsSampleRate",eY(H),eJ(H,["config"])),experiment:e0(H.experiment.bind(H),"experiment",eY(H),eJ(H,["config"])),sessionReplay:e0(H.sessionReplay.bind(H),"sessionReplay",eY(H),eJ(H,["config"])),initAll:e0(H.initAll.bind(H),"initAll",eY(H),eJ(H,["config"])),init:e0(H.init.bind(H),"init",eY(H),eJ(H,["config"])),add:e0(H.add.bind(H),"add",eY(H),eJ(H,["config.apiKey","timeline.plugins"])),remove:e0(H.remove.bind(H),"remove",eY(H),eJ(H,["config.apiKey","timeline.plugins"])),track:e0(H.track.bind(H),"track",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),logEvent:e0(H.logEvent.bind(H),"logEvent",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),identify:e0(H.identify.bind(H),"identify",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),groupIdentify:e0(H.groupIdentify.bind(H),"groupIdentify",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),setGroup:e0(H.setGroup.bind(H),"setGroup",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),revenue:e0(H.revenue.bind(H),"revenue",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),flush:e0(H.flush.bind(H),"flush",eY(H),eJ(H,["config.apiKey","timeline.queue.length"])),getUserId:e0(H.getUserId.bind(H),"getUserId",eY(H),eJ(H,["config","config.userId"])),setUserId:e0(H.setUserId.bind(H),"setUserId",eY(H),eJ(H,["config","config.userId"])),getDeviceId:e0(H.getDeviceId.bind(H),"getDeviceId",eY(H),eJ(H,["config","config.deviceId"])),setDeviceId:e0(H.setDeviceId.bind(H),"setDeviceId",eY(H),eJ(H,["config","config.deviceId"])),reset:e0(H.reset.bind(H),"reset",eY(H),eJ(H,["config","config.userId","config.deviceId"])),getSessionId:e0(H.getSessionId.bind(H),"getSessionId",eY(H),eJ(H,["config"])),setSessionId:e0(H.setSessionId.bind(H),"setSessionId",eY(H),eJ(H,["config"])),extendSession:e0(H.extendSession.bind(H),"extendSession",eY(H),eJ(H,["config"])),setOptOut:e0(H.setOptOut.bind(H),"setOptOut",eY(H),eJ(H,["config"])),getOptOut:e0(H.getOptOut.bind(H),"getOptOut",eY(H),eJ(H,["config"])),setTransport:e0(H.setTransport.bind(H),"setTransport",eY(H),eJ(H,["config"])),getIdentity:e0(H.getIdentity.bind(H),"getIdentity",eY(H),eJ(H,["config"]))};uT._setDiagnosticsSampleRate;var uR=uT.initAll,uI=(uT.experiment,uT.sessionReplay,uT.add,uT.extendSession,uT.flush,uT.getDeviceId,uT.getSessionId,uT.getUserId,uT.groupIdentify,uT.identify,uT.logEvent,uT.remove,uT.reset,uT.revenue,uT.setDeviceId,uT.setGroup,uT.setOptOut,uT.setSessionId,uT.setTransport,uT.setUserId,uT.track);function uD(e,t,n){return uL||console.log("[Tracking]",e,t,n),uI(e,t,n)}let uL=!1;function uj(){let e,t=(e=document.cookie.match("(^|;)\\s*recce_user_id\\s*=\\s*([^;]+)"))?e.pop():"",n="b1ea2155354b7e1e41981715f16599f2";if(t&&n)try{uR(n,{analytics:{userId:t,autocapture:!0},sessionReplay:{sampleRate:1}}),uL=!0}catch(e){console.error(e)}uL||console.log("[Tracking] Amplitude not initialized (missing API key or user ID). Events will be logged to console instead.")}function uN(e){uD("[Web] multi_nodes_action",e)}function uF(e){uD("[Web] history_action",e)}function uB(e){uD("[Experiment] preview_change",e)}function uz(e){uD("[Experiment] preview_change",e)}function uV(e){uD("[Experiment] single_environment",e)}function uH(){return!1}function u$(e){uD("[Web] column_level_lineage",e)}function uW(e){uD("[Web] share_state",e)}function uU(e){uD("[Web] state_action",e)}function uq(e){uD("[Click] copy_to_clipboard",e)}function uQ(e){uD("[Web] navigation_change",e)}function uK(e){uD("[Web] lineage_view_render",e)}function uG(e){uD("[Web] environment_config",e)}let uX={ROW_COUNT:"row_count",ROW_COUNT_DIFF:"row_count_diff",PROFILE:"profile",PROFILE_DIFF:"profile_diff",VALUE_DIFF:"value_diff",SCHEMA_DIFF:"schema_diff",LINEAGE_DIFF:"lineage_diff",QUERY:"query",HISTOGRAM_DIFF:"histogram_diff",TOP_K_DIFF:"top_k_diff"};function uY(e){uD("[Web] explore_action",e)}function uZ(e){uD("[Web] explore_action_form",e)}function uJ(e){return Object.values(uX).includes(e)}function u0(e){uD("[Web] lineage_selection",e)}e.s(["EXPLORE_ACTION",0,uX,"EXPLORE_FORM_EVENT",0,{EXECUTE:"execute",CANCEL:"cancel"},"EXPLORE_SOURCE",0,{LINEAGE_VIEW_TOP_BAR:"lineage_view_top_bar",LINEAGE_VIEW_CONTEXT_MENU:"lineage_view_context_menu",NODE_KEBAB_MENU:"node_kebab_menu",NODE_SIDEBAR_SINGLE_ENV:"node_sidebar_single_env",NODE_SIDEBAR_MULTI_ENV:"node_sidebar_multi_env",SCHEMA_ROW_COUNT_BUTTON:"schema_row_count_button",SCHEMA_COLUMN_MENU:"schema_column_menu"},"LINEAGE_SELECTION_ACTION",0,{SELECT_PARENT_NODES:"select_parent_nodes",SELECT_CHILD_NODES:"select_child_nodes",SELECT_ALL_UPSTREAM:"select_all_upstream",SELECT_ALL_DOWNSTREAM:"select_all_downstream"},"getExperimentTrackingBreakingChangeEnabled",()=>uH,"isExploreAction",()=>uJ,"trackColumnLevelLineage",()=>u$,"trackCopyToClipboard",()=>uq,"trackEnvironmentConfig",()=>uG,"trackExploreAction",()=>uY,"trackExploreActionForm",()=>uZ,"trackHistoryAction",()=>uF,"trackInit",()=>uj,"trackLineageSelection",()=>u0,"trackLineageViewRender",()=>uK,"trackMultiNodesAction",()=>uN,"trackNavigation",()=>uQ,"trackPreviewChange",()=>uB,"trackPreviewChangeFeedback",()=>uz,"trackShareState",()=>uW,"trackSingleEnvironment",()=>uV,"trackStateAction",()=>uU],203158)},862754,e=>{"use strict";function t(e){return"query"===e.type}function n(e){return"query_base"===e.type}function r(e){return"query_diff"===e.type}function i(e){return"value_diff"===e.type}function o(e){return"value_diff_detail"===e.type}function s(e){return"profile"===e.type}function a(e){return"profile_diff"===e.type}function l(e){return"row_count"===e.type}function u(e){return"row_count_diff"===e.type}function c(e){return"top_k_diff"===e.type}function d(e){return"histogram_diff"===e.type}e.s(["isHistogramDiffRun",()=>d,"isProfileDiffRun",()=>a,"isProfileRun",()=>s,"isQueryBaseRun",()=>n,"isQueryDiffRun",()=>r,"isQueryRun",()=>t,"isRowCountDiffRun",()=>u,"isRowCountRun",()=>l,"isTopKDiffRun",()=>c,"isValueDiffDetailRun",()=>o,"isValueDiffRun",()=>i])},461566,e=>{"use strict";var t=e.i(705443),n=e.i(203158),r=e.i(862754);async function i(e,r,i){let o=i?.trackProps?{...i.trackProps}:{};return(0,n.getExperimentTrackingBreakingChangeEnabled)()&&(o.breaking_change_analysis=!0),(await t.axiosClient.post("/api/runs",{type:e,params:r,nowait:i?.nowait,track_props:o})).data}async function o(e,n){var i;return null==(i=(await t.axiosClient.get(`/api/runs/${e}/wait`,{params:{timeout:n}})).data).result||(0,r.isQueryRun)(i)&&(i.result.columns=i.result.columns.map(e=>(e.key||(e.key=e.name),e))),i}async function s(e){return await t.axiosClient.post(`/api/runs/${e}/cancel`)}async function a(e,n){return(await t.axiosClient.post(`/api/checks/${e}/run`,{nowait:n?.nowait})).data}async function l(e,n,r){return(await t.axiosClient.post("/api/runs/search",{type:e,params:n,limit:r})).data}async function u(){return(await t.axiosClient.get("/api/runs")).data}async function c(){return(await t.axiosClient.post("/api/runs/aggregate",{})).data}e.s(["aggregateRuns",()=>c,"cancelRun",()=>s,"listRuns",()=>u,"searchRuns",()=>l,"submitRun",()=>i,"submitRunFromCheck",()=>a,"waitRun",()=>o])},916955,286568,e=>{"use strict";var t=e.i(19483),n=e.i(76130),r=e.i(468836),i=e.i(11321),o=e.i(772510),s=e.i(845209),a=e.i(73371),l=e.i(427938),u=e.i(333207),c=e.i(63257),d=e.i(79312),h=e.i(187725),f=e.i(603338),p=e.i(523043),g=e.i(23995),m=e.i(377855),v=e.i(912007),y=e.i(407101),b=e.i(473788),x=e.i(420856),w=e.i(461566),_=e.i(203158),k=e.i(830023),S=e.i(503135);let C=()=>(0,u.useQuery)({queryKey:y.cacheKeys.flag(),queryFn:b.getServerFlag});e.s(["useRecceServerFlag",0,C],286568);let O=(0,h.createContext)({isActionAvailable:()=>!0,isDemoSite:!1});function E({children:e}){let{idleTimeout:E,remainingSeconds:M,isEnabled:A,setDisconnected:P,resetConnection:T}=(0,S.useIdleTimeout)(),R=(0,u.useQuery)({queryKey:y.cacheKeys.lineage(),queryFn:x.getServerInfo}),I=(0,u.useQuery)({queryKey:y.cacheKeys.runsAggregated(),queryFn:w.aggregateRuns}),D=(0,h.useMemo)(()=>{let e=R.data?.lineage;if(e?.base)return(0,p.buildLineageGraph)(e.base,e.current,e.diff)},[R.data]),L=R.error?.message,{state_metadata:j,lineage:N,sqlmesh:F,demo:B,codespace:z,review_mode:V,cloud_mode:H,file_mode:$,filename:W,adapter_type:U,git:q,pull_request:Q,support_tasks:K}=R.data??{demo:!1},G=N?.base.manifest_metadata,X=N?.current.manifest_metadata,{connectionStatus:Y,connect:Z,envStatus:J}=function(){let[e,t]=(0,h.useState)(void 0),n=(0,h.useRef)({ws:void 0,status:"pending",artifactsUpdatedToastId:void 0}),[r,i]=(0,h.useState)("pending"),[o,s]=(0,h.useState)(void 0);(0,h.useEffect)(()=>{n.current.status=r},[r]),(0,h.useEffect)(()=>{n.current.artifactsUpdatedToastId=e},[e]);let a=(0,c.useQueryClient)(),l=(0,h.useCallback)(()=>{a.invalidateQueries({queryKey:y.cacheKeys.lineage()}),a.invalidateQueries({queryKey:y.cacheKeys.checks()}),a.invalidateQueries({queryKey:y.cacheKeys.runs()})},[a]),u=(0,h.useCallback)(()=>{let e=new WebSocket(`${k.PUBLIC_API_URL.replace(/(http)(s)?:\/\//,"ws$2://")}/api/ws`);n.current.ws=e,e.onopen=()=>{e.send("ping")},e.onmessage=e=>{if("pong"===e.data){"disconnected"===n.current.status&&l(),i("connected");return}try{let r=JSON.parse(e.data);if("refresh"===r.command){let{eventType:e,srcPath:i}=r.event,[o,s]=i.split("/").slice(-2),a=d.default.parse(s).name,u=`${o}-${a}-${e}`;null==n.current.artifactsUpdatedToastId&&t(m.toaster.create({id:u,description:`Detected ${o} ${a} ${e}`,type:"info",duration:5e3,closable:!0})),l()}else if("relaunch"===r.command)s("relaunch");else{let{id:e,title:n,description:i,status:o,duration:s}=r.event;t(m.toaster.create({id:e||"broadcast",title:n,description:i,type:o??"info",duration:s??5e3,closable:!0}))}}catch(e){console.error(e)}},e.onerror=e=>{console.error("An error occurred during Handling WebSockets",e)},e.onclose=()=>{i(e=>"connected"===e?"disconnected":e),n.current.ws=void 0}},[l]);return(0,h.useEffect)(()=>{let e=n.current;return u(),()=>{e.ws&&e.ws.close()}},[u]),{connectionStatus:r,connect:u,envStatus:o}}();(0,h.useEffect)(()=>{"disconnected"===Y?P():"connected"===Y&&T()},[Y,P,T]);let{data:ee,isLoading:et}=C(),{featureToggles:en,shareUrl:er}=(0,v.useRecceInstanceContext)(),[ei,eo]=(0,h.useState)(!1),[es,ea]=(0,h.useState)(!1),el=(0,c.useQueryClient)(),eu=(0,h.useCallback)(e=>!K||(K[e]??!0),[K]),ec=!et&&"relaunch"===J&&ee?.single_env_onboarding===!0&&ee.show_relaunch_hint;ec!==es&&(ea(ec),eo(ec)),(0,h.useEffect)(()=>{ec&&ei&&(0,_.trackSingleEnvironment)({action:"target_base_added"})},[ec,ei]);let ed=()=>{eo(!1),(0,b.markRelaunchHintCompleted)(),el.invalidateQueries({queryKey:y.cacheKeys.flag()})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O.Provider,{value:{lineageGraph:D,retchLineageGraph:()=>{I.refetch()},envInfo:{stateMetadata:j,adapterType:U,git:q,pullRequest:Q,dbt:{base:G,current:X},sqlmesh:F},reviewMode:V,cloudMode:H,fileMode:$,fileName:W,isDemoSite:B,isCodespace:z,error:L,supportTasks:K,isActionAvailable:eu,isLoading:R.isLoading,runsAggregated:I.data,refetchRunsAggregated:()=>{I.refetch()}},children:e}),(0,t.jsx)(r.default,{open:"disconnected"===Y,onClose:()=>void 0,children:er&&null!==en.mode?(0,t.jsx)(g.RecceInstanceDisconnectedModalContent,{shareUrl:er,mode:en.mode}):(0,t.jsx)(g.ServerDisconnectedModalContent,{connect:Z,idleSeconds:A&&null!==E&&null!==M&&M<=5?E-Math.max(0,M):void 0})}),ee?.single_env_onboarding&&(0,t.jsxs)(r.default,{open:ei,onClose:ed,children:[(0,t.jsx)(s.default,{children:"Target-base Added"}),(0,t.jsx)(a.default,{"aria-label":"close",onClick:ed,sx:{position:"absolute",right:8,top:8,color:"grey.500"},children:(0,t.jsx)(f.IoClose,{})}),(0,t.jsx)(o.default,{children:(0,t.jsx)(l.default,{children:"Please restart the Recce server."})}),(0,t.jsx)(i.default,{children:(0,t.jsx)(n.default,{color:"iochmara",variant:"contained",onClick:ed,children:"Got it!"})})]})]})}let M=()=>(0,h.useContext)(O);e.s(["LineageGraphContextProvider",()=>E,"useLineageGraphContext",0,M,"useRunsAggregated",0,()=>{let{runsAggregated:e,refetchRunsAggregated:t}=M();return[e,t]}],916955)},659004,(e,t,n)=>{t.exports=e.r(232115)},939338,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(387301),o=e.i(578509),s=e.i(446547),a=e.i(811347),l=e.i(73205),u=e.i(860223),c=e.i(519273),d=e.i(427938),h=e.i(435983),f=e.i(446519);function p(e){return(0,f.default)("MuiLink",e)}let g=(0,h.default)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var m=e.i(511507),v=e.i(896425),y=e.i(19483);let b={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},x=(0,s.styled)(d.default,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`underline${(0,o.default)(n.underline)}`],"button"===n.component&&t.button]}})((0,l.default)(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"!==t.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"===t.color,style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter((0,u.default)()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${g.focusVisible}`]:{outline:"auto"}}}]}))),w=t.forwardRef(function(e,s){let l=(0,c.useDefaultProps)({props:e,name:"MuiLink"}),u=(0,a.useTheme)(),{className:d,color:h="primary",component:f="a",onBlur:g,onFocus:w,TypographyClasses:_,underline:k="always",variant:S="inherit",sx:C,...O}=l,[E,M]=t.useState(!1),A={...l,color:h,component:f,focusVisible:E,underline:k,variant:S},P=(e=>{let{classes:t,component:n,focusVisible:i,underline:s}=e,a={root:["root",`underline${(0,o.default)(s)}`,"button"===n&&"button",i&&"focusVisible"]};return(0,r.default)(a,p,t)})(A);return(0,y.jsx)(x,{color:h,className:(0,n.default)(P.root,d),classes:_,component:f,onBlur:e=>{(0,i.default)(e.target)||M(!1),g&&g(e)},onFocus:e=>{(0,i.default)(e.target)&&M(!0),w&&w(e)},ref:s,ownerState:A,variant:S,...O,sx:[...void 0===b[h]?[{color:h}]:[],...Array.isArray(C)?C:[C]],style:{...O.style,..."always"===k&&"inherit"!==h&&!b[h]&&{"--Link-underlineColor":(({theme:e,ownerState:t})=>{let n=t.color;if("colorSpace"in e&&e.colorSpace){let r=(0,m.getPath)(e,`palette.${n}.main`)||(0,m.getPath)(e,`palette.${n}`)||t.color;return e.alpha(r,.4)}let r=(0,m.getPath)(e,`palette.${n}.main`,!1)||(0,m.getPath)(e,`palette.${n}`,!1)||t.color,i=(0,m.getPath)(e,`palette.${n}.mainChannel`)||(0,m.getPath)(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:(0,v.alpha)(r,.4)})({theme:u,ownerState:A})}}})});e.s(["default",0,w],939338)},734786,790318,e=>{"use strict";function t(e,n=166){let r;function i(...t){let o=()=>{e.apply(this,t)};clearTimeout(r),r=setTimeout(o,n)}return i.clear=()=>{clearTimeout(r)},i}e.s(["default",()=>t],790318),e.s(["default",0,t],734786)},817360,e=>{"use strict";let t=e.i(842426).default;e.s(["default",0,t])},144758,e=>{"use strict";let t=e.i(138419).default;e.s(["default",0,t])},359143,937253,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(427447),o=e.i(446547),s=e.i(519273),a=e.i(734786),l=e.i(817360),u=e.i(144758),c=e.i(401440),d=e.i(687536),h=e.i(966196),f=e.i(435983),p=e.i(446519);function g(e){return(0,p.default)("MuiPopover",e)}(0,f.default)("MuiPopover",["root","paper"]);var m=e.i(577950);function v(e,t){if(!e)return t;function r(e,t){let n={};return Object.keys(t).forEach(r=>{var i;let o;i=t[r],o=r.charCodeAt(2),"o"===r[0]&&"n"===r[1]&&o>=65&&o<=90&&"function"==typeof i&&"function"==typeof e[r]&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if("function"==typeof e||"function"==typeof t)return i=>{let o="function"==typeof t?t(i):t,s="function"==typeof e?e({...i,...o}):e,a=(0,n.default)(i?.className,o?.className,s?.className),l=r(s,o);return{...o,...s,...l,...!!a&&{className:a},...o?.style&&s?.style&&{style:{...o.style,...s.style}},...o?.sx&&s?.sx&&{sx:[...Array.isArray(o.sx)?o.sx:[o.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};let i=r(e,t),o=(0,n.default)(t?.className,e?.className);return{...t,...e,...i,...!!o&&{className:o},...t?.style&&e?.style&&{style:{...t.style,...e.style}},...t?.sx&&e?.sx&&{sx:[...Array.isArray(t.sx)?t.sx:[t.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}e.s(["mergeSlotProps",()=>v],937253);var y=e.i(19483);function b(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function x(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function w(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function _(e){return"function"==typeof e?e():e}let k=(0,o.styled)(d.default,{name:"MuiPopover",slot:"Root"})({}),S=(0,o.styled)(h.default,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),C=t.forwardRef(function(e,o){let d=(0,s.useDefaultProps)({props:e,name:"MuiPopover"}),{action:h,anchorEl:f,anchorOrigin:p={vertical:"top",horizontal:"left"},anchorPosition:C,anchorReference:O="anchorEl",children:E,className:M,container:A,elevation:P=8,marginThreshold:T=16,open:R,PaperProps:I={},slots:D={},slotProps:L={},transformOrigin:j={vertical:"top",horizontal:"left"},TransitionComponent:N,transitionDuration:F="auto",TransitionProps:B={},disableScrollLock:z=!1,...V}=d,H=t.useRef(),$={...d,anchorOrigin:p,anchorReference:O,elevation:P,marginThreshold:T,transformOrigin:j,TransitionComponent:N,transitionDuration:F,TransitionProps:B},W=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"],paper:["paper"]},g,t)})($),U=t.useCallback(()=>{if("anchorPosition"===O)return C;let e=_(f),t=(e&&1===e.nodeType?e:(0,l.default)(H.current).body).getBoundingClientRect();return{top:t.top+b(t,p.vertical),left:t.left+x(t,p.horizontal)}},[f,p.horizontal,p.vertical,C,O]),q=t.useCallback(e=>({vertical:b(e,j.vertical),horizontal:x(e,j.horizontal)}),[j.horizontal,j.vertical]),Q=t.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=q(t);if("none"===O)return{top:null,left:null,transformOrigin:w(n)};let r=U(),i=r.top-n.vertical,o=r.left-n.horizontal,s=i+t.height,a=o+t.width,l=(0,u.default)(_(f)),c=l.innerHeight-T,d=l.innerWidth-T;if(null!==T&&i<T){let e=i-T;i-=e,n.vertical+=e}else if(null!==T&&s>c){let e=s-c;i-=e,n.vertical+=e}if(null!==T&&o<T){let e=o-T;o-=e,n.horizontal+=e}else if(a>d){let e=a-d;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:w(n)}},[f,O,U,q,T]),[K,G]=t.useState(R),X=t.useCallback(()=>{let e=H.current;if(!e)return;let t=Q(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,G(!0)},[Q]);t.useEffect(()=>(z&&window.addEventListener("scroll",X),()=>window.removeEventListener("scroll",X)),[f,z,X]),t.useEffect(()=>{R&&X()}),t.useImperativeHandle(h,()=>R?{updatePosition:()=>{X()}}:null,[R,X]),t.useEffect(()=>{if(!R)return;let e=(0,a.default)(()=>{X()}),t=(0,u.default)(_(f));return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[f,R,X]);let Y=F,Z={slots:{transition:N,...D},slotProps:{transition:B,paper:I,...L}},[J,ee]=(0,m.default)("transition",{elementType:c.default,externalForwardedProps:Z,ownerState:$,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),X()},onExited:t=>{e.onExited?.(t),G(!1)}}),additionalProps:{appear:!0,in:R}});"auto"!==F||J.muiSupportAuto||(Y=void 0);let et=A||(f?(0,l.default)(_(f)).body:void 0),[en,{slots:er,slotProps:ei,...eo}]=(0,m.default)("root",{ref:o,elementType:k,externalForwardedProps:{...Z,...V},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:D.backdrop},slotProps:{backdrop:v("function"==typeof L.backdrop?L.backdrop($):L.backdrop,{invisible:!0})},container:et,open:R},ownerState:$,className:(0,n.default)(W.root,M)}),[es,ea]=(0,m.default)("paper",{ref:H,className:W.paper,elementType:S,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:{elevation:P,style:K?void 0:{opacity:0}},ownerState:$});return(0,y.jsx)(en,{...eo,...!(0,i.default)(en)&&{slots:er,slotProps:ei,disableScrollLock:z},children:(0,y.jsx)(J,{...ee,timeout:Y,children:(0,y.jsx)(es,{...ea,children:E})})})});e.s(["PopoverPaper",0,S,"default",0,C],359143)},272064,e=>{"use strict";var t=e.i(19483);e.s(["IconEdit",0,e=>(0,t.jsx)("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,t.jsx)("path",{d:"M15.9143 1.75812L14.7422 0.585938C14.3515 0.195312 13.8397 0 13.3278 0C12.8159 0 12.304 0.195312 11.9137 0.585625L9.58593 2.91344L8.5 3.99938L0.901592 11.5975L0.504719 15.1669C0.454719 15.6163 0.80878 16 1.24847 16C1.27628 16 1.3044 15.9984 1.33253 15.9953L4.89939 15.6012L12.5006 8L13.5862 6.91437L15.914 4.58656C16.6953 3.80531 16.6953 2.53906 15.9143 1.75812ZM4.21095 14.1684L2.09909 14.4016L2.3344 12.2863L9.56062 5.06L10.53 4.09062L12.4094 5.97L11.44 6.93937L4.21095 14.1684ZM14.8534 3.52562L13.4697 4.90938L11.5906 3.03L12.9744 1.64625C13.1019 1.51875 13.2506 1.49969 13.3278 1.49969C13.405 1.49969 13.554 1.51875 13.6812 1.64625L14.8534 2.81844C15.0484 3.01375 15.0484 3.33094 14.8534 3.52562Z",fill:"currentColor"})}),"IconExport",0,e=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("g",{clipPath:"url(#clip0_1479_25102)",children:(0,t.jsx)("path",{d:"M-1.88399 8.72062L0.358816 6.46094C0.594752 6.22344 1.00006 6.39031 1.00006 6.725V8.2525H4.00005V4.12438C4.00005 3.7275 4.16161 3.34313 4.44286 3.06219L7.06441 0.440625C7.34566 0.159375 7.72691 0 8.12347 0H14.5003C15.3281 0.003125 16 0.675 16 1.50281V14.5003C16 15.3281 15.3281 16 14.5003 16H5.50223C4.67411 16 4.00005 15.3281 4.00005 14.5003V11.2522H5.50005V14.5003H14.5003V1.50281H9.50128V4.75219C9.50128 5.16781 9.1669 5.50187 8.75128 5.50187H5.50005V8.25219H10.625C10.8322 8.25219 11 8.42 11 8.62719V9.37719C11 9.58438 10.8322 9.75219 10.625 9.75219H1.00006V11.2797C1.00006 11.6144 0.594752 11.7813 0.358816 11.5438L-1.88399 9.28406C-2.03867 9.12813 -2.03867 8.87656 -1.88399 8.72062ZM8.0016 4.00219V1.62469L5.62379 4.00219H8.0016Z",fill:"currentColor"})}),(0,t.jsx)("g",{clipPath:"url(#clip1_1479_25102)",children:(0,t.jsx)("path",{d:"M0.103056 8.72062L2.09667 6.46094C2.30639 6.22344 2.66667 6.39031 2.66667 6.725V8.2525H5.33333V4.12438C5.33333 3.7275 5.47694 3.34313 5.72694 3.06219L8.05722 0.440625C8.30722 0.159375 8.64611 0 8.99861 0H14.6669C15.4028 0.003125 16 0.675 16 1.50281V14.5003C16 15.3281 15.4028 16 14.6669 16H6.66861C5.9325 16 5.33333 15.3281 5.33333 14.5003V11.2522H6.66667V14.5003H14.6669V1.50281H10.2233V4.75219C10.2233 5.16781 9.92611 5.50187 9.55667 5.50187H6.66667V8.25219H11.2222C11.4064 8.25219 11.5556 8.42 11.5556 8.62719V9.37719C11.5556 9.58438 11.4064 9.75219 11.2222 9.75219H2.66667V11.2797C2.66667 11.6144 2.30639 11.7813 2.09667 11.5438L0.103056 9.28406C-0.0344448 9.12813 -0.0344448 8.87656 0.103056 8.72062ZM8.89028 4.00219V1.62469L6.77666 4.00219H8.89028Z",fill:"currentColor"})}),(0,t.jsxs)("defs",{children:[(0,t.jsx)("clipPath",{id:"clip0_1479_25102",children:(0,t.jsx)("rect",{width:"13",height:"16",fill:"white",transform:"matrix(-1 0 0 1 16 0)"})}),(0,t.jsx)("clipPath",{id:"clip1_1479_25102",children:(0,t.jsx)("rect",{width:"3",height:"16",fill:"white"})})]})]}),"IconImport",0,e=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("g",{clipPath:"url(#clip0_1426_8619)",children:(0,t.jsx)("path",{d:"M15.5572 3.06188L12.9356 0.440625C12.6544 0.159375 12.2731 0 11.8766 0H5.49969C4.67188 0.003125 4 0.675 4 1.50281V8.25219H0.375C0.167812 8.25219 0 8.42 0 8.62719V9.37719C0 9.58438 0.167812 9.75219 0.375 9.75219H9V11.2797C9 11.6144 9.40531 11.7812 9.64125 11.5437L11.8841 9.28406C12.0388 9.12813 12.0388 8.87656 11.8841 8.72062L9.64125 6.46094C9.40531 6.22344 9 6.39031 9 6.725V8.2525H5.49969V1.50281H10.4987V4.75219C10.4987 5.16781 10.8331 5.50187 11.2487 5.50187H14.5V14.5003H5.49969V11.2522H4V14.5003C4 15.3281 4.67188 16 5.49969 16H14.4978C15.3259 16 16 15.3281 16 14.5003V4.12406C16 3.7275 15.8384 3.34313 15.5572 3.06188ZM11.9984 4.00219V1.62469L14.3763 4.00219H11.9984Z",fill:"black"})}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_1426_8619",children:(0,t.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]}),"IconInfo",0,e=>(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,t.jsx)("path",{d:"M7.26326 6.5462H8.71794V12.3642H7.26326V6.5462ZM7.9906 3.1102C7.43278 3.1102 6.97888 3.5641 6.97888 4.12192C6.97888 4.67974 7.43278 5.13364 7.9906 5.13364C8.54842 5.13364 9.00232 4.67974 9.00232 4.12192C9.00232 3.5641 8.54842 3.1102 7.9906 3.1102ZM16 8C16 12.411 12.411 16 8 16C3.589 16 0 12.411 0 8C0 3.589 3.589 0 8 0C12.411 0 16 3.589 16 8ZM14.5453 8C14.5453 4.3906 11.6093 1.4546 7.99992 1.4546C4.39052 1.4546 1.45452 4.3914 1.45452 8.0006C1.45452 11.6098 4.39052 14.546 7.99992 14.546C11.6093 14.546 14.5453 11.6092 14.5453 8.0006V8Z",fill:"currentColor"})}),"IconSave",0,e=>(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,t.jsx)("path",{d:"M14.5607 4.06066L11.9393 1.43934C11.658 1.15804 11.2765 1 10.8787 1H2.5C1.67156 1 1 1.67156 1 2.5V13.5C1 14.3284 1.67156 15 2.5 15H13.5C14.3284 15 15 14.3284 15 13.5V5.12131C15 4.72349 14.842 4.34196 14.5607 4.06066ZM9.5 2.5V5H5.5V2.5H9.5ZM13.3125 13.5H2.6875C2.63777 13.5 2.59008 13.4802 2.55492 13.4451C2.51975 13.4099 2.5 13.3622 2.5 13.3125V2.6875C2.5 2.63777 2.51975 2.59008 2.55492 2.55492C2.59008 2.51975 2.63777 2.5 2.6875 2.5H4V5.75C4 6.16422 4.33578 6.5 4.75 6.5H10.25C10.6642 6.5 11 6.16422 11 5.75V2.62131L13.4451 5.06641C13.4625 5.08382 13.4763 5.10449 13.4857 5.12724C13.4952 5.14999 13.5 5.17438 13.5 5.199V13.3125C13.5 13.3622 13.4802 13.4099 13.4451 13.4451C13.4099 13.4802 13.3622 13.5 13.3125 13.5ZM8 7.25C6.48366 7.25 5.25 8.48366 5.25 10C5.25 11.5163 6.48366 12.75 8 12.75C9.51634 12.75 10.75 11.5163 10.75 10C10.75 8.48366 9.51634 7.25 8 7.25ZM8 11.25C7.31075 11.25 6.75 10.6892 6.75 10C6.75 9.31075 7.31075 8.75 8 8.75C8.68925 8.75 9.25 9.31075 9.25 10C9.25 10.6892 8.68925 11.25 8 11.25Z",fill:"currentColor"})}),"IconSync",0,e=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("g",{clipPath:"url(#clip0_1479_25070)",children:(0,t.jsx)("path",{d:"M15.625 0.25H14.759C14.5484 0.25 14.3791 0.423375 14.3841 0.633937L14.4575 3.71441C13.0691 1.62634 10.6955 0.25 8 0.25C4.21291 0.25 1.06041 2.96638 0.38425 6.557C0.340875 6.78728 0.518875 7 0.753219 7H1.64622C1.82353 7 1.97566 6.87556 2.013 6.70222C2.60753 3.9415 5.05991 1.875 8 1.875C10.4858 1.875 12.6232 3.35256 13.5836 5.47819L9.63394 5.38416C9.42341 5.37916 9.25 5.54844 9.25 5.75906V6.625C9.25 6.83209 9.41791 7 9.625 7H15.625C15.8321 7 16 6.83209 16 6.625V0.625C16 0.417906 15.8321 0.25 15.625 0.25ZM15.2468 9H14.3538C14.1765 9 14.0243 9.12444 13.987 9.29778C13.3925 12.0585 10.9401 14.125 8 14.125C5.51419 14.125 3.37681 12.6474 2.41637 10.5218L6.36606 10.6158C6.57659 10.6208 6.75 10.4516 6.75 10.2409V9.375C6.75 9.16791 6.58209 9 6.375 9H0.375C0.167906 9 0 9.16791 0 9.375V15.375C0 15.5821 0.167906 15.75 0.375 15.75H1.24097C1.45156 15.75 1.62088 15.5766 1.61588 15.3661L1.54253 12.2856C2.93087 14.3737 5.3045 15.75 8 15.75C11.7871 15.75 14.9396 13.0336 15.6158 9.443C15.6591 9.21272 15.4811 9 15.2468 9Z",fill:"currentColor"})}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_1479_25070",children:(0,t.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})])},976452,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(76130),i=e.i(468836),o=e.i(11321),s=e.i(772510),a=e.i(845209),l=e.i(73371),u=e.i(939338),c=e.i(359143),d=e.i(336277),h=e.i(427938),f=e.i(187725),p=e.i(603338),g=e.i(272064),m=e.i(203158);e.s(["RunModal",0,({isOpen:e,onClose:v,onExecute:y,type:b,title:x,params:w,RunForm:_})=>{let[k,S]=(0,f.useState)(w??{}),[C,O]=(0,f.useState)(null),[E,M]=(0,f.useState)(!1),A={value_diff:"https://docs.datarecce.io/features/lineage/#value-diff",profile_diff:"https://docs.datarecce.io/features/lineage/#profile-diff",histogram_diff:"https://docs.datarecce.io/features/lineage/#histogram-diff",top_k_diff:"https://docs.datarecce.io/features/lineage/#top-k-diff"}[b]||null,P=(0,f.useRef)(!1),T=()=>{!P.current&&(0,m.isExploreAction)(b)&&(0,m.trackExploreActionForm)({action:b,event:m.EXPLORE_FORM_EVENT.CANCEL}),P.current=!1,v()};return(0,t.jsxs)(i.default,{open:e,onClose:T,maxWidth:"sm",fullWidth:!0,scroll:"paper",slotProps:{paper:{sx:{height:"75%",minHeight:"400px"}}},children:[(0,t.jsxs)(a.default,{sx:{display:"flex",alignItems:"center"},children:[x," ",A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.default,{size:"small","aria-label":"Click this button to learn more about the SQL behind",onMouseEnter:e=>O(e.currentTarget),onMouseLeave:()=>O(null),onClick:()=>window.open(A,"_blank"),children:(0,t.jsx)(n.default,{component:g.IconInfo,sx:{fontSize:"16px"}})}),(0,t.jsx)(c.default,{open:!!C,anchorEl:C,onClose:()=>O(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableRestoreFocus:!0,sx:{pointerEvents:"none"},slotProps:{paper:{sx:{bgcolor:"black",color:"white",p:1}}},children:(0,t.jsxs)(h.default,{sx:{fontSize:"0.875rem"},children:["Click"," ",(0,t.jsx)(u.default,{href:A,target:"_blank",sx:{textDecoration:"underline",color:"white","&:hover":{color:"iochmara.300"}},children:"here"})," ","to learn more about the SQL behind"]})})]})]}),(0,t.jsx)(l.default,{"aria-label":"close",onClick:T,sx:{position:"absolute",right:8,top:8,color:"grey.500"},children:(0,t.jsx)(p.IoClose,{})}),(0,t.jsx)(s.default,{sx:{p:0,overflow:"auto",borderTop:"1px solid lightgray",borderBottom:"1px solid lightgray"},children:(0,t.jsx)(n.default,{sx:{contain:"layout"},children:_&&(0,t.jsx)(_,{params:k,onParamsChanged:S,setIsReadyToExecute:M})})}),(0,t.jsx)(o.default,{children:(0,t.jsx)(d.default,{direction:"row",spacing:"10px",children:(0,t.jsx)(r.default,{disabled:!E,color:"iochmara",variant:"contained",onClick:()=>{P.current=!0,(0,m.isExploreAction)(b)&&(0,m.trackExploreActionForm)({action:b,event:m.EXPLORE_FORM_EVENT.EXECUTE}),y(b,k)},children:"Execute"})})})]})}])},901407,897716,21292,e=>{"use strict";var t=e.i(955343);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 3v16a2 2 0 0 0 2 2h16"},child:[]},{tag:"rect",attr:{x:"7",y:"13",width:"9",height:"4",rx:"1"},child:[]},{tag:"rect",attr:{x:"7",y:"5",width:"12",height:"4",rx:"1"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 3h6v6"},child:[]},{tag:"path",attr:{d:"M10 14 21 3"},child:[]},{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 17h2v.5h-1v1h1v.5h-2v1h3v-4h-3zm1-9h1V4h-2v1h1zm-1 3h1.8L18 13.1v.9h3v-1h-1.8l1.8-2.1V10h-3zM2 5h14v2H2zm0 12h14v2H2zm0-6h14v2H2z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 9v2h-3V9H8.5V7H11V1H4v6h2.5v2H4v6h2.5v2H4v6h7v-6H8.5v-2H11v-2h3v2h7V9h-7z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},child:[]},{tag:"path",attr:{d:"M9 17h-2"},child:[]},{tag:"path",attr:{d:"M13 12h-6"},child:[]},{tag:"path",attr:{d:"M11 7h-4"},child:[]}]})(e)}function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M19 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M5 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M7 12h3l3.5 6h3.5"},child:[]},{tag:"path",attr:{d:"M17 6h-3.5l-3.5 6"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 3v18h18"},child:[]},{tag:"path",attr:{d:"M20 18v3"},child:[]},{tag:"path",attr:{d:"M16 16v5"},child:[]},{tag:"path",attr:{d:"M12 13v8"},child:[]},{tag:"path",attr:{d:"M8 16v5"},child:[]},{tag:"path",attr:{d:"M3 11c6 0 5 -5 9 -5s3 5 9 5"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9.615 20h-2.615a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8"},child:[]},{tag:"path",attr:{d:"M14 19l2 2l4 -4"},child:[]},{tag:"path",attr:{d:"M9 8h4"},child:[]},{tag:"path",attr:{d:"M9 12h2"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1"},child:[]},{tag:"path",attr:{d:"M9 15l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M12 12l0 9"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},child:[]},{tag:"path",attr:{d:"M11.192 17.966c-3.242 -.28 -5.972 -2.269 -8.192 -5.966c2.4 -4 5.4 -6 9 -6c3.326 0 6.14 1.707 8.442 5.122"},child:[]},{tag:"path",attr:{d:"M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},child:[]},{tag:"path",attr:{d:"M12 18c-.328 0 -.652 -.017 -.97 -.05c-3.172 -.332 -5.85 -2.315 -8.03 -5.95c2.4 -4 5.4 -6 9 -6c3.465 0 6.374 1.853 8.727 5.558"},child:[]},{tag:"path",attr:{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M20.2 20.2l1.8 1.8"},child:[]}]})(e)}function f(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5l0 14"},child:[]},{tag:"path",attr:{d:"M5 12l14 0"},child:[]}]})(e)}function p(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"},child:[]},{tag:"path",attr:{d:"M17 8v8h4"},child:[]},{tag:"path",attr:{d:"M13 15l1 1"},child:[]},{tag:"path",attr:{d:"M3 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"},child:[]}]})(e)}e.s(["LuChartBarBig",()=>n,"LuExternalLink",()=>r],901407),e.s(["MdFormatListNumberedRtl",()=>i,"MdSchema",()=>o],897716),e.s(["TbAlignBoxLeftStretch",()=>s,"TbBrandStackshare",()=>a,"TbChartHistogram",()=>l,"TbChecklist",()=>u,"TbCloudUpload",()=>c,"TbEyeEdit",()=>d,"TbEyeSearch",()=>h,"TbPlus",()=>f,"TbSql",()=>p],21292)},319557,e=>{"use strict";function t(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function n(e,r=!1){return e&&(t(e.value)&&""!==e.value||r&&t(e.defaultValue)&&""!==e.defaultValue)}function r(e){return e.startAdornment}e.s(["isAdornedStart",()=>r,"isFilled",()=>n])},624905,e=>{"use strict";var t=e.i(187725);function n(e,n){return t.isValidElement(e)&&-1!==n.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)}e.s(["default",()=>n])},981335,e=>{"use strict";let t=e.i(624905).default;e.s(["default",0,t])},895331,e=>{"use strict";let t=e.i(187725).createContext(void 0);e.s(["default",0,t])},992089,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(446547),o=e.i(519273),s=e.i(319557),a=e.i(578509),l=e.i(981335),u=e.i(895331),c=e.i(435983),d=e.i(446519);function h(e){return(0,d.default)("MuiFormControl",e)}(0,c.default)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var f=e.i(19483);let p=(0,i.styled)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${(0,a.default)(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),g=t.forwardRef(function(e,i){let c,d=(0,o.useDefaultProps)({props:e,name:"MuiFormControl"}),{children:g,className:m,color:v="primary",component:y="div",disabled:b=!1,error:x=!1,focused:w,fullWidth:_=!1,hiddenLabel:k=!1,margin:S="none",required:C=!1,size:O="medium",variant:E="outlined",...M}=d,A={...d,color:v,component:y,disabled:b,error:x,fullWidth:_,hiddenLabel:k,margin:S,required:C,size:O,variant:E},P=(e=>{let{classes:t,margin:n,fullWidth:i}=e,o={root:["root","none"!==n&&`margin${(0,a.default)(n)}`,i&&"fullWidth"]};return(0,r.default)(o,h,t)})(A),[T,R]=t.useState(()=>{let e=!1;return g&&t.Children.forEach(g,t=>{if(!(0,l.default)(t,["Input","Select"]))return;let n=(0,l.default)(t,["Select"])?t.props.input:t;n&&(0,s.isAdornedStart)(n.props)&&(e=!0)}),e}),[I,D]=t.useState(()=>{let e=!1;return g&&t.Children.forEach(g,t=>{(0,l.default)(t,["Input","Select"])&&((0,s.isFilled)(t.props,!0)||(0,s.isFilled)(t.props.inputProps,!0))&&(e=!0)}),e}),[L,j]=t.useState(!1);b&&L&&j(!1);let N=void 0===w||b?L:w;t.useRef(!1);let F=t.useCallback(()=>{D(!0)},[]),B=t.useCallback(()=>{D(!1)},[]),z=t.useMemo(()=>({adornedStart:T,setAdornedStart:R,color:v,disabled:b,error:x,filled:I,focused:N,fullWidth:_,hiddenLabel:k,size:O,onBlur:()=>{j(!1)},onFocus:()=>{j(!0)},onEmpty:B,onFilled:F,registerEffect:c,required:C,variant:E}),[T,v,b,x,I,N,_,k,c,B,F,C,O,E]);return(0,f.jsx)(u.default.Provider,{value:z,children:(0,f.jsx)(p,{as:y,ownerState:A,className:(0,n.default)(P.root,m),ref:i,...M,children:g})})});e.s(["default",0,g],992089)},854816,e=>{"use strict";function t({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&void 0===e[r]&&(t[r]=n[r]),t),{})}e.s(["default",()=>t])},331943,e=>{"use strict";var t=e.i(187725),n=e.i(895331);function r(){return t.useContext(n.default)}e.s(["default",()=>r])},384339,883124,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(854816),o=e.i(331943),s=e.i(578509),a=e.i(446547),l=e.i(73205),u=e.i(860223),c=e.i(519273),d=e.i(435983),h=e.i(446519);function f(e){return(0,h.default)("MuiFormLabel",e)}let p=(0,d.default)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]);e.s(["default",0,p,"getFormLabelUtilityClasses",()=>f],883124);var g=e.i(19483);let m=(0,a.styled)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"secondary"===n.color&&t.colorSecondary,n.filled&&t.filled]}})((0,l.default)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter((0,u.default)()).map(([t])=>({props:{color:t},style:{[`&.${p.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${p.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${p.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),v=(0,a.styled)("span",{name:"MuiFormLabel",slot:"Asterisk"})((0,l.default)(({theme:e})=>({[`&.${p.error}`]:{color:(e.vars||e).palette.error.main}}))),y=t.forwardRef(function(e,t){let a=(0,c.useDefaultProps)({props:e,name:"MuiFormLabel"}),{children:l,className:u,color:d,component:h="label",disabled:p,error:y,filled:b,focused:x,required:w,..._}=a,k=(0,o.default)(),S=(0,i.default)({props:a,muiFormControl:k,states:["color","required","focused","disabled","error","filled"]}),C={...a,color:S.color||"primary",component:h,disabled:S.disabled,error:S.error,filled:S.filled,focused:S.focused,required:S.required},O=(e=>{let{classes:t,color:n,focused:i,disabled:o,error:a,filled:l,required:u}=e,c={root:["root",`color${(0,s.default)(n)}`,o&&"disabled",a&&"error",l&&"filled",i&&"focused",u&&"required"],asterisk:["asterisk",a&&"error"]};return(0,r.default)(c,f,t)})(C);return(0,g.jsxs)(m,{as:h,ownerState:C,className:(0,n.default)(O.root,u),ref:t,..._,children:[l,S.required&&(0,g.jsxs)(v,{ownerState:C,"aria-hidden":!0,className:O.asterisk,children:[" ","*"]})]})});e.s(["default",0,y],384339)},176264,664271,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(578509),o=e.i(435983),s=e.i(446519);function a(e){return(0,s.default)("MuiNativeSelect",e)}let l=(0,o.default)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);e.s(["default",0,l,"getNativeSelectUtilityClasses",()=>a],664271);var u=e.i(446547),c=e.i(451962),d=e.i(19483);let h=(0,u.styled)("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${l.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>"filled"!==e.variant&&"outlined"!==e.variant,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),f=(0,u.styled)(h,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:c.default,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${l.multiple}`]:t.multiple}]}})({}),p=(0,u.styled)("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${l.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),g=(0,u.styled)(p,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,i.default)(n.variant)}`],n.open&&t.iconOpen]}})({}),m=t.forwardRef(function(e,o){let{className:s,disabled:l,error:u,IconComponent:c,inputRef:h,variant:p="standard",...m}=e,v={...e,disabled:l,variant:p,error:u},y=(e=>{let{classes:t,variant:n,disabled:o,multiple:s,open:l,error:u}=e,c={select:["select",n,o&&"disabled",s&&"multiple",u&&"error"],icon:["icon",`icon${(0,i.default)(n)}`,l&&"iconOpen",o&&"disabled"]};return(0,r.default)(c,a,t)})(v);return(0,d.jsxs)(t.Fragment,{children:[(0,d.jsx)(f,{ownerState:v,className:(0,n.default)(y.select,s),disabled:l,ref:h||o,...m}),e.multiple?null:(0,d.jsx)(g,{as:c,ownerState:v,className:y.icon})]})});e.s(["StyledSelectIcon",0,p,"StyledSelectSelect",0,h,"default",0,m],176264)},861207,e=>{"use strict";var t=e.i(36297),n=e.i(19483);let r=(0,t.default)((0,n.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");e.s(["default",0,r])},360550,e=>{"use strict";var t=e.i(187725),n=e.i(790318),r=e.i(995044),i=e.i(86396),o=e.i(554191),s=e.i(138419),a=e.i(19483);function l(e){return parseInt(e,10)||0}let u={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function c(e){return function(e){for(let t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}let d=t.forwardRef(function(e,d){let{onChange:h,maxRows:f,minRows:p=1,style:g,value:m,...v}=e,{current:y}=t.useRef(null!=m),b=t.useRef(null),x=(0,r.default)(d,b),w=t.useRef(null),_=t.useRef(null),k=t.useCallback(()=>{let t=b.current,n=_.current;if(!t||!n)return;let r=(0,s.default)(t).getComputedStyle(t);if("0px"===r.width)return{outerHeightStyle:0,overflowing:!1};n.style.width=r.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=r.boxSizing,o=l(r.paddingBottom)+l(r.paddingTop),a=l(r.borderBottomWidth)+l(r.borderTopWidth),u=n.scrollHeight;n.value="x";let c=n.scrollHeight,d=u;return p&&(d=Math.max(Number(p)*c,d)),f&&(d=Math.min(Number(f)*c,d)),{outerHeightStyle:(d=Math.max(d,c))+("border-box"===i?o+a:0),overflowing:1>=Math.abs(d-u)}},[f,p,e.placeholder]),S=(0,o.default)(()=>{let e=b.current,t=k();if(!e||!t||c(t))return!1;let n=t.outerHeightStyle;return null!=w.current&&w.current!==n}),C=t.useCallback(()=>{let e=b.current,t=k();if(!e||!t||c(t))return;let n=t.outerHeightStyle;w.current!==n&&(w.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?"hidden":""},[k]),O=t.useRef(-1);return(0,i.default)(()=>{let e,t=(0,n.default)(C),r=b?.current;if(!r)return;let i=(0,s.default)(r);return i.addEventListener("resize",t),"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(()=>{S()&&(e.unobserve(r),cancelAnimationFrame(O.current),C(),O.current=requestAnimationFrame(()=>{e.observe(r)}))})).observe(r),()=>{t.clear(),cancelAnimationFrame(O.current),i.removeEventListener("resize",t),e&&e.disconnect()}},[k,C,S]),(0,i.default)(()=>{C()}),(0,a.jsxs)(t.Fragment,{children:[(0,a.jsx)("textarea",{value:m,onChange:e=>{y||C();let t=e.target,n=t.value.length,r=t.value.endsWith("\n"),i=t.selectionStart===n;r&&i&&t.setSelectionRange(n,n),h&&h(e)},ref:x,rows:p,style:g,...v}),(0,a.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:_,tabIndex:-1,style:{...u,...g,paddingTop:0,paddingBottom:0}})]})});e.s(["default",0,d])},921301,e=>{"use strict";let t=e.i(86396).default;e.s(["default",0,t])},973250,278903,330978,e=>{"use strict";e.i(316575);var t,n=e.i(187725),r=e.i(778024),i=e.i(456132),o=e.i(862088),s=e.i(7284),a=e.i(427447),l=e.i(360550),u=e.i(854816),c=e.i(895331),d=e.i(331943),h=e.i(446547),f=e.i(854920),p=e.i(73205),g=e.i(519273),m=e.i(578509),v=e.i(723938),y=e.i(921301),b=e.i(319557),x=e.i(435983),w=e.i(446519);function _(e){return(0,w.default)("MuiInputBase",e)}let k=(0,x.default)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var S=e.i(19483);let C=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,"small"===n.size&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${(0,m.default)(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},O=(e,t)=>{let{ownerState:n}=e;return[t.input,"small"===n.size&&t.inputSizeSmall,n.multiline&&t.inputMultiline,"search"===n.type&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},E=(0,h.styled)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:C})((0,p.default)(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${k.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),M=(0,h.styled)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:O})((0,p.default)(({theme:e})=>{let t="light"===e.palette.mode,n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${k.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${k.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),A=(0,f.globalCss)({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),P=n.forwardRef(function(e,i){let h=(0,g.useDefaultProps)({props:e,name:"MuiInputBase"}),{"aria-describedby":f,autoComplete:p,autoFocus:x,className:w,color:k,components:C={},componentsProps:O={},defaultValue:P,disabled:T,disableInjectingGlobalStyles:R,endAdornment:I,error:D,fullWidth:L=!1,id:j,inputComponent:N="input",inputProps:F={},inputRef:B,margin:z,maxRows:V,minRows:H,multiline:$=!1,name:W,onBlur:U,onChange:q,onClick:Q,onFocus:K,onKeyDown:G,onKeyUp:X,placeholder:Y,readOnly:Z,renderSuffix:J,rows:ee,size:et,slotProps:en={},slots:er={},startAdornment:ei,type:eo="text",value:es,...ea}=h,el=null!=F.value?F.value:es,{current:eu}=n.useRef(null!=el),ec=n.useRef(),ed=n.useCallback(e=>{},[]),eh=(0,v.default)(ec,B,F.ref,ed),[ef,ep]=n.useState(!1),eg=(0,d.default)(),em=(0,u.default)({props:h,muiFormControl:eg,states:["color","disabled","error","hiddenLabel","size","required","filled"]});em.focused=eg?eg.focused:ef,n.useEffect(()=>{!eg&&T&&ef&&(ep(!1),U&&U())},[eg,T,ef,U]);let ev=eg&&eg.onFilled,ey=eg&&eg.onEmpty,eb=n.useCallback(e=>{(0,b.isFilled)(e)?ev&&ev():ey&&ey()},[ev,ey]);(0,y.default)(()=>{eu&&eb({value:el})},[el,eb,eu]),n.useEffect(()=>{eb(ec.current)},[]);let ex=N,ew=F;$&&"input"===ex&&(ew=ee?{type:void 0,minRows:ee,maxRows:ee,...ew}:{type:void 0,maxRows:V,minRows:H,...ew},ex=l.default),n.useEffect(()=>{eg&&eg.setAdornedStart(!!ei)},[eg,ei]);let e_={...h,color:em.color||"primary",disabled:em.disabled,endAdornment:I,error:em.error,focused:em.focused,formControl:eg,fullWidth:L,hiddenLabel:em.hiddenLabel,multiline:$,size:em.size,startAdornment:ei,type:eo},ek=(e=>{let{classes:t,color:n,disabled:i,error:o,endAdornment:s,focused:a,formControl:l,fullWidth:u,hiddenLabel:c,multiline:d,readOnly:h,size:f,startAdornment:p,type:g}=e,v={root:["root",`color${(0,m.default)(n)}`,i&&"disabled",o&&"error",u&&"fullWidth",a&&"focused",l&&"formControl",f&&"medium"!==f&&`size${(0,m.default)(f)}`,d&&"multiline",p&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",h&&"readOnly"],input:["input",i&&"disabled","search"===g&&"inputTypeSearch",d&&"inputMultiline","small"===f&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",s&&"inputAdornedEnd",h&&"readOnly"]};return(0,r.default)(v,_,t)})(e_),eS=er.root||C.Root||E,eC=en.root||O.root||{},eO=er.input||C.Input||M;return ew={...ew,...en.input??O.input},(0,S.jsxs)(n.Fragment,{children:[!R&&"function"==typeof A&&(t||(t=(0,S.jsx)(A,{}))),(0,S.jsxs)(eS,{...eC,ref:i,onClick:e=>{ec.current&&e.currentTarget===e.target&&ec.current.focus(),Q&&Q(e)},...ea,...!(0,a.default)(eS)&&{ownerState:{...e_,...eC.ownerState}},className:(0,s.default)(ek.root,eC.className,w,Z&&"MuiInputBase-readOnly"),children:[ei,(0,S.jsx)(c.default.Provider,{value:null,children:(0,S.jsx)(eO,{"aria-invalid":em.error,"aria-describedby":f,autoComplete:p,autoFocus:x,defaultValue:P,disabled:em.disabled,id:j,onAnimationStart:e=>{eb("mui-auto-fill-cancel"===e.animationName?ec.current:{value:"x"})},name:W,placeholder:Y,readOnly:Z,required:em.required,rows:ee,value:el,onKeyDown:G,onKeyUp:X,type:eo,...ew,...!(0,a.default)(eO)&&{as:ex,ownerState:{...e_,...ew.ownerState}},ref:eh,className:(0,s.default)(ek.input,ew.className,Z&&"MuiInputBase-readOnly"),onBlur:e=>{U&&U(e),F.onBlur&&F.onBlur(e),eg&&eg.onBlur?eg.onBlur(e):ep(!1)},onChange:(e,...t)=>{if(!eu){let t=e.target||ec.current;if(null==t)throw Error((0,o.default)(1));eb({value:t.value})}F.onChange&&F.onChange(e,...t),q&&q(e,...t)},onFocus:e=>{K&&K(e),F.onFocus&&F.onFocus(e),eg&&eg.onFocus?eg.onFocus(e):ep(!0)}})}),I,J?J({...em,startAdornment:ei}):null]})]})});e.s(["InputBaseInput",0,M,"InputBaseRoot",0,E,"default",0,P,"inputOverridesResolver",0,O,"rootOverridesResolver",0,C],278903);var T=e.i(451962),R=e.i(860223);function I(e){return(0,w.default)("MuiInput",e)}e.s(["inputBaseClasses",0,k],330978);let D={...k,...(0,x.default)("MuiInput",["root","underline","input"])},L=(0,h.styled)(E,{shouldForwardProp:e=>(0,T.default)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...C(e,t),!n.disableUnderline&&t.underline]}})((0,p.default)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:e})=>e.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${D.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${D.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${D.disabled}, .${D.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${D.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter((0,R.default)()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),j=(0,h.styled)(M,{name:"MuiInput",slot:"Input",overridesResolver:O})({}),N=n.forwardRef(function(e,t){let n=(0,g.useDefaultProps)({props:e,name:"MuiInput"}),{disableUnderline:o=!1,components:s={},componentsProps:a,fullWidth:l=!1,inputComponent:u="input",multiline:c=!1,slotProps:d,slots:h={},type:f="text",...p}=n,m=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,r.default)({root:["root",!n&&"underline"],input:["input"]},I,t);return{...t,...i}})(n),v={root:{ownerState:{disableUnderline:o}}},y=d??a?(0,i.default)(d??a,v):v,b=h.root??s.Root??L,x=h.input??s.Input??j;return(0,S.jsx)(P,{slots:{root:b,input:x},slotProps:y,fullWidth:l,inputComponent:u,multiline:c,ref:t,type:f,...p,classes:m})});N.muiName="Input",e.s(["default",0,N],973250)},320182,e=>{"use strict";var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(176264),o=e.i(854816),s=e.i(331943),a=e.i(861207),l=e.i(973250),u=e.i(519273),c=e.i(664271),d=e.i(19483);let h=(0,d.jsx)(l.default,{}),f=t.forwardRef(function(e,l){let f=(0,u.useDefaultProps)({name:"MuiNativeSelect",props:e}),{className:p,children:g,classes:m={},IconComponent:v=a.default,input:y=h,inputProps:b,variant:x,...w}=f,_=(0,s.default)(),k=(0,o.default)({props:f,muiFormControl:_,states:["variant"]}),S=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},c.getNativeSelectUtilityClasses,t)})({...f,classes:m}),{root:C,...O}=m;return(0,d.jsx)(t.Fragment,{children:t.cloneElement(y,{inputComponent:i.default,inputProps:{children:g,classes:O,IconComponent:v,variant:k.variant,type:void 0,...b,...y?y.props.inputProps:{}},ref:l,...w,className:(0,n.default)(S.root,y.props.className,p)})})});f.muiName="Select",e.s(["default",0,f])},228337,(e,t,n)=>{(function(){var r,i="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=1/0,l=0/0,u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",d="[object Array]",h="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",m="[object GeneratorFunction]",v="[object Map]",y="[object Number]",b="[object Object]",x="[object Promise]",w="[object RegExp]",_="[object Set]",k="[object String]",S="[object Symbol]",C="[object WeakMap]",O="[object ArrayBuffer]",E="[object DataView]",M="[object Float32Array]",A="[object Float64Array]",P="[object Int8Array]",T="[object Int16Array]",R="[object Int32Array]",I="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",j="[object Uint32Array]",N=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,H=RegExp(z.source),$=RegExp(V.source),W=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(X.source),Z=/^\s+/,J=/\s/,ee=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,et=/\{\n\/\* \[wrapped with (.+)\] \*/,en=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ei=/[()=,{}\[\]\/\s]/,eo=/\\(\\)?/g,es=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ea=/\w*$/,el=/^[-+]0x[0-9a-f]+$/i,eu=/^0b[01]+$/i,ec=/^\[object .+?Constructor\]$/,ed=/^0o[0-7]+$/i,eh=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ep=/($^)/,eg=/['\n\r\u2028\u2029\\]/g,em="\ud800-\udfff",ev="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ey="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ex="A-Z\\xc0-\\xd6\\xd8-\\xde",ew="\\ufe0e\\ufe0f",e_="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ek="['’]",eS="["+e_+"]",eC="["+ev+"]",eO="["+eb+"]",eE="[^"+em+e_+"\\d+"+ey+eb+ex+"]",eM="\ud83c[\udffb-\udfff]",eA="[^"+em+"]",eP="(?:\ud83c[\udde6-\uddff]){2}",eT="[\ud800-\udbff][\udc00-\udfff]",eR="["+ex+"]",eI="\\u200d",eD="(?:"+eO+"|"+eE+")",eL="(?:"+eR+"|"+eE+")",ej="(?:"+ek+"(?:d|ll|m|re|s|t|ve))?",eN="(?:"+ek+"(?:D|LL|M|RE|S|T|VE))?",eF="(?:"+eC+"|"+eM+")?",eB="["+ew+"]?",ez="(?:"+eI+"(?:"+[eA,eP,eT].join("|")+")"+eB+eF+")*",eV=eB+eF+ez,eH="(?:"+["["+ey+"]",eP,eT].join("|")+")"+eV,e$="(?:"+[eA+eC+"?",eC,eP,eT,"["+em+"]"].join("|")+")",eW=RegExp(ek,"g"),eU=RegExp(eC,"g"),eq=RegExp(eM+"(?="+eM+")|"+e$+eV,"g"),eQ=RegExp([eR+"?"+eO+"+"+ej+"(?="+[eS,eR,"$"].join("|")+")",eL+"+"+eN+"(?="+[eS,eR+eD,"$"].join("|")+")",eR+"?"+eD+"+"+ej,eR+"+"+eN,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",eH].join("|"),"g"),eK=RegExp("["+eI+em+ev+ew+"]"),eG=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eX=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eY=-1,eZ={};eZ[M]=eZ[A]=eZ[P]=eZ[T]=eZ[R]=eZ[I]=eZ[D]=eZ[L]=eZ[j]=!0,eZ[c]=eZ[d]=eZ[O]=eZ[h]=eZ[E]=eZ[f]=eZ[p]=eZ[g]=eZ[v]=eZ[y]=eZ[b]=eZ[w]=eZ[_]=eZ[k]=eZ[C]=!1;var eJ={};eJ[c]=eJ[d]=eJ[O]=eJ[E]=eJ[h]=eJ[f]=eJ[M]=eJ[A]=eJ[P]=eJ[T]=eJ[R]=eJ[v]=eJ[y]=eJ[b]=eJ[w]=eJ[_]=eJ[k]=eJ[S]=eJ[I]=eJ[D]=eJ[L]=eJ[j]=!0,eJ[p]=eJ[g]=eJ[C]=!1;var e0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e1=parseFloat,e2=parseInt,e5=e.g&&e.g.Object===Object&&e.g,e3="object"==typeof self&&self&&self.Object===Object&&self,e4=e5||e3||Function("return this")(),e8=n&&!n.nodeType&&n,e6=e8&&t&&!t.nodeType&&t,e7=e6&&e6.exports===e8,e9=e7&&e5.process,te=function(){try{var e=e6&&e6.require&&e6.require("util").types;if(e)return e;return e9&&e9.binding&&e9.binding("util")}catch(e){}}(),tt=te&&te.isArrayBuffer,tn=te&&te.isDate,tr=te&&te.isMap,ti=te&&te.isRegExp,to=te&&te.isSet,ts=te&&te.isTypedArray;function ta(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function tl(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function tu(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function tc(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function td(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function th(e,t){return!!(null==e?0:e.length)&&t_(e,t,0)>-1}function tf(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function tp(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function tg(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function tm(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function tv(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function ty(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var tb=tO("length");function tx(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function tw(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1}function t_(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}(e,t,n):tw(e,tS,n)}function tk(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return -1}function tS(e){return e!=e}function tC(e,t){var n=null==e?0:e.length;return n?tA(e,t)/n:l}function tO(e){return function(t){return null==t?r:t[e]}}function tE(e){return function(t){return null==e?r:e[t]}}function tM(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function tA(e,t){for(var n,i=-1,o=e.length;++i<o;){var s=t(e[i]);r!==s&&(n=r===n?s:n+s)}return n}function tP(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function tT(e){return e?e.slice(0,tQ(e)+1).replace(Z,""):e}function tR(e){return function(t){return e(t)}}function tI(e,t){return tp(t,function(t){return e[t]})}function tD(e,t){return e.has(t)}function tL(e,t){for(var n=-1,r=e.length;++n<r&&t_(t,e[n],0)>-1;);return n}function tj(e,t){for(var n=e.length;n--&&t_(t,e[n],0)>-1;);return n}var tN=tE({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tF=tE({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tB(e){return"\\"+e0[e]}function tz(e){return eK.test(e)}function tV(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function tH(e,t){return function(n){return e(t(n))}}function t$(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];(a===t||a===s)&&(e[n]=s,o[i++]=n)}return o}function tW(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function tU(e){return tz(e)?function(e){for(var t=eq.lastIndex=0;eq.test(e);)++t;return t}(e):tb(e)}function tq(e){return tz(e)?e.match(eq)||[]:e.split("")}function tQ(e){for(var t=e.length;t--&&J.test(e.charAt(t)););return t}var tK=tE({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tG=function e(t){var n,J,em,ev,ey=(t=null==t?e4:tG.defaults(e4.Object(),t,tG.pick(e4,eX))).Array,eb=t.Date,ex=t.Error,ew=t.Function,e_=t.Math,ek=t.Object,eS=t.RegExp,eC=t.String,eO=t.TypeError,eE=ey.prototype,eM=ew.prototype,eA=ek.prototype,eP=t["__core-js_shared__"],eT=eM.toString,eR=eA.hasOwnProperty,eI=0,eD=(n=/[^.]+$/.exec(eP&&eP.keys&&eP.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",eL=eA.toString,ej=eT.call(ek),eN=e4._,eF=eS("^"+eT.call(eR).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eB=e7?t.Buffer:r,ez=t.Symbol,eV=t.Uint8Array,eH=eB?eB.allocUnsafe:r,e$=tH(ek.getPrototypeOf,ek),eq=ek.create,eK=eA.propertyIsEnumerable,e0=eE.splice,e5=ez?ez.isConcatSpreadable:r,e3=ez?ez.iterator:r,e8=ez?ez.toStringTag:r,e6=function(){try{var e=ip(ek,"defineProperty");return e({},"",{}),e}catch(e){}}(),e9=t.clearTimeout!==e4.clearTimeout&&t.clearTimeout,te=eb&&eb.now!==e4.Date.now&&eb.now,tb=t.setTimeout!==e4.setTimeout&&t.setTimeout,tE=e_.ceil,tX=e_.floor,tY=ek.getOwnPropertySymbols,tZ=eB?eB.isBuffer:r,tJ=t.isFinite,t0=eE.join,t1=tH(ek.keys,ek),t2=e_.max,t5=e_.min,t3=eb.now,t4=t.parseInt,t8=e_.random,t6=eE.reverse,t7=ip(t,"DataView"),t9=ip(t,"Map"),ne=ip(t,"Promise"),nt=ip(t,"Set"),nn=ip(t,"WeakMap"),nr=ip(ek,"create"),ni=nn&&new nn,no={},ns=iB(t7),na=iB(t9),nl=iB(ne),nu=iB(nt),nc=iB(nn),nd=ez?ez.prototype:r,nh=nd?nd.valueOf:r,nf=nd?nd.toString:r;function np(e){if(oK(e)&&!oN(e)&&!(e instanceof ny)){if(e instanceof nv)return e;if(eR.call(e,"__wrapped__"))return iz(e)}return new nv(e)}var ng=function(){function e(){}return function(t){if(!oQ(t))return{};if(eq)return eq(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function nm(){}function nv(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function ny(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function nb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nx(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nw(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function n_(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nw;++t<n;)this.add(e[t])}function nk(e){var t=this.__data__=new nx(e);this.size=t.size}function nS(e,t){var n=oN(e),r=!n&&oj(e),i=!n&&!r&&oV(e),o=!n&&!r&&!i&&o2(e),s=n||r||i||o,a=s?tP(e.length,eC):[],l=a.length;for(var u in e)(t||eR.call(e,u))&&!(s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||iw(u,l)))&&a.push(u);return a}function nC(e){var t=e.length;return t?e[ru(0,t-1)]:r}np.templateSettings={escape:W,evaluate:U,interpolate:q,variable:"",imports:{_:np}},np.prototype=nm.prototype,np.prototype.constructor=np,nv.prototype=ng(nm.prototype),nv.prototype.constructor=nv,ny.prototype=ng(nm.prototype),ny.prototype.constructor=ny,nb.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},nb.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},nb.prototype.get=function(e){var t=this.__data__;if(nr){var n=t[e];return n===o?r:n}return eR.call(t,e)?t[e]:r},nb.prototype.has=function(e){var t=this.__data__;return nr?t[e]!==r:eR.call(t,e)},nb.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=nr&&r===t?o:t,this},nx.prototype.clear=function(){this.__data__=[],this.size=0},nx.prototype.delete=function(e){var t=this.__data__,n=nM(t,e);return!(n<0)&&(n==t.length-1?t.pop():e0.call(t,n,1),--this.size,!0)},nx.prototype.get=function(e){var t=this.__data__,n=nM(t,e);return n<0?r:t[n][1]},nx.prototype.has=function(e){return nM(this.__data__,e)>-1},nx.prototype.set=function(e,t){var n=this.__data__,r=nM(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},nw.prototype.clear=function(){this.size=0,this.__data__={hash:new nb,map:new(t9||nx),string:new nb}},nw.prototype.delete=function(e){var t=id(this,e).delete(e);return this.size-=!!t,t},nw.prototype.get=function(e){return id(this,e).get(e)},nw.prototype.has=function(e){return id(this,e).has(e)},nw.prototype.set=function(e,t){var n=id(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},n_.prototype.add=n_.prototype.push=function(e){return this.__data__.set(e,o),this},n_.prototype.has=function(e){return this.__data__.has(e)};function nO(e,t,n){(r===n||oI(e[t],n))&&(r!==n||t in e)||nT(e,t,n)}function nE(e,t,n){var i=e[t];eR.call(e,t)&&oI(i,n)&&(r!==n||t in e)||nT(e,t,n)}function nM(e,t){for(var n=e.length;n--;)if(oI(e[n][0],t))return n;return -1}function nA(e,t,n,r){return nF(e,function(e,i,o){t(r,e,n(e),o)}),r}function nP(e,t){return e&&rV(t,sp(t),e)}function nT(e,t,n){"__proto__"==t&&e6?e6(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function nR(e,t){for(var n=-1,i=t.length,o=ey(i),s=null==e;++n<i;)o[n]=s?r:su(e,t[n]);return o}function nI(e,t,n){return e==e&&(r!==n&&(e=e<=n?e:n),r!==t&&(e=e>=t?e:t)),e}function nD(e,t,n,i,o,s){var a,l=1&t,u=2&t,d=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),r!==a)return a;if(!oQ(e))return e;var p=oN(e);if(p){if(C=(x=e).length,N=new x.constructor(C),C&&"string"==typeof x[0]&&eR.call(x,"index")&&(N.index=x.index,N.input=x.input),a=N,!l)return rz(e,a)}else{var x,C,N,F,B,z,V,H,$=iv(e),W=$==g||$==m;if(oV(e))return rD(e,l);if($==b||$==c||W&&!o){if(a=u||W?{}:ib(e),!l){return u?(F=e,B=(H=a)&&rV(e,sg(e),H),rV(F,im(F),B)):(z=e,V=nP(a,e),rV(z,ig(z),V))}}else{if(!eJ[$])return o?e:{};a=function(e,t,n){var r,i,o=e.constructor;switch(t){case O:return rL(e);case h:case f:return new o(+e);case E:return r=n?rL(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case M:case A:case P:case T:case R:case I:case D:case L:case j:return rj(e,n);case v:return new o;case y:case k:return new o(e);case w:return(i=new e.constructor(e.source,ea.exec(e))).lastIndex=e.lastIndex,i;case _:return new o;case S:return nh?ek(nh.call(e)):{}}}(e,$,l)}}s||(s=new nk);var U=s.get(e);if(U)return U;s.set(e,a),oJ(e)?e.forEach(function(r){a.add(nD(r,t,n,r,e,s))}):oG(e)&&e.forEach(function(r,i){a.set(i,nD(r,t,n,i,e,s))});var q=d?u?is:io:u?sg:sp,Q=p?r:q(e);return tu(Q||e,function(r,i){Q&&(r=e[i=r]),nE(a,i,nD(r,t,n,i,e,s))}),a}function nL(e,t,n){var i=n.length;if(null==e)return!i;for(e=ek(e);i--;){var o=n[i],s=t[o],a=e[o];if(r===a&&!(o in e)||!s(a))return!1}return!0}function nj(e,t,n){if("function"!=typeof e)throw new eO(i);return iR(function(){e.apply(r,n)},t)}function nN(e,t,n,r){var i=-1,o=th,s=!0,a=e.length,l=[],u=t.length;if(!a)return l;n&&(t=tp(t,tR(n))),r?(o=tf,s=!1):t.length>=200&&(o=tD,s=!1,t=new n_(t));e:for(;++i<a;){var c=e[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,s&&d==d){for(var h=u;h--;)if(t[h]===d)continue e;l.push(c)}else o(t,d,r)||l.push(c)}return l}nk.prototype.clear=function(){this.__data__=new nx,this.size=0},nk.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nk.prototype.get=function(e){return this.__data__.get(e)},nk.prototype.has=function(e){return this.__data__.has(e)},nk.prototype.set=function(e,t){var n=this.__data__;if(n instanceof nx){var r=n.__data__;if(!t9||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nw(r)}return n.set(e,t),this.size=n.size,this};var nF=rW(nq),nB=rW(nQ,!0);function nz(e,t){var n=!0;return nF(e,function(e,r,i){return n=!!t(e,r,i)}),n}function nV(e,t,n){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(r===l?a==a&&!o1(a):n(a,l)))var l=a,u=s}return u}function nH(e,t){var n=[];return nF(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function n$(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=ix),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?n$(a,t-1,n,r,i):tg(i,a):r||(i[i.length]=a)}return i}var nW=rU(),nU=rU(!0);function nq(e,t){return e&&nW(e,t,sp)}function nQ(e,t){return e&&nU(e,t,sp)}function nK(e,t){return td(t,function(t){return oW(e[t])})}function nG(e,t){t=rT(t,e);for(var n=0,i=t.length;null!=e&&n<i;)e=e[iF(t[n++])];return n&&n==i?e:r}function nX(e,t,n){var r=t(e);return oN(e)?r:tg(r,n(e))}function nY(e){var t;return null==e?r===e?"[object Undefined]":"[object Null]":e8&&e8 in ek(e)?function(e){var t=eR.call(e,e8),n=e[e8];try{e[e8]=r;var i=!0}catch(e){}var o=eL.call(e);return i&&(t?e[e8]=n:delete e[e8]),o}(e):(t=e,eL.call(t))}function nZ(e,t){return e>t}function nJ(e,t){return null!=e&&eR.call(e,t)}function n0(e,t){return null!=e&&t in ek(e)}function n1(e,t,n){for(var i=n?tf:th,o=e[0].length,s=e.length,a=s,l=ey(s),u=1/0,c=[];a--;){var d=e[a];a&&t&&(d=tp(d,tR(t))),u=t5(d.length,u),l[a]=!n&&(t||o>=120&&d.length>=120)?new n_(a&&d):r}d=e[0];var h=-1,f=l[0];e:for(;++h<o&&c.length<u;){var p=d[h],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?tD(f,g):i(c,g,n))){for(a=s;--a;){var m=l[a];if(!(m?tD(m,g):i(e[a],g,n)))continue e}f&&f.push(g),c.push(p)}}return c}function n2(e,t,n){t=rT(t,e);var i=null==(e=iA(e,t))?e:e[iF(iY(t))];return null==i?r:ta(i,e,n)}function n5(e){return oK(e)&&nY(e)==c}function n3(e,t,n,i,o){return e===t||(null!=e&&null!=t&&(oK(e)||oK(t))?function(e,t,n,i,o,s){var a=oN(e),l=oN(t),u=a?d:iv(e),g=l?d:iv(t);u=u==c?b:u,g=g==c?b:g;var m=u==b,x=g==b,C=u==g;if(C&&oV(e)){if(!oV(t))return!1;a=!0,m=!1}if(C&&!m)return s||(s=new nk),a||o2(e)?ir(e,t,n,i,o,s):function(e,t,n,r,i,o,s){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case O:if(e.byteLength!=t.byteLength||!o(new eV(e),new eV(t)))break;return!0;case h:case f:case y:return oI(+e,+t);case p:return e.name==t.name&&e.message==t.message;case w:case k:return e==t+"";case v:var a=tV;case _:var l=1&r;if(a||(a=tW),e.size!=t.size&&!l)break;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var c=ir(a(e),a(t),r,i,o,s);return s.delete(e),c;case S:if(nh)return nh.call(e)==nh.call(t)}return!1}(e,t,u,n,i,o,s);if(!(1&n)){var M=m&&eR.call(e,"__wrapped__"),A=x&&eR.call(t,"__wrapped__");if(M||A){var P=M?e.value():e,T=A?t.value():t;return s||(s=new nk),o(P,T,n,i,s)}}return!!C&&(s||(s=new nk),function(e,t,n,i,o,s){var a=1&n,l=io(e),u=l.length;if(u!=io(t).length&&!a)return!1;for(var c=u;c--;){var d=l[c];if(!(a?d in t:eR.call(t,d)))return!1}var h=s.get(e),f=s.get(t);if(h&&f)return h==t&&f==e;var p=!0;s.set(e,t),s.set(t,e);for(var g=a;++c<u;){var m=e[d=l[c]],v=t[d];if(i)var y=a?i(v,m,d,t,e,s):i(m,v,d,e,t,s);if(!(r===y?m===v||o(m,v,n,i,s):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x)&&(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,i,o,s))}(e,t,n,i,n3,o):e!=e&&t!=t)}function n4(e,t,n,i){var o=n.length,s=o,a=!i;if(null==e)return!s;for(e=ek(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var u=(l=n[o])[0],c=e[u],d=l[1];if(a&&l[2]){if(r===c&&!(u in e))return!1}else{var h=new nk;if(i)var f=i(c,d,u,e,t,h);if(!(r===f?n3(d,c,3,i,h):f))return!1}}return!0}function n8(e){var t;return!(!oQ(e)||(t=e,eD&&eD in t))&&(oW(e)?eF:ec).test(iB(e))}function n6(e){return"function"==typeof e?e:null==e?sz:"object"==typeof e?oN(e)?rn(e[0],e[1]):rt(e):sG(e)}function n7(e){if(!iO(e))return t1(e);var t=[];for(var n in ek(e))eR.call(e,n)&&"constructor"!=n&&t.push(n);return t}function n9(e,t){return e<t}function re(e,t){var n=-1,r=oB(e)?ey(e.length):[];return nF(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function rt(e){var t=ih(e);return 1==t.length&&t[0][2]?iE(t[0][0],t[0][1]):function(n){return n===e||n4(n,e,t)}}function rn(e,t){var n;return ik(e)&&(n=t)==n&&!oQ(n)?iE(iF(e),t):function(n){var i=su(n,e);return r===i&&i===t?sc(n,e):n3(t,i,3)}}function rr(e,t,n,i,o){e!==t&&nW(t,function(s,a){if(o||(o=new nk),oQ(s))!function(e,t,n,i,o,s,a){var l=iP(e,n),u=iP(t,n),c=a.get(u);if(c)return nO(e,n,c);var d=s?s(l,u,n+"",e,t,a):r,h=r===d;if(h){var f=oN(u),p=!f&&oV(u),g=!f&&!p&&o2(u);d=u,f||p||g?oN(l)?d=l:oz(l)?d=rz(l):p?(h=!1,d=rD(u,!0)):g?(h=!1,d=rj(u,!0)):d=[]:oY(u)||oj(u)?(d=l,oj(l)?d=se(l):(!oQ(l)||oW(l))&&(d=ib(u))):h=!1}h&&(a.set(u,d),o(d,u,i,s,a),a.delete(u)),nO(e,n,d)}(e,t,a,n,rr,i,o);else{var l=i?i(iP(e,a),s,a+"",e,t,o):r;r===l&&(l=s),nO(e,a,l)}},sg)}function ri(e,t){var n=e.length;if(n)return iw(t+=t<0?n:0,n)?e[t]:r}function ro(e,t,n){t=t.length?tp(t,function(e){return oN(e)?function(t){return nG(t,1===e.length?e[0]:e)}:e}):[sz];var r=-1;t=tp(t,tR(ic()));var i=re(e,function(e,n,i){return{criteria:tp(t,function(t){return t(e)}),index:++r,value:e}}),o=i.length;for(i.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=rN(i[r],o[r]);if(l){if(r>=a)return l;return l*("desc"==n[r]?-1:1)}}return e.index-t.index}(e,t,n)});o--;)i[o]=i[o].value;return i}function rs(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=nG(e,s);n(a,s)&&rh(o,rT(s,e),a)}return o}function ra(e,t,n,r){var i=r?tk:t_,o=-1,s=t.length,a=e;for(e===t&&(t=rz(t)),n&&(a=tp(e,tR(n)));++o<s;)for(var l=0,u=t[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==e&&e0.call(a,l,1),e0.call(e,l,1);return e}function rl(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;iw(i)?e0.call(e,i,1):rk(e,i)}}return e}function ru(e,t){return e+tX(t8()*(t-e+1))}function rc(e,t){var n="";if(!e||t<1||t>0x1fffffffffffff)return n;do t%2&&(n+=e),(t=tX(t/2))&&(e+=e);while(t)return n}function rd(e,t){return iI(iM(e,t,sz),e+"")}function rh(e,t,n,i){if(!oQ(e))return e;t=rT(t,e);for(var o=-1,s=t.length,a=s-1,l=e;null!=l&&++o<s;){var u=iF(t[o]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)break;if(o!=a){var d=l[u];c=i?i(d,u,l):r,r===c&&(c=oQ(d)?d:iw(t[o+1])?[]:{})}nE(l,u,c),l=l[u]}return e}var rf=ni?function(e,t){return ni.set(e,t),e}:sz,rp=e6?function(e,t){return e6(e,"toString",{configurable:!0,enumerable:!1,value:sN(t),writable:!0})}:sz;function rg(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=ey(i);++r<i;)o[r]=e[r+t];return o}function rm(e,t){var n;return nF(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function rv(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=0x7fffffff){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!o1(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ry(e,t,sz,n)}function ry(e,t,n,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,u=o1(t),c=r===t;o<s;){var d=tX((o+s)/2),h=n(e[d]),f=r!==h,p=null===h,g=h==h,m=o1(h);if(a)var v=i||g;else v=c?g&&(i||f):l?g&&f&&(i||!p):u?g&&f&&!p&&(i||!m):!p&&!m&&(i?h<=t:h<t);v?o=d+1:s=d}return t5(s,0xfffffffe)}function rb(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!oI(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function rx(e){return"number"==typeof e?e:o1(e)?l:+e}function rw(e){if("string"==typeof e)return e;if(oN(e))return tp(e,rw)+"";if(o1(e))return nf?nf.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}function r_(e,t,n){var r=-1,i=th,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=tf;else if(o>=200){var u=t?null:r8(e);if(u)return tW(u);s=!1,i=tD,l=new n_}else l=t?[]:a;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,s&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(c)}else i(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}function rk(e,t){return t=rT(t,e),null==(e=iA(e,t))||delete e[iF(iY(t))]}function rS(e,t,n,r){return rh(e,t,n(nG(e,t)),r)}function rC(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?rg(e,r?0:o,r?o+1:i):rg(e,r?o+1:0,r?i:o)}function rO(e,t){var n=e;return n instanceof ny&&(n=n.value()),tm(t,function(e,t){return t.func.apply(t.thisArg,tg([e],t.args))},n)}function rE(e,t,n){var r=e.length;if(r<2)return r?r_(e[0]):[];for(var i=-1,o=ey(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=nN(o[i]||s,e[a],t,n));return r_(n$(o,1),t,n)}function rM(e,t,n){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:r;n(a,e[i],l)}return a}function rA(e){return oz(e)?e:[]}function rP(e){return"function"==typeof e?e:sz}function rT(e,t){return oN(e)?e:ik(e,t)?[e]:iN(st(e))}function rR(e,t,n){var i=e.length;return n=r===n?i:n,!t&&n>=i?e:rg(e,t,n)}var rI=e9||function(e){return e4.clearTimeout(e)};function rD(e,t){if(t)return e.slice();var n=e.length,r=eH?eH(n):new e.constructor(n);return e.copy(r),r}function rL(e){var t=new e.constructor(e.byteLength);return new eV(t).set(new eV(e)),t}function rj(e,t){var n=t?rL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function rN(e,t){if(e!==t){var n=r!==e,i=null===e,o=e==e,s=o1(e),a=r!==t,l=null===t,u=t==t,c=o1(t);if(!l&&!c&&!s&&e>t||s&&a&&u&&!l&&!c||i&&a&&u||!n&&u||!o)return 1;if(!i&&!s&&!c&&e<t||c&&n&&o&&!i&&!s||l&&n&&o||!a&&o||!u)return -1}return 0}function rF(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,l=t.length,u=t2(o-s,0),c=ey(l+u),d=!r;++a<l;)c[a]=t[a];for(;++i<s;)(d||i<o)&&(c[n[i]]=e[i]);for(;u--;)c[a++]=e[i++];return c}function rB(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,l=-1,u=t.length,c=t2(o-a,0),d=ey(c+u),h=!r;++i<c;)d[i]=e[i];for(var f=i;++l<u;)d[f+l]=t[l];for(;++s<a;)(h||i<o)&&(d[f+n[s]]=e[i++]);return d}function rz(e,t){var n=-1,r=e.length;for(t||(t=ey(r));++n<r;)t[n]=e[n];return t}function rV(e,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],u=i?i(n[l],e[l],l,n,e):r;r===u&&(u=e[l]),o?nT(n,l,u):nE(n,l,u)}return n}function rH(e,t){return function(n,r){var i=oN(n)?tl:nA,o=t?t():{};return i(n,e,ic(r,2),o)}}function r$(e){return rd(function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&i_(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=ek(t);++i<o;){var l=n[i];l&&e(t,l,i,s)}return t})}function rW(e,t){return function(n,r){if(null==n)return n;if(!oB(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=ek(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function rU(e){return function(t,n,r){for(var i=-1,o=ek(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function rq(e){return function(t){var n=tz(t=st(t))?tq(t):r,i=n?n[0]:t.charAt(0),o=n?rR(n,1).join(""):t.slice(1);return i[e]()+o}}function rQ(e){return function(t){return tm(sD(sO(t).replace(eW,"")),e,"")}}function rK(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=ng(e.prototype),r=e.apply(n,t);return oQ(r)?r:n}}function rG(e){return function(t,n,i){var o=ek(t);if(!oB(t)){var s=ic(n,3);t=sp(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,i);return a>-1?o[s?t[a]:a]:r}}function rX(e){return ii(function(t){var n=t.length,o=n,s=nv.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new eO(i);if(s&&!l&&"wrapper"==il(a))var l=new nv([],!0)}for(o=l?o:n;++o<n;){var u=il(a=t[o]),c="wrapper"==u?ia(a):r;l=c&&iS(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[il(c[0])].apply(l,c[3]):1==a.length&&iS(a)?l[u]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&oN(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}})}function rY(e,t,n,i,o,s,a,l,u,c){var d=128&t,h=1&t,f=2&t,p=24&t,g=512&t,m=f?r:rK(e);function v(){for(var y=arguments.length,b=ey(y),x=y;x--;)b[x]=arguments[x];if(p)var w=iu(v),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,w);if(i&&(b=rF(b,i,o,p)),s&&(b=rB(b,s,a,p)),y-=_,p&&y<c){var k=t$(b,w);return r3(e,t,rY,v.placeholder,n,b,k,l,u,c-y)}var S=h?n:this,C=f?S[e]:e;return y=b.length,l?b=function(e,t){for(var n=e.length,i=t5(t.length,n),o=rz(e);i--;){var s=t[i];e[i]=iw(s,n)?o[s]:r}return e}(b,l):g&&y>1&&b.reverse(),d&&u<y&&(b.length=u),this&&this!==e4&&this instanceof v&&(C=m||rK(C)),C.apply(S,b)}return v}function rZ(e,t){return function(n,r){var i,o;return i=t(r),o={},nq(n,function(t,n,r){e(o,i(t),n,r)}),o}}function rJ(e,t){return function(n,i){var o;if(r===n&&r===i)return t;if(r!==n&&(o=n),r!==i){if(r===o)return i;"string"==typeof n||"string"==typeof i?(n=rw(n),i=rw(i)):(n=rx(n),i=rx(i)),o=e(n,i)}return o}}function r0(e){return ii(function(t){return t=tp(t,tR(ic())),rd(function(n){var r=this;return e(t,function(e){return ta(e,r,n)})})})}function r1(e,t){var n=(t=r===t?" ":rw(t)).length;if(n<2)return n?rc(t,e):t;var i=rc(t,tE(e/tU(t)));return tz(t)?rR(tq(i),0,e).join(""):i.slice(0,e)}function r2(e){return function(t,n,i){i&&"number"!=typeof i&&i_(t,n,i)&&(n=i=r),t=o8(t),r===n?(n=t,t=0):n=o8(n),i=r===i?t<n?1:-1:o8(i);for(var o=t,s=n,a=i,l=-1,u=t2(tE((s-o)/(a||1)),0),c=ey(u);u--;)c[e?u:++l]=o,o+=a;return c}}function r5(e){return function(t,n){return("string"!=typeof t||"string"!=typeof n)&&(t=o9(t),n=o9(n)),e(t,n)}}function r3(e,t,n,i,o,s,a,l,u,c){var d=8&t,h=d?a:r,f=d?r:a,p=d?s:r,g=d?r:s;t|=d?32:64,4&(t&=~(d?64:32))||(t&=-4);var m=[e,t,o,p,h,g,f,l,u,c],v=n.apply(r,m);return iS(e)&&iT(v,m),v.placeholder=i,iD(v,e,t)}function r4(e){var t=e_[e];return function(e,n){if(e=o9(e),(n=null==n?0:t5(o6(n),292))&&tJ(e)){var r=(st(e)+"e").split("e");return+((r=(st(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(r[1]-n))}return t(e)}}var r8=nt&&1/tW(new nt([,-0]))[1]==a?function(e){return new nt(e)}:sU;function r6(e){return function(t){var n,r,i=iv(t);return i==v?tV(t):i==_?(n=-1,r=Array(t.size),t.forEach(function(e){r[++n]=[e,e]}),r):tp(e(t),function(e){return[e,t[e]]})}}function r7(e,t,n,o,a,l,u,c){var d=2&t;if(!d&&"function"!=typeof e)throw new eO(i);var h=o?o.length:0;if(h||(t&=-97,o=a=r),u=r===u?u:t2(o6(u),0),c=r===c?c:o6(c),h-=a?a.length:0,64&t){var f=o,p=a;o=a=r}var g=d?r:ia(e),m=[e,t,n,o,a,f,p,l,u,c];if(g&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(o||a){1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?rF(u,l,t[4]):l,e[4]=u?t$(e[3],s):t[4]}(l=t[5])&&(u=e[5],e[5]=u?rB(u,l,t[6]):l,e[6]=u?t$(e[5],s):t[6]),(l=t[7])&&(e[7]=l),128&r&&(e[8]=null==e[8]?t[8]:t5(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}}(m,g),e=m[0],t=m[1],n=m[2],o=m[3],a=m[4],(c=m[9]=m[9]===r?d?0:e.length:t2(m[9]-h,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?M=function(e,t,n){var i=rK(e);function o(){for(var s=arguments.length,a=ey(s),l=s,u=iu(o);l--;)a[l]=arguments[l];var c=s<3&&a[0]!==u&&a[s-1]!==u?[]:t$(a,u);return(s-=c.length)<n?r3(e,t,rY,o.placeholder,r,a,c,r,r,n-s):ta(this&&this!==e4&&this instanceof o?i:e,this,a)}return o}(e,t,c):32!=t&&33!=t||a.length?M=rY.apply(r,m):(v=e,y=t,b=n,x=o,w=1&y,_=rK(v),M=function e(){for(var t=-1,n=arguments.length,r=-1,i=x.length,o=ey(i+n),s=this&&this!==e4&&this instanceof e?_:v;++r<i;)o[r]=x[r];for(;n--;)o[r++]=arguments[++t];return ta(s,w?b:this,o)});else var v,y,b,x,w,_,k,S,C,O,E,M=(k=e,S=t,C=n,O=1&S,E=rK(k),function e(){return(this&&this!==e4&&this instanceof e?E:k).apply(O?C:this,arguments)});return iD((g?rf:iT)(M,m),e,t)}function r9(e,t,n,i){return r===e||oI(e,eA[n])&&!eR.call(i,n)?t:e}function ie(e,t,n,i,o,s){return oQ(e)&&oQ(t)&&(s.set(t,e),rr(e,t,r,ie,s),s.delete(t)),e}function it(e){return oY(e)?r:e}function ir(e,t,n,i,o,s){var a=1&n,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&n?new n_:r;for(s.set(e,t),s.set(t,e);++h<l;){var g=e[h],m=t[h];if(i)var v=a?i(m,g,h,t,e,s):i(g,m,h,e,t,s);if(r!==v){if(v)continue;f=!1;break}if(p){if(!ty(t,function(e,t){if(!tD(p,t)&&(g===e||o(g,e,n,i,s)))return p.push(t)})){f=!1;break}}else if(!(g===m||o(g,m,n,i,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function ii(e){return iI(iM(e,r,iq),e+"")}function io(e){return nX(e,sp,ig)}function is(e){return nX(e,sg,im)}var ia=ni?function(e){return ni.get(e)}:sU;function il(e){for(var t=e.name+"",n=no[t],r=eR.call(no,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function iu(e){return(eR.call(np,"placeholder")?np:e).placeholder}function ic(){var e=np.iteratee||sV;return e=e===sV?n6:e,arguments.length?e(arguments[0],arguments[1]):e}function id(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ih(e){for(var t=sp(e),n=t.length;n--;){var r,i=t[n],o=e[i];t[n]=[i,o,(r=o)==r&&!oQ(r)]}return t}function ip(e,t){var n=null==e?r:e[t];return n8(n)?n:r}var ig=tY?function(e){return null==e?[]:td(tY(e=ek(e)),function(t){return eK.call(e,t)})}:sZ,im=tY?function(e){for(var t=[];e;)tg(t,ig(e)),e=e$(e);return t}:sZ,iv=nY;function iy(e,t,n){t=rT(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=iF(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&oq(i)&&iw(s,i)&&(oN(e)||oj(e))}function ib(e){return"function"!=typeof e.constructor||iO(e)?{}:ng(e$(e))}function ix(e){return oN(e)||oj(e)||!!(e5&&e&&e[e5])}function iw(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&eh.test(e))&&e>-1&&e%1==0&&e<t}function i_(e,t,n){if(!oQ(n))return!1;var r=typeof t;return("number"==r?!!(oB(n)&&iw(t,n.length)):"string"==r&&t in n)&&oI(n[t],e)}function ik(e,t){if(oN(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o1(e))||K.test(e)||!Q.test(e)||null!=t&&e in ek(t)}function iS(e){var t=il(e),n=np[t];if("function"!=typeof n||!(t in ny.prototype))return!1;if(e===n)return!0;var r=ia(n);return!!r&&e===r[0]}(t7&&iv(new t7(new ArrayBuffer(1)))!=E||t9&&iv(new t9)!=v||ne&&iv(ne.resolve())!=x||nt&&iv(new nt)!=_||nn&&iv(new nn)!=C)&&(iv=function(e){var t=nY(e),n=t==b?e.constructor:r,i=n?iB(n):"";if(i)switch(i){case ns:return E;case na:return v;case nl:return x;case nu:return _;case nc:return C}return t});var iC=eP?oW:sJ;function iO(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eA)}function iE(e,t){return function(n){return null!=n&&n[e]===t&&(r!==t||e in ek(n))}}function iM(e,t,n){return t=t2(r===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=t2(r.length-t,0),s=ey(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=ey(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),ta(e,this,a)}}function iA(e,t){return t.length<2?e:nG(e,rg(t,0,-1))}function iP(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var iT=iL(rf),iR=tb||function(e,t){return e4.setTimeout(e,t)},iI=iL(rp);function iD(e,t,n){var r,i,o,s=t+"";return iI(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ee,"{\n/* [wrapped with "+t+"] */\n")}(s,(r=(o=s.match(et))?o[1].split(en):[],i=n,tu(u,function(e){var t="_."+e[0];i&e[1]&&!th(r,t)&&r.push(t)}),r.sort())))}function iL(e){var t=0,n=0;return function(){var i=t3(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function ij(e,t){var n=-1,i=e.length,o=i-1;for(t=r===t?i:t;++n<t;){var s=ru(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var iN=(em=(J=oE(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(G,function(e,n,r,i){t.push(r?i.replace(eo,"$1"):n||e)}),t},function(e){return 500===em.size&&em.clear(),e})).cache,J);function iF(e){if("string"==typeof e||o1(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function iB(e){if(null!=e){try{return eT.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function iz(e){if(e instanceof ny)return e.clone();var t=new nv(e.__wrapped__,e.__chain__);return t.__actions__=rz(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var iV=rd(function(e,t){return oz(e)?nN(e,n$(t,1,oz,!0)):[]}),iH=rd(function(e,t){var n=iY(t);return oz(n)&&(n=r),oz(e)?nN(e,n$(t,1,oz,!0),ic(n,2)):[]}),i$=rd(function(e,t){var n=iY(t);return oz(n)&&(n=r),oz(e)?nN(e,n$(t,1,oz,!0),r,n):[]});function iW(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o6(n);return i<0&&(i=t2(r+i,0)),tw(e,ic(t,3),i)}function iU(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var o=i-1;return r!==n&&(o=o6(n),o=n<0?t2(i+o,0):t5(o,i-1)),tw(e,ic(t,3),o,!0)}function iq(e){return(null==e?0:e.length)?n$(e,1):[]}function iQ(e){return e&&e.length?e[0]:r}var iK=rd(function(e){var t=tp(e,rA);return t.length&&t[0]===e[0]?n1(t):[]}),iG=rd(function(e){var t=iY(e),n=tp(e,rA);return t===iY(n)?t=r:n.pop(),n.length&&n[0]===e[0]?n1(n,ic(t,2)):[]}),iX=rd(function(e){var t=iY(e),n=tp(e,rA);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?n1(n,r,t):[]});function iY(e){var t=null==e?0:e.length;return t?e[t-1]:r}var iZ=rd(iJ);function iJ(e,t){return e&&e.length&&t&&t.length?ra(e,t):e}var i0=ii(function(e,t){var n=null==e?0:e.length,r=nR(e,t);return rl(e,tp(t,function(e){return iw(e,n)?+e:e}).sort(rN)),r});function i1(e){return null==e?e:t6.call(e)}var i2=rd(function(e){return r_(n$(e,1,oz,!0))}),i5=rd(function(e){var t=iY(e);return oz(t)&&(t=r),r_(n$(e,1,oz,!0),ic(t,2))}),i3=rd(function(e){var t=iY(e);return t="function"==typeof t?t:r,r_(n$(e,1,oz,!0),r,t)});function i4(e){if(!(e&&e.length))return[];var t=0;return e=td(e,function(e){if(oz(e))return t=t2(e.length,t),!0}),tP(t,function(t){return tp(e,tO(t))})}function i8(e,t){if(!(e&&e.length))return[];var n=i4(e);return null==t?n:tp(n,function(e){return ta(t,r,e)})}var i6=rd(function(e,t){return oz(e)?nN(e,t):[]}),i7=rd(function(e){return rE(td(e,oz))}),i9=rd(function(e){var t=iY(e);return oz(t)&&(t=r),rE(td(e,oz),ic(t,2))}),oe=rd(function(e){var t=iY(e);return t="function"==typeof t?t:r,rE(td(e,oz),r,t)}),ot=rd(i4),on=rd(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,i8(e,n)});function or(e){var t=np(e);return t.__chain__=!0,t}function oi(e,t){return t(e)}var oo=ii(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return nR(t,e)};return!(t>1)&&!this.__actions__.length&&i instanceof ny&&iw(n)?((i=i.slice(n,+n+ +!!t)).__actions__.push({func:oi,args:[o],thisArg:r}),new nv(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),os=rH(function(e,t,n){eR.call(e,n)?++e[n]:nT(e,n,1)}),oa=rG(iW),ol=rG(iU);function ou(e,t){return(oN(e)?tu:nF)(e,ic(t,3))}function oc(e,t){return(oN(e)?function(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}:nB)(e,ic(t,3))}var od=rH(function(e,t,n){eR.call(e,n)?e[n].push(t):nT(e,n,[t])}),oh=rd(function(e,t,n){var r=-1,i="function"==typeof t,o=oB(e)?ey(e.length):[];return nF(e,function(e){o[++r]=i?ta(t,e,n):n2(e,t,n)}),o}),of=rH(function(e,t,n){nT(e,n,t)});function op(e,t){return(oN(e)?tp:re)(e,ic(t,3))}var og=rH(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),om=rd(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i_(e,t[0],t[1])?t=[]:n>2&&i_(t[0],t[1],t[2])&&(t=[t[0]]),ro(e,n$(t,1),[])}),ov=te||function(){return e4.Date.now()};function oy(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,r7(e,128,r,r,r,r,t)}function ob(e,t){var n;if("function"!=typeof t)throw new eO(i);return e=o6(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var ox=rd(function(e,t,n){var r=1;if(n.length){var i=t$(n,iu(ox));r|=32}return r7(e,r,t,n,i)}),ow=rd(function(e,t,n){var r=3;if(n.length){var i=t$(n,iu(ow));r|=32}return r7(t,r,e,n,i)});function o_(e,t,n){t=n?r:t;var i=r7(e,8,r,r,r,r,r,t);return i.placeholder=o_.placeholder,i}function ok(e,t,n){t=n?r:t;var i=r7(e,16,r,r,r,r,r,t);return i.placeholder=ok.placeholder,i}function oS(e,t,n){var o,s,a,l,u,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new eO(i);function g(t){var n=o,i=s;return o=s=r,d=t,l=e.apply(i,n)}function m(e){var n=e-c,i=e-d;return r===c||n>=t||n<0||f&&i>=a}function v(){var e,n,r,i=ov();if(m(i))return y(i);u=iR(v,(e=i-c,n=i-d,r=t-e,f?t5(r,a-n):r))}function y(e){return(u=r,p&&o)?g(e):(o=s=r,l)}function b(){var e,n=ov(),i=m(n);if(o=arguments,s=this,c=n,i){if(r===u)return d=e=c,u=iR(v,t),h?g(e):l;if(f)return rI(u),u=iR(v,t),g(c)}return r===u&&(u=iR(v,t)),l}return t=o9(t)||0,oQ(n)&&(h=!!n.leading,a=(f="maxWait"in n)?t2(o9(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){r!==u&&rI(u),d=0,o=c=s=u=r},b.flush=function(){return r===u?l:y(ov())},b}var oC=rd(function(e,t){return nj(e,1,t)}),oO=rd(function(e,t,n){return nj(e,o9(t)||0,n)});function oE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eO(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(oE.Cache||nw),n}function oM(e){if("function"!=typeof e)throw new eO(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}oE.Cache=nw;var oA=rd(function(e,t){var n=(t=1==t.length&&oN(t[0])?tp(t[0],tR(ic())):tp(n$(t,1),tR(ic()))).length;return rd(function(r){for(var i=-1,o=t5(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ta(e,this,r)})}),oP=rd(function(e,t){var n=t$(t,iu(oP));return r7(e,32,r,t,n)}),oT=rd(function(e,t){var n=t$(t,iu(oT));return r7(e,64,r,t,n)}),oR=ii(function(e,t){return r7(e,256,r,r,r,t)});function oI(e,t){return e===t||e!=e&&t!=t}var oD=r5(nZ),oL=r5(function(e,t){return e>=t}),oj=n5(function(){return arguments}())?n5:function(e){return oK(e)&&eR.call(e,"callee")&&!eK.call(e,"callee")},oN=ey.isArray,oF=tt?tR(tt):function(e){return oK(e)&&nY(e)==O};function oB(e){return null!=e&&oq(e.length)&&!oW(e)}function oz(e){return oK(e)&&oB(e)}var oV=tZ||sJ,oH=tn?tR(tn):function(e){return oK(e)&&nY(e)==f};function o$(e){if(!oK(e))return!1;var t=nY(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oY(e)}function oW(e){if(!oQ(e))return!1;var t=nY(e);return t==g||t==m||"[object AsyncFunction]"==t||"[object Proxy]"==t}function oU(e){return"number"==typeof e&&e==o6(e)}function oq(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function oQ(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function oK(e){return null!=e&&"object"==typeof e}var oG=tr?tR(tr):function(e){return oK(e)&&iv(e)==v};function oX(e){return"number"==typeof e||oK(e)&&nY(e)==y}function oY(e){if(!oK(e)||nY(e)!=b)return!1;var t=e$(e);if(null===t)return!0;var n=eR.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&eT.call(n)==ej}var oZ=ti?tR(ti):function(e){return oK(e)&&nY(e)==w},oJ=to?tR(to):function(e){return oK(e)&&iv(e)==_};function o0(e){return"string"==typeof e||!oN(e)&&oK(e)&&nY(e)==k}function o1(e){return"symbol"==typeof e||oK(e)&&nY(e)==S}var o2=ts?tR(ts):function(e){return oK(e)&&oq(e.length)&&!!eZ[nY(e)]},o5=r5(n9),o3=r5(function(e,t){return e<=t});function o4(e){if(!e)return[];if(oB(e))return o0(e)?tq(e):rz(e);if(e3&&e[e3]){for(var t,n=e[e3](),r=[];!(t=n.next()).done;)r.push(t.value);return r}var i=iv(e);return(i==v?tV:i==_?tW:sk)(e)}function o8(e){return e?(e=o9(e))===a||e===-a?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function o6(e){var t=o8(e),n=t%1;return t==t?n?t-n:t:0}function o7(e){return e?nI(o6(e),0,0xffffffff):0}function o9(e){if("number"==typeof e)return e;if(o1(e))return l;if(oQ(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=oQ(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tT(e);var n=eu.test(e);return n||ed.test(e)?e2(e.slice(2),n?2:8):el.test(e)?l:+e}function se(e){return rV(e,sg(e))}function st(e){return null==e?"":rw(e)}var sn=r$(function(e,t){if(iO(t)||oB(t))return void rV(t,sp(t),e);for(var n in t)eR.call(t,n)&&nE(e,n,t[n])}),sr=r$(function(e,t){rV(t,sg(t),e)}),si=r$(function(e,t,n,r){rV(t,sg(t),e,r)}),so=r$(function(e,t,n,r){rV(t,sp(t),e,r)}),ss=ii(nR),sa=rd(function(e,t){e=ek(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&i_(t[0],t[1],o)&&(i=1);++n<i;)for(var s=t[n],a=sg(s),l=-1,u=a.length;++l<u;){var c=a[l],d=e[c];(r===d||oI(d,eA[c])&&!eR.call(e,c))&&(e[c]=s[c])}return e}),sl=rd(function(e){return e.push(r,ie),ta(sv,r,e)});function su(e,t,n){var i=null==e?r:nG(e,t);return r===i?n:i}function sc(e,t){return null!=e&&iy(e,t,n0)}var sd=rZ(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eL.call(t)),e[t]=n},sN(sz)),sh=rZ(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eL.call(t)),eR.call(e,t)?e[t].push(n):e[t]=[n]},ic),sf=rd(n2);function sp(e){return oB(e)?nS(e):n7(e)}function sg(e){return oB(e)?nS(e,!0):function(e){if(!oQ(e)){var t=e,n=[];if(null!=t)for(var r in ek(t))n.push(r);return n}var i=iO(e),o=[];for(var s in e)"constructor"==s&&(i||!eR.call(e,s))||o.push(s);return o}(e)}var sm=r$(function(e,t,n){rr(e,t,n)}),sv=r$(function(e,t,n,r){rr(e,t,n,r)}),sy=ii(function(e,t){var n={};if(null==e)return n;var r=!1;t=tp(t,function(t){return t=rT(t,e),r||(r=t.length>1),t}),rV(e,is(e),n),r&&(n=nD(n,7,it));for(var i=t.length;i--;)rk(n,t[i]);return n}),sb=ii(function(e,t){return null==e?{}:rs(e,t,function(t,n){return sc(e,n)})});function sx(e,t){if(null==e)return{};var n=tp(is(e),function(e){return[e]});return t=ic(t),rs(e,n,function(e,n){return t(e,n[0])})}var sw=r6(sp),s_=r6(sg);function sk(e){return null==e?[]:tI(e,sp(e))}var sS=rQ(function(e,t,n){return t=t.toLowerCase(),e+(n?sC(t):t)});function sC(e){return sI(st(e).toLowerCase())}function sO(e){return(e=st(e))&&e.replace(ef,tN).replace(eU,"")}var sE=rQ(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),sM=rQ(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),sA=rq("toLowerCase"),sP=rQ(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),sT=rQ(function(e,t,n){return e+(n?" ":"")+sI(t)}),sR=rQ(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),sI=rq("toUpperCase");function sD(e,t,n){if(e=st(e),t=n?r:t,r===t){var i;return(i=e,eG.test(i))?e.match(eQ)||[]:e.match(er)||[]}return e.match(t)||[]}var sL=rd(function(e,t){try{return ta(e,r,t)}catch(e){return o$(e)?e:new ex(e)}}),sj=ii(function(e,t){return tu(t,function(t){nT(e,t=iF(t),ox(e[t],e))}),e});function sN(e){return function(){return e}}var sF=rX(),sB=rX(!0);function sz(e){return e}function sV(e){return n6("function"==typeof e?e:nD(e,1))}var sH=rd(function(e,t){return function(n){return n2(n,e,t)}}),s$=rd(function(e,t){return function(n){return n2(e,n,t)}});function sW(e,t,n){var r=sp(t),i=nK(t,r);null!=n||oQ(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=nK(t,sp(t)));var o=!(oQ(n)&&"chain"in n)||!!n.chain,s=oW(e);return tu(i,function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=rz(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,tg([this.value()],arguments))})}),e}function sU(){}var sq=r0(tp),sQ=r0(tc),sK=r0(ty);function sG(e){return ik(e)?tO(iF(e)):function(t){return nG(t,e)}}var sX=r2(),sY=r2(!0);function sZ(){return[]}function sJ(){return!1}var s0=rJ(function(e,t){return e+t},0),s1=r4("ceil"),s2=rJ(function(e,t){return e/t},1),s5=r4("floor"),s3=rJ(function(e,t){return e*t},1),s4=r4("round"),s8=rJ(function(e,t){return e-t},0);return np.after=function(e,t){if("function"!=typeof t)throw new eO(i);return e=o6(e),function(){if(--e<1)return t.apply(this,arguments)}},np.ary=oy,np.assign=sn,np.assignIn=sr,np.assignInWith=si,np.assignWith=so,np.at=ss,np.before=ob,np.bind=ox,np.bindAll=sj,np.bindKey=ow,np.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return oN(e)?e:[e]},np.chain=or,np.chunk=function(e,t,n){t=(n?i_(e,t,n):r===t)?1:t2(o6(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=ey(tE(i/t));o<i;)a[s++]=rg(e,o,o+=t);return a},np.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},np.concat=function(){var e=arguments.length;if(!e)return[];for(var t=ey(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return tg(oN(n)?rz(n):[n],n$(t,1))},np.cond=function(e){var t=null==e?0:e.length,n=ic();return e=t?tp(e,function(e){if("function"!=typeof e[1])throw new eO(i);return[n(e[0]),e[1]]}):[],rd(function(n){for(var r=-1;++r<t;){var i=e[r];if(ta(i[0],this,n))return ta(i[1],this,n)}})},np.conforms=function(e){var t,n;return n=sp(t=nD(e,1)),function(e){return nL(e,t,n)}},np.constant=sN,np.countBy=os,np.create=function(e,t){var n=ng(e);return null==t?n:nP(n,t)},np.curry=o_,np.curryRight=ok,np.debounce=oS,np.defaults=sa,np.defaultsDeep=sl,np.defer=oC,np.delay=oO,np.difference=iV,np.differenceBy=iH,np.differenceWith=i$,np.drop=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,(t=n||r===t?1:o6(t))<0?0:t,i):[]},np.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,0,(t=i-(t=n||r===t?1:o6(t)))<0?0:t):[]},np.dropRightWhile=function(e,t){return e&&e.length?rC(e,ic(t,3),!0,!0):[]},np.dropWhile=function(e,t){return e&&e.length?rC(e,ic(t,3),!0):[]},np.fill=function(e,t,n,i){var o=null==e?0:e.length;if(!o)return[];n&&"number"!=typeof n&&i_(e,t,n)&&(n=0,i=o);var s=n,a=i,l=e.length;for((s=o6(s))<0&&(s=-s>l?0:l+s),(a=r===a||a>l?l:o6(a))<0&&(a+=l),a=s>a?0:o7(a);s<a;)e[s++]=t;return e},np.filter=function(e,t){return(oN(e)?td:nH)(e,ic(t,3))},np.flatMap=function(e,t){return n$(op(e,t),1)},np.flatMapDeep=function(e,t){return n$(op(e,t),a)},np.flatMapDepth=function(e,t,n){return n=r===n?1:o6(n),n$(op(e,t),n)},np.flatten=iq,np.flattenDeep=function(e){return(null==e?0:e.length)?n$(e,a):[]},np.flattenDepth=function(e,t){return(null==e?0:e.length)?n$(e,t=r===t?1:o6(t)):[]},np.flip=function(e){return r7(e,512)},np.flow=sF,np.flowRight=sB,np.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},np.functions=function(e){return null==e?[]:nK(e,sp(e))},np.functionsIn=function(e){return null==e?[]:nK(e,sg(e))},np.groupBy=od,np.initial=function(e){return(null==e?0:e.length)?rg(e,0,-1):[]},np.intersection=iK,np.intersectionBy=iG,np.intersectionWith=iX,np.invert=sd,np.invertBy=sh,np.invokeMap=oh,np.iteratee=sV,np.keyBy=of,np.keys=sp,np.keysIn=sg,np.map=op,np.mapKeys=function(e,t){var n={};return t=ic(t,3),nq(e,function(e,r,i){nT(n,t(e,r,i),e)}),n},np.mapValues=function(e,t){var n={};return t=ic(t,3),nq(e,function(e,r,i){nT(n,r,t(e,r,i))}),n},np.matches=function(e){return rt(nD(e,1))},np.matchesProperty=function(e,t){return rn(e,nD(t,1))},np.memoize=oE,np.merge=sm,np.mergeWith=sv,np.method=sH,np.methodOf=s$,np.mixin=sW,np.negate=oM,np.nthArg=function(e){return e=o6(e),rd(function(t){return ri(t,e)})},np.omit=sy,np.omitBy=function(e,t){return sx(e,oM(ic(t)))},np.once=function(e){return ob(2,e)},np.orderBy=function(e,t,n,i){return null==e?[]:(oN(t)||(t=null==t?[]:[t]),oN(n=i?r:n)||(n=null==n?[]:[n]),ro(e,t,n))},np.over=sq,np.overArgs=oA,np.overEvery=sQ,np.overSome=sK,np.partial=oP,np.partialRight=oT,np.partition=og,np.pick=sb,np.pickBy=sx,np.property=sG,np.propertyOf=function(e){return function(t){return null==e?r:nG(e,t)}},np.pull=iZ,np.pullAll=iJ,np.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,ic(n,2)):e},np.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,r,n):e},np.pullAt=i0,np.range=sX,np.rangeRight=sY,np.rearg=oR,np.reject=function(e,t){return(oN(e)?td:nH)(e,oM(ic(t,3)))},np.remove=function(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],o=e.length;for(t=ic(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return rl(e,i),n},np.rest=function(e,t){if("function"!=typeof e)throw new eO(i);return rd(e,t=r===t?t:o6(t))},np.reverse=i1,np.sampleSize=function(e,t,n){return t=(n?i_(e,t,n):r===t)?1:o6(t),(oN(e)?function(e,t){return ij(rz(e),nI(t,0,e.length))}:function(e,t){var n=sk(e);return ij(n,nI(t,0,n.length))})(e,t)},np.set=function(e,t,n){return null==e?e:rh(e,t,n)},np.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:rh(e,t,n,i)},np.shuffle=function(e){return(oN(e)?function(e){return ij(rz(e))}:function(e){return ij(sk(e))})(e)},np.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&i_(e,t,n)?(t=0,n=i):(t=null==t?0:o6(t),n=r===n?i:o6(n)),rg(e,t,n)):[]},np.sortBy=om,np.sortedUniq=function(e){return e&&e.length?rb(e):[]},np.sortedUniqBy=function(e,t){return e&&e.length?rb(e,ic(t,2)):[]},np.split=function(e,t,n){return(n&&"number"!=typeof n&&i_(e,t,n)&&(t=n=r),n=r===n?0xffffffff:n>>>0)?(e=st(e))&&("string"==typeof t||null!=t&&!oZ(t))&&!(t=rw(t))&&tz(e)?rR(tq(e),0,n):e.split(t,n):[]},np.spread=function(e,t){if("function"!=typeof e)throw new eO(i);return t=null==t?0:t2(o6(t),0),rd(function(n){var r=n[t],i=rR(n,0,t);return r&&tg(i,r),ta(e,this,i)})},np.tail=function(e){var t=null==e?0:e.length;return t?rg(e,1,t):[]},np.take=function(e,t,n){return e&&e.length?rg(e,0,(t=n||r===t?1:o6(t))<0?0:t):[]},np.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,(t=i-(t=n||r===t?1:o6(t)))<0?0:t,i):[]},np.takeRightWhile=function(e,t){return e&&e.length?rC(e,ic(t,3),!1,!0):[]},np.takeWhile=function(e,t){return e&&e.length?rC(e,ic(t,3)):[]},np.tap=function(e,t){return t(e),e},np.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new eO(i);return oQ(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),oS(e,t,{leading:r,maxWait:t,trailing:o})},np.thru=oi,np.toArray=o4,np.toPairs=sw,np.toPairsIn=s_,np.toPath=function(e){return oN(e)?tp(e,iF):o1(e)?[e]:rz(iN(st(e)))},np.toPlainObject=se,np.transform=function(e,t,n){var r=oN(e),i=r||oV(e)||o2(e);if(t=ic(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:oQ(e)&&oW(o)?ng(e$(e)):{}}return(i?tu:nq)(e,function(e,r,i){return t(n,e,r,i)}),n},np.unary=function(e){return oy(e,1)},np.union=i2,np.unionBy=i5,np.unionWith=i3,np.uniq=function(e){return e&&e.length?r_(e):[]},np.uniqBy=function(e,t){return e&&e.length?r_(e,ic(t,2)):[]},np.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?r_(e,r,t):[]},np.unset=function(e,t){return null==e||rk(e,t)},np.unzip=i4,np.unzipWith=i8,np.update=function(e,t,n){return null==e?e:rS(e,t,rP(n))},np.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:rS(e,t,rP(n),i)},np.values=sk,np.valuesIn=function(e){return null==e?[]:tI(e,sg(e))},np.without=i6,np.words=sD,np.wrap=function(e,t){return oP(rP(t),e)},np.xor=i7,np.xorBy=i9,np.xorWith=oe,np.zip=ot,np.zipObject=function(e,t){return rM(e||[],t||[],nE)},np.zipObjectDeep=function(e,t){return rM(e||[],t||[],rh)},np.zipWith=on,np.entries=sw,np.entriesIn=s_,np.extend=sr,np.extendWith=si,sW(np,np),np.add=s0,np.attempt=sL,np.camelCase=sS,np.capitalize=sC,np.ceil=s1,np.clamp=function(e,t,n){return r===n&&(n=t,t=r),r!==n&&(n=(n=o9(n))==n?n:0),r!==t&&(t=(t=o9(t))==t?t:0),nI(o9(e),t,n)},np.clone=function(e){return nD(e,4)},np.cloneDeep=function(e){return nD(e,5)},np.cloneDeepWith=function(e,t){return nD(e,5,t="function"==typeof t?t:r)},np.cloneWith=function(e,t){return nD(e,4,t="function"==typeof t?t:r)},np.conformsTo=function(e,t){return null==t||nL(e,t,sp(t))},np.deburr=sO,np.defaultTo=function(e,t){return null==e||e!=e?t:e},np.divide=s2,np.endsWith=function(e,t,n){e=st(e),t=rw(t);var i=e.length,o=n=r===n?i:nI(o6(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},np.eq=oI,np.escape=function(e){return(e=st(e))&&$.test(e)?e.replace(V,tF):e},np.escapeRegExp=function(e){return(e=st(e))&&Y.test(e)?e.replace(X,"\\$&"):e},np.every=function(e,t,n){var i=oN(e)?tc:nz;return n&&i_(e,t,n)&&(t=r),i(e,ic(t,3))},np.find=oa,np.findIndex=iW,np.findKey=function(e,t){return tx(e,ic(t,3),nq)},np.findLast=ol,np.findLastIndex=iU,np.findLastKey=function(e,t){return tx(e,ic(t,3),nQ)},np.floor=s5,np.forEach=ou,np.forEachRight=oc,np.forIn=function(e,t){return null==e?e:nW(e,ic(t,3),sg)},np.forInRight=function(e,t){return null==e?e:nU(e,ic(t,3),sg)},np.forOwn=function(e,t){return e&&nq(e,ic(t,3))},np.forOwnRight=function(e,t){return e&&nQ(e,ic(t,3))},np.get=su,np.gt=oD,np.gte=oL,np.has=function(e,t){return null!=e&&iy(e,t,nJ)},np.hasIn=sc,np.head=iQ,np.identity=sz,np.includes=function(e,t,n,r){e=oB(e)?e:sk(e),n=n&&!r?o6(n):0;var i=e.length;return n<0&&(n=t2(i+n,0)),o0(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&t_(e,t,n)>-1},np.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o6(n);return i<0&&(i=t2(r+i,0)),t_(e,t,i)},np.inRange=function(e,t,n){var i,o,s;return t=o8(t),r===n?(n=t,t=0):n=o8(n),(i=e=o9(e))>=t5(o=t,s=n)&&i<t2(o,s)},np.invoke=sf,np.isArguments=oj,np.isArray=oN,np.isArrayBuffer=oF,np.isArrayLike=oB,np.isArrayLikeObject=oz,np.isBoolean=function(e){return!0===e||!1===e||oK(e)&&nY(e)==h},np.isBuffer=oV,np.isDate=oH,np.isElement=function(e){return oK(e)&&1===e.nodeType&&!oY(e)},np.isEmpty=function(e){if(null==e)return!0;if(oB(e)&&(oN(e)||"string"==typeof e||"function"==typeof e.splice||oV(e)||o2(e)||oj(e)))return!e.length;var t=iv(e);if(t==v||t==_)return!e.size;if(iO(e))return!n7(e).length;for(var n in e)if(eR.call(e,n))return!1;return!0},np.isEqual=function(e,t){return n3(e,t)},np.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return r===i?n3(e,t,r,n):!!i},np.isError=o$,np.isFinite=function(e){return"number"==typeof e&&tJ(e)},np.isFunction=oW,np.isInteger=oU,np.isLength=oq,np.isMap=oG,np.isMatch=function(e,t){return e===t||n4(e,t,ih(t))},np.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,n4(e,t,ih(t),n)},np.isNaN=function(e){return oX(e)&&e!=+e},np.isNative=function(e){if(iC(e))throw new ex("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return n8(e)},np.isNil=function(e){return null==e},np.isNull=function(e){return null===e},np.isNumber=oX,np.isObject=oQ,np.isObjectLike=oK,np.isPlainObject=oY,np.isRegExp=oZ,np.isSafeInteger=function(e){return oU(e)&&e>=-0x1fffffffffffff&&e<=0x1fffffffffffff},np.isSet=oJ,np.isString=o0,np.isSymbol=o1,np.isTypedArray=o2,np.isUndefined=function(e){return r===e},np.isWeakMap=function(e){return oK(e)&&iv(e)==C},np.isWeakSet=function(e){return oK(e)&&"[object WeakSet]"==nY(e)},np.join=function(e,t){return null==e?"":t0.call(e,t)},np.kebabCase=sE,np.last=iY,np.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var o=i;return r!==n&&(o=(o=o6(n))<0?t2(i+o,0):t5(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--&&e[r]!==t;);return r}(e,t,o):tw(e,tS,o,!0)},np.lowerCase=sM,np.lowerFirst=sA,np.lt=o5,np.lte=o3,np.max=function(e){return e&&e.length?nV(e,sz,nZ):r},np.maxBy=function(e,t){return e&&e.length?nV(e,ic(t,2),nZ):r},np.mean=function(e){return tC(e,sz)},np.meanBy=function(e,t){return tC(e,ic(t,2))},np.min=function(e){return e&&e.length?nV(e,sz,n9):r},np.minBy=function(e,t){return e&&e.length?nV(e,ic(t,2),n9):r},np.stubArray=sZ,np.stubFalse=sJ,np.stubObject=function(){return{}},np.stubString=function(){return""},np.stubTrue=function(){return!0},np.multiply=s3,np.nth=function(e,t){return e&&e.length?ri(e,o6(t)):r},np.noConflict=function(){return e4._===this&&(e4._=eN),this},np.noop=sU,np.now=ov,np.pad=function(e,t,n){e=st(e);var r=(t=o6(t))?tU(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return r1(tX(i),n)+e+r1(tE(i),n)},np.padEnd=function(e,t,n){e=st(e);var r=(t=o6(t))?tU(e):0;return t&&r<t?e+r1(t-r,n):e},np.padStart=function(e,t,n){e=st(e);var r=(t=o6(t))?tU(e):0;return t&&r<t?r1(t-r,n)+e:e},np.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t*=1),t4(st(e).replace(Z,""),t||0)},np.random=function(e,t,n){if(n&&"boolean"!=typeof n&&i_(e,t,n)&&(t=n=r),r===n&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),r===e&&r===t?(e=0,t=1):(e=o8(e),r===t?(t=e,e=0):t=o8(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=t8();return t5(e+o*(t-e+e1("1e-"+((o+"").length-1))),t)}return ru(e,t)},np.reduce=function(e,t,n){var r=oN(e)?tm:tM,i=arguments.length<3;return r(e,ic(t,4),n,i,nF)},np.reduceRight=function(e,t,n){var r=oN(e)?tv:tM,i=arguments.length<3;return r(e,ic(t,4),n,i,nB)},np.repeat=function(e,t,n){return t=(n?i_(e,t,n):r===t)?1:o6(t),rc(st(e),t)},np.replace=function(){var e=arguments,t=st(e[0]);return e.length<3?t:t.replace(e[1],e[2])},np.result=function(e,t,n){t=rT(t,e);var i=-1,o=t.length;for(o||(o=1,e=r);++i<o;){var s=null==e?r:e[iF(t[i])];r===s&&(i=o,s=n),e=oW(s)?s.call(e):s}return e},np.round=s4,np.runInContext=e,np.sample=function(e){return(oN(e)?nC:function(e){return nC(sk(e))})(e)},np.size=function(e){if(null==e)return 0;if(oB(e))return o0(e)?tU(e):e.length;var t=iv(e);return t==v||t==_?e.size:n7(e).length},np.snakeCase=sP,np.some=function(e,t,n){var i=oN(e)?ty:rm;return n&&i_(e,t,n)&&(t=r),i(e,ic(t,3))},np.sortedIndex=function(e,t){return rv(e,t)},np.sortedIndexBy=function(e,t,n){return ry(e,t,ic(n,2))},np.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=rv(e,t);if(r<n&&oI(e[r],t))return r}return -1},np.sortedLastIndex=function(e,t){return rv(e,t,!0)},np.sortedLastIndexBy=function(e,t,n){return ry(e,t,ic(n,2),!0)},np.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=rv(e,t,!0)-1;if(oI(e[n],t))return n}return -1},np.startCase=sT,np.startsWith=function(e,t,n){return e=st(e),n=null==n?0:nI(o6(n),0,e.length),t=rw(t),e.slice(n,n+t.length)==t},np.subtract=s8,np.sum=function(e){return e&&e.length?tA(e,sz):0},np.sumBy=function(e,t){return e&&e.length?tA(e,ic(t,2)):0},np.template=function(e,t,n){var i=np.templateSettings;n&&i_(e,t,n)&&(t=r),e=st(e),t=si({},t,i,r9);var o,s,a=si({},t.imports,i.imports,r9),l=sp(a),u=tI(a,l),c=0,d=t.interpolate||ep,h="__p += '",f=eS((t.escape||ep).source+"|"+d.source+"|"+(d===q?es:ep).source+"|"+(t.evaluate||ep).source+"|$","g"),p="//# sourceURL="+(eR.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eY+"]")+"\n";e.replace(f,function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(c,l).replace(eg,tB),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t}),h+="';\n";var g=eR.call(t,"variable")&&t.variable;if(g){if(ei.test(g))throw new ex("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(N,""):h).replace(F,"$1").replace(B,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=sL(function(){return ew(l,p+"return "+h).apply(r,u)});if(m.source=h,o$(m))throw m;return m},np.times=function(e,t){if((e=o6(e))<1||e>0x1fffffffffffff)return[];var n=0xffffffff,r=t5(e,0xffffffff);t=ic(t),e-=0xffffffff;for(var i=tP(r,t);++n<e;)t(n);return i},np.toFinite=o8,np.toInteger=o6,np.toLength=o7,np.toLower=function(e){return st(e).toLowerCase()},np.toNumber=o9,np.toSafeInteger=function(e){return e?nI(o6(e),-0x1fffffffffffff,0x1fffffffffffff):0===e?e:0},np.toString=st,np.toUpper=function(e){return st(e).toUpperCase()},np.trim=function(e,t,n){if((e=st(e))&&(n||r===t))return tT(e);if(!e||!(t=rw(t)))return e;var i=tq(e),o=tq(t),s=tL(i,o),a=tj(i,o)+1;return rR(i,s,a).join("")},np.trimEnd=function(e,t,n){if((e=st(e))&&(n||r===t))return e.slice(0,tQ(e)+1);if(!e||!(t=rw(t)))return e;var i=tq(e),o=tj(i,tq(t))+1;return rR(i,0,o).join("")},np.trimStart=function(e,t,n){if((e=st(e))&&(n||r===t))return e.replace(Z,"");if(!e||!(t=rw(t)))return e;var i=tq(e),o=tL(i,tq(t));return rR(i,o).join("")},np.truncate=function(e,t){var n=30,i="...";if(oQ(t)){var o="separator"in t?t.separator:o;n="length"in t?o6(t.length):n,i="omission"in t?rw(t.omission):i}var s=(e=st(e)).length;if(tz(e)){var a=tq(e);s=a.length}if(n>=s)return e;var l=n-tU(i);if(l<1)return i;var u=a?rR(a,0,l).join(""):e.slice(0,l);if(r===o)return u+i;if(a&&(l+=u.length-l),oZ(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=eS(o.source,st(ea.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var h=c.index;u=u.slice(0,r===h?l:h)}}else if(e.indexOf(rw(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},np.unescape=function(e){return(e=st(e))&&H.test(e)?e.replace(z,tK):e},np.uniqueId=function(e){var t=++eI;return st(e)+t},np.upperCase=sR,np.upperFirst=sI,np.each=ou,np.eachRight=oc,np.first=iQ,sW(np,(ev={},nq(np,function(e,t){eR.call(np.prototype,t)||(ev[t]=e)}),ev),{chain:!1}),np.VERSION="4.17.21",tu(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){np[e].placeholder=np}),tu(["drop","take"],function(e,t){ny.prototype[e]=function(n){n=r===n?1:t2(o6(n),0);var i=this.__filtered__&&!t?new ny(this):this.clone();return i.__filtered__?i.__takeCount__=t5(n,i.__takeCount__):i.__views__.push({size:t5(n,0xffffffff),type:e+(i.__dir__<0?"Right":"")}),i},ny.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),tu(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;ny.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ic(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),tu(["head","last"],function(e,t){var n="take"+(t?"Right":"");ny.prototype[e]=function(){return this[n](1).value()[0]}}),tu(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ny.prototype[e]=function(){return this.__filtered__?new ny(this):this[n](1)}}),ny.prototype.compact=function(){return this.filter(sz)},ny.prototype.find=function(e){return this.filter(e).head()},ny.prototype.findLast=function(e){return this.reverse().find(e)},ny.prototype.invokeMap=rd(function(e,t){return"function"==typeof e?new ny(this):this.map(function(n){return n2(n,e,t)})}),ny.prototype.reject=function(e){return this.filter(oM(ic(e)))},ny.prototype.slice=function(e,t){e=o6(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ny(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(t=o6(t))<0?n.dropRight(-t):n.take(t-e)),n)},ny.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ny.prototype.toArray=function(){return this.take(0xffffffff)},nq(ny.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=np[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(np.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof ny,u=a[0],c=l||oN(t),d=function(e){var t=o.apply(np,tg([e],a));return i&&h?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,g=l&&!f;if(!s&&c){t=g?t:new ny(this);var m=e.apply(t,a);return m.__actions__.push({func:oi,args:[d],thisArg:r}),new nv(m,h)}return p&&g?e.apply(this,a):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),tu(["pop","push","shift","sort","splice","unshift"],function(e){var t=eE[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);np.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(oN(i)?i:[],e)}return this[n](function(n){return t.apply(oN(n)?n:[],e)})}}),nq(ny.prototype,function(e,t){var n=np[t];if(n){var r=n.name+"";eR.call(no,r)||(no[r]=[]),no[r].push({name:t,func:n})}}),no[rY(r,2).name]=[{name:"wrapper",func:r}],ny.prototype.clone=function(){var e=new ny(this.__wrapped__);return e.__actions__=rz(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=rz(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=rz(this.__views__),e},ny.prototype.reverse=function(){if(this.__filtered__){var e=new ny(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},ny.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=oN(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=t5(t,e+s);break;case"takeRight":e=t2(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,d=c.length,h=0,f=t5(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return rO(e,this.__actions__);var p=[];e:for(;l--&&h<f;){for(var g=-1,m=e[u+=t];++g<d;){var v=c[g],y=v.iteratee,b=v.type,x=y(m);if(2==b)m=x;else if(!x)if(1==b)continue e;else break e}p[h++]=m}return p},np.prototype.at=oo,np.prototype.chain=function(){return or(this)},np.prototype.commit=function(){return new nv(this.value(),this.__chain__)},np.prototype.next=function(){this.__values__===r&&(this.__values__=o4(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},np.prototype.plant=function(e){for(var t,n=this;n instanceof nm;){var i=iz(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},np.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof ny){var t=e;return this.__actions__.length&&(t=new ny(this)),(t=t.reverse()).__actions__.push({func:oi,args:[i1],thisArg:r}),new nv(t,this.__chain__)}return this.thru(i1)},np.prototype.toJSON=np.prototype.valueOf=np.prototype.value=function(){return rO(this.__wrapped__,this.__actions__)},np.prototype.first=np.prototype.head,e3&&(np.prototype[e3]=function(){return this}),np}();if("function"==typeof define&&"object"==typeof define.amd&&define.amd)e4._=tG,e.r,r!==tG&&e.v(tG);else e6?((e6.exports=tG)._=tG,e8._=tG):e4._=tG}).call(e.e)},645364,400905,573478,520584,e=>{"use strict";let t,n;var r=e.i(19483),i=e.i(324066),o=e.i(992089),s=e.i(384339),a=e.i(320182),l=e.i(228337),u=e.i(187725),c=e.i(420856),d=e.i(916955);function h(e,t){let n=[];return e.forEach(e=>{n.some(t=>t.name===e.name)||n.push(e)}),t.forEach(e=>{n.some(t=>t.name===e.name)||n.push(e)}),n}let f=e=>{let{lineageGraph:t}=(0,d.useLineageGraphContext)(),n=l.default.find(t?.nodes,{data:{name:e}}),r=(0,u.useMemo)(()=>n?function(e){function t(e){return e?.columns?Object.values(e.columns).filter(e=>null!=e):[]}return h(t(e.data.data.base),t(e.data.data.current))}(n):[],[n]),[i,o]=(0,u.useState)([]),[s,a]=(0,u.useState)(),[f,p]=(0,u.useState)(!0),[g,m]=(0,u.useState)(null),[v,y]=(0,u.useState)([]),[b,x]=(0,u.useState)(n?.id),w=n?n.data.data.current?.primary_key:void 0,_=(0,u.useCallback)(async()=>{if(n)try{let e=(await (0,c.getModelInfo)(n.id)).model;if(!e.base.columns||!e.current.columns)return void o([]);a(e.current.primary_key);let t=Object.values(e.base.columns),r=Object.values(e.current.columns);o(h(t,r))}catch(e){m(e)}},[n]);return(r!==v||n?.id!==b)&&(y(r),x(n?.id),r.length>0?(o(r),a(w),p(!1)):n?.id===void 0&&(o([]),p(!1))),(0,u.useEffect)(()=>{0===r.length&&n?.id!==void 0&&(_().catch(e=>{console.error(e)}),p(!1))},[_,n?.id,r]),{columns:i,primaryKey:s,isLoading:f,error:g}};function p(e){let t=e.trim().toUpperCase();return!!["CHAR","VARCHAR","TINYTEXT","TEXT","MEDIUMTEXT","LONGTEXT","NCHAR","NVARCHAR","VARCHAR2","NVARCHAR2","CLOB","NCLOB","VARCHAR(MAX)","XML","JSON"].includes(t)||/^(VARCHAR|NVARCHAR|VARCHAR2|NVARCHAR2|CHAR|NCHAR)\(\d+\)$/.test(t)}function g(e){return["BOOLEAN","TINYINT(1)","BIT","NUMBER(1)","BOOL"].includes(e.toUpperCase())}function m(e){return["DATE","DATETIME","TIMESTAMP","TIME","YEAR","DATETIME2","SMALLDATETIME","DATETIMEOFFSET","INTERVAL","TIMESTAMPTZ","TIMETZ","TIMESTAMP WITH TIME ZONE","TIMESTAMP WITH LOCAL TIME ZONE","TIMESTAMP_LTZ","TIMESTAMP_NTZ","TIMESTAMP_TZ"].includes(e.toUpperCase())}function v(e){return!p(e)&&!g(e)&&!m(e)}function y({params:e,onParamsChanged:t,setIsReadyToExecute:n}){let{columns:l,isLoading:u,error:c}=f(e.model),d=l.filter(e=>!p(e.type)&&!g(e.type)&&!m(e.type));return u?(0,r.jsx)(i.default,{children:"Loading..."}):0===l.length||c?(0,r.jsx)(i.default,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,r.jsx)(i.default,{sx:{m:"16px"},children:(0,r.jsxs)(o.default,{fullWidth:!0,disabled:0===d.length,children:[(0,r.jsx)(s.default,{sx:{mb:1},children:"Pick a column to show Histogram Diff"}),(0,r.jsxs)(a.default,{value:e.column_name,onChange:r=>{let i=r.target.value;n(!!i);let o=d.find(e=>e.name===i)?.type??"";t({...e,column_name:i,column_type:o})},children:[(0,r.jsx)("option",{value:"",children:0!==d.length?"Select column":"No numeric column is available"}),d.map(e=>(0,r.jsxs)("option",{value:e.name,className:"no-track-pii-safe",children:[e.name," : ",e.type]},e.name))]})]})})}function b(e){return e+.5|0}e.s(["default",0,f],400905),e.s(["HistogramDiffForm",()=>y,"supportsHistogramDiff",()=>v],645364);let x=(e,t,n)=>Math.max(Math.min(e,n),t);function w(e){return x(b(2.55*e),0,255)}function _(e){return x(b(255*e),0,255)}function k(e){return x(b(e/2.55)/100,0,1)}function S(e){return x(b(100*e),0,100)}let C={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},O=[..."0123456789ABCDEF"],E=e=>O[15&e],M=e=>O[(240&e)>>4]+O[15&e],A=e=>(240&e)>>4==(15&e),P=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function T(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function R(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function I(e,t,n){let r,i=T(e,1,.5);for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function D(e){let t,n,r,i=e.r/255,o=e.g/255,s=e.b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),u=(a+l)/2;a!==l&&(r=a-l,n=u>.5?r/(2-a-l):r/(a+l),t=60*(t=i===a?(o-s)/r+6*(o<s):o===a?(s-i)/r+2:(i-o)/r+4)+.5);return[0|t,n||0,u]}function L(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(_)}function j(e){return(e%360+360)%360}let N={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},F={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"},B=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,z=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,V=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function H(e,t,n){if(e){let r=D(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),e.r=(r=L(T,r,void 0,void 0))[0],e.g=r[1],e.b=r[2]}}function $(e,t){return e?Object.assign(t||{},e):e}function W(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=_(e[3]))):(t=$(e,{r:0,g:0,b:0,a:1})).a=_(t.a),t}class U{constructor(e){let n;if(e instanceof U)return e;const r=typeof e;"object"===r?n=W(e):"string"===r&&(n=function(e){var t,n=e.length;return"#"===e[0]&&(4===n||5===n?t={r:255&17*C[e[1]],g:255&17*C[e[2]],b:255&17*C[e[3]],a:5===n?17*C[e[4]]:255}:(7===n||9===n)&&(t={r:C[e[1]]<<4|C[e[2]],g:C[e[3]]<<4|C[e[4]],b:C[e[5]]<<4|C[e[6]],a:9===n?C[e[7]]<<4|C[e[8]]:255})),t}(e)||function(e){t||((t=function(){let e,t,n,r,i,o={},s=Object.keys(F),a=Object.keys(N);for(e=0;e<s.length;e++){for(t=0,r=i=s[e];t<a.length;t++)n=a[t],i=i.replace(n,N[n]);n=parseInt(F[r],16),o[i]=[n>>16&255,n>>8&255,255&n]}return o}()).transparent=[0,0,0,0]);let n=t[e.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:4===n.length?n[3]:255}}(e)||function(e){return"r"===e.charAt(0)?function(e){let t,n,r,i=B.exec(e),o=255;if(i){if(i[7]!==t){let e=+i[7];o=i[8]?w(e):x(255*e,0,255)}return t=+i[1],n=+i[3],r=+i[5],t=255&(i[2]?w(t):x(t,0,255)),{r:t,g:n=255&(i[4]?w(n):x(n,0,255)),b:r=255&(i[6]?w(r):x(r,0,255)),a:o}}}(e):function(e){let t,n=P.exec(e),r=255;if(!n)return;n[5]!==t&&(r=n[6]?w(+n[5]):_(+n[5]));let i=j(+n[2]),o=n[3]/100,s=n[4]/100;return{r:(t="hwb"===n[1]?L(I,i,o,s):"hsv"===n[1]?L(R,i,o,s):L(T,i,o,s))[0],g:t[1],b:t[2],a:r}}(e)}(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=$(this._rgb);return e&&(e.a=k(e.a)),e}set rgb(e){this._rgb=W(e)}rgbString(){var e;return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${k(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0}hexString(){var e,t;let n,r;return this._valid?(t=A((n=e=this._rgb).r)&&A(n.g)&&A(n.b)&&A(n.a)?E:M,e?"#"+t(e.r)+t(e.g)+t(e.b)+(r=e.a,r<255?t(r):""):void 0):void 0}hslString(){return this._valid?function(e){if(!e)return;let t=D(e),n=t[0],r=S(t[1]),i=S(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${k(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}(this._rgb):void 0}mix(e,t){if(e){let n,r=this.rgb,i=e.rgb,o=t===n?.5:t,s=2*o-1,a=r.a-i.a,l=((s*a==-1?s:(s+a)/(1+s*a))+1)/2;n=1-l,r.r=255&l*r.r+n*i.r+.5,r.g=255&l*r.g+n*i.g+.5,r.b=255&l*r.b+n*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(e,t){var n,r;let i,o,s;return e&&(this._rgb=(n=this._rgb,r=e._rgb,i=V(k(n.r)),o=V(k(n.g)),s=V(k(n.b)),{r:_(z(i+t*(V(k(r.r))-i))),g:_(z(o+t*(V(k(r.g))-o))),b:_(z(s+t*(V(k(r.b))-s))),a:n.a+t*(r.a-n.a)})),this}clone(){return new U(this.rgb)}alpha(e){return this._rgb.a=_(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=b(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return H(this._rgb,2,e),this}darken(e){return H(this._rgb,2,-e),this}saturate(e){return H(this._rgb,1,e),this}desaturate(e){return H(this._rgb,1,-e),this}rotate(e){var t,n;return t=this._rgb,(n=D(t))[0]=j(n[0]+e),t.r=(n=L(T,n,void 0,void 0))[0],t.g=n[1],t.b=n[2],this}}function q(){}let Q=(n=0,()=>n++);function K(e){return null==e}function G(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function X(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function Y(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function Z(e,t){return Y(e)?e:t}function J(e,t){return void 0===e?t:e}let ee=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function et(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function en(e,t,n,r){let i,o,s;if(G(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(X(e))for(i=0,o=(s=Object.keys(e)).length;i<o;i++)t.call(n,e[s[i]],s[i])}function er(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function ei(e){if(G(e))return e.map(ei);if(X(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=ei(e[n[i]]);return t}return e}function eo(e){return -1===["__proto__","prototype","constructor"].indexOf(e)}function es(e,t,n,r){if(!eo(e))return;let i=t[e],o=n[e];X(i)&&X(o)?ea(i,o,r):t[e]=ei(o)}function ea(e,t,n){let r,i=G(t)?t:[t],o=i.length;if(!X(e))return e;let s=(n=n||{}).merger||es;for(let t=0;t<o;++t){if(!X(r=i[t]))continue;let o=Object.keys(r);for(let t=0,i=o.length;t<i;++t)s(o[t],e,r,n)}return e}function el(e,t){return ea(e,t,{merger:eu})}function eu(e,t,n){if(!eo(e))return;let r=t[e],i=n[e];X(r)&&X(i)?el(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ei(i))}let ec={"":e=>e,x:e=>e.x,y:e=>e.y};function ed(e,t){let n;return(ec[t]||(ec[t]=(n=function(e){let t=e.split("."),n=[],r="";for(let e of t)(r+=e).endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}(t),e=>{for(let t of n){if(""===t)break;e=e&&e[t]}return e})))(e)}function eh(e){return e.charAt(0).toUpperCase()+e.slice(1)}let ef=e=>void 0!==e,ep=e=>"function"==typeof e,eg=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0},em=Math.PI,ev=2*em,ey=ev+em,eb=1/0,ex=em/180,ew=em/2,e_=em/4,ek=2*em/3,eS=Math.log10,eC=Math.sign;function eO(e,t,n){return Math.abs(e-t)<n}function eE(e){let t=Math.round(e),n=Math.pow(10,Math.floor(eS(e=eO(e,t,e/1e3)?t:e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function eM(e){return"symbol"!=typeof e&&("object"!=typeof e||null===e||!!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e))&&!isNaN(parseFloat(e))&&isFinite(e)}function eA(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)isNaN(o=e[r][n])||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function eP(e){return em/180*e}function eT(e){if(!Y(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function eR(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),o=Math.atan2(r,n);return o<-.5*em&&(o+=ev),{angle:o,distance:i}}function eI(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function eD(e,t){return(e-t+ey)%ev-em}function eL(e){return(e%ev+ev)%ev}function ej(e,t,n,r){let i=eL(e),o=eL(t),s=eL(n),a=eL(o-i),l=eL(s-i),u=eL(i-o),c=eL(i-s);return i===o||i===s||r&&o===s||a>l&&u<c}function eN(e,t,n){return Math.max(t,Math.min(n,e))}function eF(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function eB(e,t,n){let r;n=n||(n=>e[n]<t);let i=e.length-1,o=0;for(;i-o>1;)n(r=o+i>>1)?o=r:i=r;return{lo:o,hi:i}}let ez=(e,t,n,r)=>eB(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),eV=(e,t,n)=>eB(e,n,r=>e[r][t]>=n),eH=["push","pop","shift","splice","unshift"];function e$(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);-1!==i&&r.splice(i,1),r.length>0||(eH.forEach(t=>{delete e[t]}),delete e._chartjs)}function eW(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}let eU="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function eq(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,eU.call(window,()=>{r=!1,e.apply(t,n)}))}}let eQ=e=>"start"===e?"left":"end"===e?"right":"center",eK=(e,t,n)=>"start"===e?t:"end"===e?n:(t+n)/2;function eG(e,t,n){let r=t.length,i=0,o=r;if(e._sorted){let{iScale:s,vScale:a,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=s.axis,{min:d,max:h,minDefined:f,maxDefined:p}=s.getUserBounds();if(f){if(i=Math.min(ez(l,c,d).lo,n?r:ez(t,c,s.getPixelForValue(d)).lo),u){let e=l.slice(0,i+1).reverse().findIndex(e=>!K(e[a.axis]));i-=Math.max(0,e)}i=eN(i,0,r-1)}if(p){let e=Math.max(ez(l,s.axis,h,!0).hi+1,n?0:ez(t,c,s.getPixelForValue(h),!0).hi+1);if(u){let t=l.slice(e-1).findIndex(e=>!K(e[a.axis]));e+=Math.max(0,t)}o=eN(e,i,r)-i}else o=r-i}return{start:i,count:o}}function eX(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}let eY=e=>0===e||1===e,eZ=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ev/n)),eJ=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ev/n)+1,e0={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ew)+1,easeOutSine:e=>Math.sin(e*ew),easeInOutSine:e=>-.5*(Math.cos(em*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>eY(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(-Math.pow(2,-10*(2*e-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>eY(e)?e:eZ(e,.075,.3),easeOutElastic:e=>eY(e)?e:eJ(e,.075,.3),easeInOutElastic:e=>eY(e)?e:e<.5?.5*eZ(2*e,.1125,.45):.5+.5*eJ(2*e-1,.1125,.45),easeInBack:e=>e*e*(2.70158*e-1.70158),easeOutBack:e=>(e-=1)*e*(2.70158*e+1.70158)+1,easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-e0.easeOutBounce(1-e),easeOutBounce:e=>e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375,easeInOutBounce:e=>e<.5?.5*e0.easeInBounce(2*e):.5*e0.easeOutBounce(2*e-1)+.5};function e1(e){if(e&&"object"==typeof e){let t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function e2(e){return e1(e)?e:new U(e)}function e5(e){return e1(e)?e:new U(e).saturate(.5).darken(.1).hexString()}let e3=["x","y","borderWidth","radius","tension"],e4=["color","borderColor","backgroundColor"],e8=new Map;function e6(e,t,n){var r;let i,o;return(i=t+JSON.stringify(r=(r=n)||{}),!(o=e8.get(i))&&(o=new Intl.NumberFormat(t,r),e8.set(i,o)),o).format(e)}let e7={values:e=>G(e)?e:""+e,numeric(e,t,n){let r;if(0===e)return"0";let i=this.chart.options.locale,o=e;if(n.length>1){var s,a;let t,i=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(i<1e-4||i>1e15)&&(r="scientific"),s=e,Math.abs(t=(a=n).length>3?a[2].value-a[1].value:a[1].value-a[0].value)>=1&&s!==Math.floor(s)&&(t=s-Math.floor(s)),o=t}let l=eS(Math.abs(o)),u=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),c={notation:r,minimumFractionDigits:u,maximumFractionDigits:u};return Object.assign(c,this.options.ticks.format),e6(e,i,c)},logarithmic(e,t,n){return 0===e?"0":[1,2,3,5,10,15].includes(n[t].significand||e/Math.pow(10,Math.floor(eS(e))))||t>.8*n.length?e7.numeric.call(this,e,t,n):""}},e9=Object.create(null),te=Object.create(null);function tt(e,t){if(!t)return e;let n=t.split(".");for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function tn(e,t,n){return"string"==typeof t?ea(tt(e,t),n):ea(tt(e,""),t)}var tr=new class{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>e5(t.backgroundColor),this.hoverBorderColor=(e,t)=>e5(t.borderColor),this.hoverColor=(e,t)=>e5(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return tn(this,e,t)}get(e){return tt(this,e)}describe(e,t){return tn(te,e,t)}override(e,t){return tn(e9,e,t)}route(e,t,n,r){let i=tt(this,e),o=tt(this,n),s="_"+t;Object.defineProperties(i,{[s]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[s],t=o[r];return X(e)?Object.assign({},t,e):J(e,t)},set(e){this[s]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:e4},numbers:{type:"number",properties:e3}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:e7.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function ti(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function to(e,t,n){let r=e.currentDevicePixelRatio,i=0!==n?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function ts(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ta(e,t,n,r){tl(e,t,n,r,null)}function tl(e,t,n,r,i){let o,s,a,l,u,c,d,h,f=t.pointStyle,p=t.rotation,g=t.radius,m=(p||0)*ex;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(o=f.toString())||"[object HTMLCanvasElement]"===o)){e.save(),e.translate(n,r),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!isNaN(g)&&!(g<=0)){switch(e.beginPath(),f){default:i?e.ellipse(n,r,i/2,g,0,0,ev):e.arc(n,r,g,0,ev),e.closePath();break;case"triangle":c=i?i/2:g,e.moveTo(n+Math.sin(m)*c,r-Math.cos(m)*g),m+=ek,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*g),m+=ek,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*g),e.closePath();break;case"rectRounded":u=.516*g,s=Math.cos(m+e_)*(l=g-u),d=Math.cos(m+e_)*(i?i/2-u:l),a=Math.sin(m+e_)*l,h=Math.sin(m+e_)*(i?i/2-u:l),e.arc(n-d,r-a,u,m-em,m-ew),e.arc(n+h,r-s,u,m-ew,m),e.arc(n+d,r+a,u,m,m+ew),e.arc(n-h,r+s,u,m+ew,m+em),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}m+=e_;case"rectRot":d=Math.cos(m)*(i?i/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(n-d,r-a),e.lineTo(n+h,r-s),e.lineTo(n+d,r+a),e.lineTo(n-h,r+s),e.closePath();break;case"crossRot":m+=e_;case"cross":d=Math.cos(m)*(i?i/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"star":d=Math.cos(m)*(i?i/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s),m+=e_,d=Math.cos(m)*(i?i/2:g),s=Math.cos(m)*g,a=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"line":s=i?i/2:Math.cos(m)*g,a=Math.sin(m)*g,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(m)*(i?i/2:g),r+Math.sin(m)*g);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function tu(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function tc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function td(e){e.restore()}function th(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if("middle"===i){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else"after"===i!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function tf(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function tp(e,t,n,r,i,o={}){let s,a,l=G(t)?t:[t],u=o.strokeWidth>0&&""!==o.strokeColor;for(e.save(),e.font=i.string,o.translation&&e.translate(o.translation[0],o.translation[1]),K(o.rotation)||e.rotate(o.rotation),o.color&&(e.fillStyle=o.color),o.textAlign&&(e.textAlign=o.textAlign),o.textBaseline&&(e.textBaseline=o.textBaseline),s=0;s<l.length;++s)a=l[s],o.backdrop&&function(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}(e,o.backdrop),u&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),K(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(a,n,r,o.maxWidth)),e.fillText(a,n,r,o.maxWidth),function(e,t,n,r,i){if(i.strikethrough||i.underline){let o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,u=n+o.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,c),e.lineTo(a,c),e.stroke()}}(e,n,r,a,o),r+=Number(i.lineHeight);e.restore()}function tg(e,t){let{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*em,em,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,em,ew,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,ew,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-ew,!0),e.lineTo(n+s.topLeft,r)}let tm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,tv=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/,ty=e=>+e||0;function tb(e,t){let n={},r=X(t),i=r?Object.keys(t):t,o=X(e)?r?n=>J(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=ty(o(e));return n}function tx(e){return tb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function tw(e){return tb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function t_(e){let t=tx(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function tk(e,t){e=e||{},t=t||tr.font;let n=J(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));let r=J(e.style,t.style);r&&!(""+r).match(tv)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);let i={family:J(e.family,t.family),lineHeight:function(e,t){let n=(""+e).match(tm);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}(J(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:J(e.weight,t.weight),string:""};return i.string=!i||K(i.size)||K(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family,i}function tS(e,t,n,r){let i,o,s,a=!0;for(i=0,o=e.length;i<o;++i)if(void 0!==(s=e[i])&&(void 0!==t&&"function"==typeof s&&(s=s(t),a=!1),void 0!==n&&G(s)&&(s=s[n%s.length],a=!1),void 0!==s))return r&&!a&&(r.cacheable=!1),s}function tC(e,t){return Object.assign(Object.create(e),t)}function tO(e,t=[""],n,r,i=()=>e[0]){let o=n||e;return void 0===r&&(r=tL("_fallback",e)),new Proxy({[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:n=>tO([n,...e],t,o,r)},{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,r)=>tT(n,r,()=>(function(e,t,n,r){let i;for(let o of t)if(void 0!==(i=tL(tA(o,e),n)))return tP(e,i)?tI(n,r,e,i):i})(r,t,e,n)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>tj(e).includes(t),ownKeys:e=>tj(e),set(e,t,n){let r=e._storage||(e._storage=i());return e[t]=r[t]=n,delete e._keys,!0}})}function tE(e,t,n,r){return new Proxy({_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:tM(e,r),setContext:t=>tE(e,t,n,r),override:i=>tE(e.override(i),t,n,r)},{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>tT(e,t,()=>(function(e,t,n){let{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e,a=r[t];return ep(a)&&s.isScriptable(t)&&(a=function(e,t,n,r){let{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),tP(e,l)&&(l=tI(i._scopes,i,e,l)),l}(t,a,e,n)),G(a)&&a.length&&(a=function(e,t,n,r){let{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(void 0!==o.index&&r(e))return t[o.index%t.length];if(X(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);for(let l of(t=[],n)){let n=tI(r,i,e,l);t.push(tE(n,o,s&&s[e],a))}}return t}(t,a,e,s.isIndexable)),tP(t,a)&&(a=tE(a,i,o&&o[t],s)),a})(e,t,n)),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,r)=>(e[n]=r,delete t[n],!0)})}function tM(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:ep(n)?n:()=>n,isIndexable:ep(r)?r:()=>r}}let tA=(e,t)=>e?e+eh(t):t,tP=(e,t)=>X(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function tT(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];let r=n();return e[t]=r,r}let tR=(e,t)=>!0===e?t:"string"==typeof e?ed(t,e):void 0;function tI(e,t,n,r){var i;let o=t._rootScopes,s=(i=t._fallback,ep(i)?i(n,r):i),a=[...e,...o],l=new Set;l.add(r);let u=tD(l,a,n,s||n,r);return null!==u&&(void 0===s||s===n||null!==(u=tD(l,a,s,u,r)))&&tO(Array.from(l),[""],o,s,()=>{var e,i,o;let s,a;return e=t,i=n,o=r,i in(s=e._getTarget())||(s[i]={}),G(a=s[i])&&X(o)?o:a||{}})}function tD(e,t,n,r,i){for(;n;)n=function(e,t,n,r,i){for(let s of t){let t=tR(n,s);if(t){var o;e.add(t);let s=(o=t._fallback,ep(o)?o(n,i):o);if(void 0!==s&&s!==n&&s!==r)return s}else if(!1===t&&void 0!==r&&n!==r)return null}return!1}(e,t,n,r,i);return n}function tL(e,t){for(let n of t){if(!n)continue;let t=n[e];if(void 0!==t)return t}}function tj(e){let t=e._keys;return t||(t=e._keys=function(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith("_")))t.add(e);return Array.from(t)}(e._scopes)),t}function tN(e,t,n,r){let i,o,s,{iScale:a}=e,{key:l="r"}=this._parsing,u=Array(r);for(i=0;i<r;++i)s=t[o=i+n],u[i]={r:a.parse(ed(s,l),o)};return u}let tF=Number.EPSILON||1e-14,tB=(e,t)=>t<e.length&&!e[t].skip&&e[t],tz=e=>"x"===e?"y":"x";function tV(e,t,n){return Math.max(Math.min(e,n),t)}function tH(){return"undefined"!=typeof window&&"undefined"!=typeof document}function t$(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function tW(e,t,n){let r;return"string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}let tU=e=>e.ownerDocument.defaultView.getComputedStyle(e,null),tq=["top","right","bottom","left"];function tQ(e,t,n){let r={};n=n?"-"+n:"";for(let i=0;i<4;i++){let o=tq[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function tK(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=tU(n),o="border-box"===i.boxSizing,s=tQ(i,"padding"),a=tQ(i,"border","width"),{x:l,y:u,box:c}=function(e,t){let n,r,i,o=e.touches,s=o&&o.length?o[0]:e,{offsetX:a,offsetY:l}=s,u=!1;if(i=e.target,(a>0||l>0)&&(!i||!i.shadowRoot))n=a,r=l;else{let e=t.getBoundingClientRect();n=s.clientX-e.left,r=s.clientY-e.top,u=!0}return{x:n,y:r,box:u}}(e,n),d=s.left+(c&&a.left),h=s.top+(c&&a.top),{width:f,height:p}=t;return o&&(f-=s.width+a.width,p-=s.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((u-h)/p*n.height/r)}}let tG=e=>Math.round(10*e)/10;function tX(e,t,n){let r=t||1,i=tG(e.height*r),o=tG(e.width*r);e.height=tG(e.height),e.width=tG(e.width);let s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o)&&(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0)}let tY=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};tH()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(e){}return e}();function tZ(e,t){let n=tU(e).getPropertyValue(t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function tJ(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function t0(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function t1(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=tJ(e,i,n),a=tJ(i,o,n),l=tJ(o,t,n),u=tJ(s,a,n),c=tJ(a,l,n);return tJ(u,c,n)}function t2(e,t,n){var r;return e?(r=n,{x:e=>t+t+r-e,setWidth(e){r=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function t5(e,t){let n,r;("ltr"===t||"rtl"===t)&&(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function t3(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function t4(e){return"angle"===e?{between:ej,compare:eD,normalize:eL}:{between:eF,compare:(e,t)=>e-t,normalize:e=>e}}function t8({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n==0,style:i}}function t6(e,t,n){let r,i,o;if(!n)return[e];let{property:s,start:a,end:l}=n,u=t.length,{compare:c,between:d,normalize:h}=t4(s),{start:f,end:p,loop:g,style:m}=function(e,t,n){let r,{property:i,start:o,end:s}=n,{between:a,normalize:l}=t4(i),u=t.length,{start:c,end:d,loop:h}=e;if(h){for(c+=u,d+=u,r=0;r<u&&a(l(t[c%u][i]),o,s);++r)c--,d--;c%=u,d%=u}return d<c&&(d+=u),{start:c,end:d,loop:h,style:e.style}}(e,t,n),v=[],y=!1,b=null,x=()=>y||d(a,o,r)&&0!==c(a,o),w=()=>!y||0===c(l,r)||d(l,o,r);for(let e=f,n=f;e<=p;++e)(i=t[e%u]).skip||(r=h(i[s]))!==o&&(y=d(r,a,l),null===b&&x()&&(b=0===c(r,a)?e:n),null!==b&&w()&&(v.push(t8({start:b,end:e,loop:g,count:u,style:m})),b=null),n=e,o=r);return null!==b&&v.push(t8({start:b,end:p,loop:g,count:u,style:m})),v}function t7(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let o=t6(r[i],e.points,t);o.length&&n.push(...o)}return n}function t9(e,t,n,r){return r&&r.setContext&&n?function(e,t,n,r){let i=e._chart.getContext(),o=ne(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,u=[],c=o,d=t[0].start,h=d;function f(e,t,r,i){let o=a?-1:1;if(e!==t){for(e+=l;n[e%l].skip;)e-=o;for(;n[t%l].skip;)t+=o;e%l!=t%l&&(u.push({start:e%l,end:t%l,loop:r,style:i}),c=i,d=t%l)}}for(let e of t){let t,o=n[(d=a?d:e.start)%l];for(h=d+1;h<=e.end;h++){let a=n[h%l];(function(e,t){if(!t)return!1;let n=[],r=function(e,t){return e1(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)})(t=ne(r.setContext(tC(i,{type:"segment",p0:o,p1:a,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),c)&&f(d,h-1,e.loop,c),o=a,c=t}d<h-1&&f(d,h-1,e.loop,c)}return u}(e,t,n,r):t}function ne(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function nt(e,t,n){return e.options.clip?e[n]:t[n]}function nn(e,t){let n=t._clip;if(n.disabled)return!1;let r=function(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:nt(n,t,"left"),right:nt(n,t,"right"),top:nt(r,t,"top"),bottom:nt(r,t,"bottom")}:t}(t,e.chartArea);return{left:!1===n.left?0:r.left-(!0===n.left?0:n.left),right:!1===n.right?e.width:r.right+(!0===n.right?0:n.right),top:!1===n.top?0:r.top-(!0===n.top?0:n.top),bottom:!1===n.bottom?e.height:r.bottom+(!0===n.bottom?0:n.bottom)}}var nr=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],o=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(n-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=eU.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{let i;if(!n.running||!n.items.length)return;let o=n.items,s=o.length-1,a=!1;for(;s>=0;--s)(i=o[s])._active?(i._total>n.duration&&(n.duration=i._total),i.tick(e),a=!0):(o[s]=o[o.length-1],o.pop());a&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!!t&&!!t.running&&!!t.items.length}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}};let ni="transparent",no={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){let r=e2(e||ni),i=r.valid&&e2(t||ni);return i&&i.valid?i.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class ns{constructor(e,t,n,r){const i=t[n];r=tS([e.to,r,i,e.from]);const o=tS([e.from,i,r]);this._active=!0,this._fn=e.fn||no[e.type||typeof o],this._easing=e0[e.easing]||e0.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,o=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=tS([e.to,t,r,e.from]),this._from=tS([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t,n=e-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}t=n/r%2,t=s&&t>1?2-t:t,t=this._easing(Math.min(1,Math.max(0,t))),this._target[i]=this._fn(o,a,t)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?"res":"rej",n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}}class na{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!X(e))return;let t=Object.keys(tr.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!X(i))return;let o={};for(let e of t)o[e]=i[e];(G(i.properties)&&i.properties||[r]).forEach(e=>{e!==r&&n.has(e)||n.set(e,o)})})}_animateOptions(e,t){let n=t.options,r=function(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&(function(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)})(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n,r=this._properties,i=[],o=e.$animations||(e.$animations={}),s=Object.keys(t),a=Date.now();for(n=s.length-1;n>=0;--n){let l=s[n];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(e,t));continue}let u=t[l],c=o[l],d=r.get(l);if(c)if(d&&c.active()){c.update(d,u,a);continue}else c.cancel();if(!d||!d.duration){e[l]=u;continue}o[l]=c=new ns(d,e,l,u),i.push(c)}return i}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);let n=this._createAnimations(e,t);if(n.length)return nr.add(this._chart,n),!0}}function nl(e,t){let n=e&&e.options||{},r=n.reverse,i=void 0===n.min?t:0,o=void 0===n.max?t:0;return{start:r?o:i,end:r?i:o}}function nu(e,t){let n,r,i=[],o=e._getSortedDatasetMetas(t);for(n=0,r=o.length;n<r;++n)i.push(o[n].index);return i}function nc(e,t,n,r={}){let i,o,s,a,l=e.keys,u="single"===r.mode;if(null===t)return;let c=!1;for(i=0,o=l.length;i<o;++i){if((s=+l[i])===n){if(c=!0,r.all)continue;break}Y(a=e.values[s])&&(u||0===t||eC(t)===eC(a))&&(t+=a)}return c||r.all?t:0}function nd(e,t){let n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function nh(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function nf(e,t){let n,{chart:r,_cachedMeta:i}=e,o=r._stacks||(r._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,c=a.axis,d=`${s.id}.${a.id}.${i.stack||i.type}`,h=t.length;for(let e=0;e<h;++e){let r=t[e],{[u]:s,[c]:h}=r;(n=(r._stacks||(r._stacks={}))[c]=function(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}(o,d,s))[l]=h,n._top=nh(n,a,!0,i.type),n._bottom=nh(n,a,!1,i.type),(n._visualValues||(n._visualValues={}))[l]=h}}function np(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function ng(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r)for(let i of t=t||e._parsed){let e=i._stacks;if(!e||void 0===e[r]||void 0===e[r][n])return;delete e[r][n],void 0!==e[r]._visualValues&&void 0!==e[r]._visualValues[n]&&delete e[r]._visualValues[n]}}let nm=e=>"reset"===e||"none"===e,nv=(e,t)=>t?e:Object.assign({},e);class ny{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=nd(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&ng(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,i=t.xAxisID=J(n.xAxisID,np(e,"x")),o=t.yAxisID=J(n.yAxisID,np(e,"y")),s=t.rAxisID=J(n.rAxisID,np(e,"r")),a=t.indexAxis,l=t.iAxisID=r(a,i,o,s),u=t.vAxisID=r(a,o,i,s);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(s),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){let e=this._cachedMeta;this._data&&e$(this._data,this),e._stacked&&ng(e)}_dataCheck(){let e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(X(t)){let e=this._cachedMeta;this._data=function(e,t){let n,r,i,{iScale:o,vScale:s}=t,a="x"===o.axis?"x":"y",l="x"===s.axis?"x":"y",u=Object.keys(e),c=Array(u.length);for(n=0,r=u.length;n<r;++n)i=u[n],c[n]={[a]:i,[l]:e[i]};return c}(t,e)}else if(n!==t){if(n){e$(n,this);let e=this._cachedMeta;ng(e),e._parsed=[]}t&&Object.isExtensible(t)&&(t._chartjs?t._chartjs.listeners.push(this):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),eH.forEach(e=>{let n="_onData"+eh(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let i=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[n]&&t[n](...e)}),i}})}))),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=nd(t.vScale,t),t.stack!==n.stack&&(r=!0,ng(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(nf(this,t._parsed),t._stacked=nd(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let n,r,i,{_cachedMeta:o,_data:s}=this,{iScale:a,_stacked:l}=o,u=a.axis,c=0===e&&t===s.length||o._sorted,d=e>0&&o._parsed[e-1];if(!1===this._parsing)o._parsed=s,o._sorted=!0,i=s;else{i=G(s[e])?this.parseArrayData(o,s,e,t):X(s[e])?this.parseObjectData(o,s,e,t):this.parsePrimitiveData(o,s,e,t);let a=()=>null===r[u]||d&&r[u]<d[u];for(n=0;n<t;++n)o._parsed[n+e]=r=i[n],c&&(a()&&(c=!1),d=r);o._sorted=c}l&&nf(this,i)}parsePrimitiveData(e,t,n,r){let i,o,{iScale:s,vScale:a}=e,l=s.axis,u=a.axis,c=s.getLabels(),d=s===a,h=Array(r);for(i=0;i<r;++i)o=i+n,h[i]={[l]:d||s.parse(c[o],o),[u]:a.parse(t[o],o)};return h}parseArrayData(e,t,n,r){let i,o,s,{xScale:a,yScale:l}=e,u=Array(r);for(i=0;i<r;++i)s=t[o=i+n],u[i]={x:a.parse(s[0],o),y:l.parse(s[1],o)};return u}parseObjectData(e,t,n,r){let i,o,s,{xScale:a,yScale:l}=e,{xAxisKey:u="x",yAxisKey:c="y"}=this._parsing,d=Array(r);for(i=0;i<r;++i)s=t[o=i+n],d[i]={x:a.parse(ed(s,u),o),y:l.parse(ed(s,c),o)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,o=t[e.axis];return nc({keys:nu(r,!0),values:t._stacks[e.axis]._visualValues},o,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],o=null===i?NaN:i,s=r&&n._stacks[t.axis];r&&s&&(r.values=s,o=nc(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){let n,r,i,o=this._cachedMeta,s=o._parsed,a=o._sorted&&e===o.iScale,l=s.length,u=this._getOtherScale(e),c=(i=this.chart,t&&!o.hidden&&o._stacked&&{keys:nu(i,!0),values:null}),d={min:1/0,max:-1/0},{min:h,max:f}=function(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}(u);function p(){let t=(r=s[n])[u.axis];return!Y(r[e.axis])||h>t||f<t}for(n=0;n<l&&(p()||(this.updateRangeFromParsed(d,e,r,c),!a));++n);if(a){for(n=l-1;n>=0;--n)if(!p()){this.updateRangeFromParsed(d,e,r,c);break}}return d}getAllParsedValues(e){let t,n,r,i=this._cachedMeta._parsed,o=[];for(t=0,n=i.length;t<n;++t)Y(r=i[t][e.axis])&&o.push(r);return o}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){var t;let n,r,i,o,s=this._cachedMeta;this.update(e||"default"),X(t=J(this.options.clip,function(e,t,n){if(!1===n)return!1;let r=nl(e,n),i=nl(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}(s.xScale,s.yScale,this.getMaxOverflow())))?(n=t.top,r=t.right,i=t.bottom,o=t.left):n=r=i=o=t,s._clip={top:n,right:r,bottom:i,left:o,disabled:!1===t}}update(e){}draw(){let e,t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;for(r.dataset&&r.dataset.draw(t,o,a,l),e=a;e<a+l;++e){let n=i[e];n.hidden||(n.active&&u?s.push(n):n.draw(t,o))}for(e=0;e<s.length;++e)s[e].draw(t,o)}getStyle(e,t){let n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){var r,i;let o,s=this.getDataset();if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];(o=t.$context||(r=this.getContext(),t.$context=tC(r,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"}))).parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else(o=this.$context||(this.$context=tC(this.chart.getContext(),{active:!1,dataset:void 0,datasetIndex:i=this.index,index:i,mode:"default",type:"dataset"}))).dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){let r="active"===t,i=this._cachedDataOpts,o=e+"-"+t,s=i[o],a=this.enableOptionSharing&&ef(n);if(s)return nv(s,a);let l=this.chart.config,u=l.datasetElementScopeKeys(this._type,e),c=r?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),u),h=Object.keys(tr.elements[e]),f=()=>this.getContext(n,r,t),p=l.resolveNamedOptions(d,h,f,c);return p.$shared&&(p.$shared=a,i[o]=Object.freeze(nv(p,a))),p}_resolveAnimations(e,t,n){let r,i=this.chart,o=this._cachedDataOpts,s=`animation-${t}`,a=o[s];if(a)return a;if(!1!==i.options.animation){let i=this.chart.config,o=i.datasetAnimationScopeKeys(this._type,t),s=i.getOptionScopes(this.getDataset(),o);r=i.createResolver(s,this.getContext(e,n,t))}let l=new na(i,r&&r.animations);return r&&r._cacheable&&(o[s]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||nm(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),o=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:o}}updateElement(e,t,n,r){nm(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!nm(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r,i=this._cachedMeta,o=i.data,s=e+t,a=e=>{for(e.length+=t,r=e.length-1;r>=s;r--)e[r]=e[r-t]};for(a(o),r=e;r<s;++r)o[r]=new this.dataElementType;this._parsing&&a(i._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&ng(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);let n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function nb(e,t,n,r){if(G(e)){let i,o,s,a,l,u;i=n.parse(e[0],r),s=Math.min(i,o=n.parse(e[1],r)),a=Math.max(i,o),l=s,u=a,Math.abs(s)>Math.abs(a)&&(l=a,u=s),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:i,end:o,min:s,max:a}}else t[n.axis]=n.parse(e,r);return t}function nx(e,t,n,r){let i,o,s,a,l=e.iScale,u=e.vScale,c=l.getLabels(),d=l===u,h=[];for(i=n,o=n+r;i<o;++i)a=t[i],(s={})[l.axis]=d||l.parse(c[i],i),h.push(nb(a,s,u,i));return h}function nw(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function n_(e,t,n,r){var i,o,s;return r?nk((i=e,o=t,s=n,e=i===o?s:i===s?o:i),n,t):nk(e,t,n)}function nk(e,t,n){return"start"===e?t:"end"===e?n:e}class nS extends ny{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return nx(e,t,n,r)}parseArrayData(e,t,n,r){return nx(e,t,n,r)}parseObjectData(e,t,n,r){let i,o,s,a,{iScale:l,vScale:u}=e,{xAxisKey:c="x",yAxisKey:d="y"}=this._parsing,h="x"===l.axis?c:d,f="x"===u.axis?c:d,p=[];for(i=n,o=n+r;i<o;++i)a=t[i],(s={})[l.axis]=l.parse(ed(a,h),i),p.push(nb(ed(a,f),s,u,i));return p}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,o=nw(i)?"["+i.start+", "+i.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+t.getLabelForValue(r[t.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i="reset"===r,{index:o,_cachedMeta:{vScale:s}}=this,a=s.getBasePixel(),l=s.isHorizontal(),u=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,r);for(let h=t;h<t+n;h++){let t=this.getParsed(h),n=i||K(t[s.axis])?{base:a,head:a}:this._calculateBarValuePixels(h),f=this._calculateBarIndexPixels(h,u),p=(t._stacks||{})[s.axis],g={horizontal:l,base:n.base,enableBorderRadius:!p||nw(t._custom)||o===p._top||o===p._bottom,x:l?n.head:f.center,y:l?f.center:n.head,height:l?f.size:Math.abs(n.size),width:l?Math.abs(n.size):f.size};d&&(g.options=c||this.resolveDataElementOptions(h,e[h].active?"active":r));let m=g.options||e[h].options;!function(e,t,n,r){let i,o,s,a,l,u=t.borderSkipped,c={};if(!u){e.borderSkipped=c;return}if(!0===u){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:d,end:h,reverse:f,top:p,bottom:g}=(e.horizontal?(i=e.base>e.x,o="left",s="right"):(i=e.base<e.y,o="bottom",s="top"),i?(a="end",l="start"):(a="start",l="end"),{start:o,end:s,reverse:i,top:a,bottom:l});"middle"===u&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?u=p:(n._bottom||0)===r?u=g:(c[n_(g,d,h,f)]=!0,u=p)),c[n_(u,d,h,f)]=!0,e.borderSkipped=c}(g,m,p,o),function(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?.33*(1===n):t}(g,m,u.ratio),this.updateElement(e[h],h,g,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(t),a=s&&s[n.axis],l=e=>{let t=e._parsed.find(e=>e[n.axis]===a),r=t&&t[e.vScale.axis];if(K(r)||isNaN(r))return!0};for(let n of r)if(!(void 0!==t&&l(n))&&((!1===i||-1===o.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&o.push(n.stack),n.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[J("x"===this.chart.options.indexAxis?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=void 0!==t?r.indexOf(t):-1;return -1===i?r.length-1:i}_getRuler(){let e,t,n=this.options,r=this._cachedMeta,i=r.iScale,o=[];for(e=0,t=r.data.length;e<t;++e)o.push(i.getPixelForValue(this.getParsed(e)[i.axis],e));let s=n.barThickness;return{min:s||function(e){let t,n,r,i,o=e.iScale,s=function(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=eW(r.sort((e,t)=>e-t))}return e._cache.$bar}(o,e.type),a=o._length,l=()=>{32767!==r&&-32768!==r&&(ef(i)&&(a=Math.min(a,Math.abs(r-i)||a)),i=r)};for(t=0,n=s.length;t<n;++t)r=o.getPixelForValue(s[t]),l();for(t=0,i=void 0,n=o.ticks.length;t<n;++t)r=o.getPixelForTick(t),l();return a}(r),pixels:o,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:n.grouped,ratio:s?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(e){let t,n,{_cachedMeta:{vScale:r,_stacked:i,index:o},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(e),c=u._custom,d=nw(c),h=u[r.axis],f=0,p=i?this.applyStack(r,u,i):h;p!==h&&(f=p-h,p=h),d&&(h=c.barStart,p=c.barEnd-c.barStart,0!==h&&eC(h)!==eC(c.barEnd)&&(f=0),f+=h);let g=K(s)||d?f:s,m=r.getPixelForValue(g);if(Math.abs(n=(t=this.chart.getDataVisibility(e)?r.getPixelForValue(f+p):m)-m)<a){var v;n=(0!==(v=n)?eC(v):(r.isHorizontal()?1:-1)*(r.min>=l?1:-1))*a,h===l&&(m-=n/2);let e=r.getPixelForDecimal(0),s=r.getPixelForDecimal(1),c=Math.min(e,s);t=(m=Math.max(Math.min(m,Math.max(e,s)),c))+n,i&&!d&&(u._stacks[r.axis]._visualValues[o]=r.getValueForPixel(t)-r.getValueForPixel(m))}if(m===r.getPixelForValue(l)){let e=eC(n)*r.getLineWidthForValue(l)/2;m+=e,n-=e}return{size:n,base:m,head:t,center:t+n/2}}_calculateBarIndexPixels(e,t){let n,r,i=t.scale,o=this.options,s=o.skipNull,a=J(o.maxBarThickness,1/0),l=this._getAxisCount();if(t.grouped){var u,c;let i,d,h,f,p,g,m,v,y,b=s?this._getStackCount(e):t.stackCount,x="flex"===o.barThickness?(u=b*l,d=(i=t.pixels)[e],h=e>0?i[e-1]:null,f=e<i.length-1?i[e+1]:null,p=o.categoryPercentage,null===h&&(h=d-(null===f?t.end-t.start:f-d)),null===f&&(f=d+d-h),g=d-(d-Math.min(h,f))/2*p,{chunk:Math.abs(f-h)/2*p/u,ratio:o.barPercentage,start:g}):(c=b*l,K(y=o.barThickness)?(m=t.min*o.categoryPercentage,v=o.barPercentage):(m=y*c,v=1),{chunk:m/c,ratio:v,start:t.pixels[e]-m/2}),w="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(J(w,this.getFirstScaleIdForIndexAxis())),k=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+_;n=x.start+x.chunk*k+x.chunk/2,r=Math.min(a,x.chunk*x.ratio)}else n=i.getPixelForValue(this.getParsed(e)[i.axis],e),r=Math.min(a,t.min*t.ratio);return{base:n-r/2,head:n+r/2,center:n,size:r}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)null===this.getParsed(i)[t.axis]||n[i].hidden||n[i].draw(this._ctx)}}class nC extends ny{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){let i=super.parsePrimitiveData(e,t,n,r);for(let e=0;e<i.length;e++)i[e]._custom=this.resolveDataElementOptions(e+n).radius;return i}parseArrayData(e,t,n,r){let i=super.parseArrayData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=J(r[2],this.resolveDataElementOptions(e+n).radius)}return i}parseObjectData(e,t,n,r){let i=super.parseObjectData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=J(r&&r.r&&+r.r,this.resolveDataElementOptions(e+n).radius)}return i}getMaxOverflow(){let e=this._cachedMeta.data,t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,o=this.getParsed(e),s=r.getLabelForValue(o.x),a=i.getLabelForValue(o.y),l=o._custom;return{label:n[e]||"",value:"("+s+", "+a+(l?", "+l:"")+")"}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){let i="reset"===r,{iScale:o,vScale:s}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(t,r),u=o.axis,c=s.axis;for(let d=t;d<t+n;d++){let t=e[d],n=!i&&this.getParsed(d),h={},f=h[u]=i?o.getPixelForDecimal(.5):o.getPixelForValue(n[u]),p=h[c]=i?s.getBasePixel():s.getPixelForValue(n[c]);h.skip=isNaN(f)||isNaN(p),l&&(h.options=a||this.resolveDataElementOptions(d,t.active?"active":r),i&&(h.options.radius=0)),this.updateElement(t,d,h,r)}}resolveDataElementOptions(e,t){let n=this.getParsed(e),r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));let i=r.radius;return"active"!==t&&(r.radius=0),r.radius+=J(n&&n._custom,i),r}}class nO extends ny{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:o,borderRadius:s}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,a)=>{let l=e.getDatasetMeta(0).controller.getStyle(a);return{text:t,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:r,pointStyle:n,borderRadius:o&&(s||l.borderRadius),index:a}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let i,o,s=e=>+n[e];if(X(n[e])){let{key:e="value"}=this._parsing;s=t=>+ed(n[t],e)}for(i=e,o=e+t;i<o;++i)r._parsed[i]=s(i)}}_getRotation(){return eP(this.options.rotation-90)}_getCircumference(){return eP(this.options.circumference)}_getRotationExtents(){let e=ev,t=-ev;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),o=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+o)}return{rotation:e,circumference:t-e}}update(e){let t,{chartArea:n}=this.chart,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),a=Math.min((t=this.options.cutout,"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/s),1),l=this._getRingWeight(this.index),{circumference:u,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:f,offsetY:p}=function(e,t,n){let r=1,i=1,o=0,s=0;if(t<ev){let a=e+t,l=Math.cos(e),u=Math.sin(e),c=Math.cos(a),d=Math.sin(a),h=(t,r,i)=>ej(t,e,a,!0)?1:Math.max(r,r*n,i,i*n),f=(t,r,i)=>ej(t,e,a,!0)?-1:Math.min(r,r*n,i,i*n),p=h(0,l,c),g=h(ew,u,d),m=f(em,l,c),v=f(em+ew,u,d);r=(p-m)/2,i=(g-v)/2,o=-(p+m)/2,s=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}(c,u,a),g=Math.max(Math.min((n.width-o)/d,(n.height-o)/h)/2,0),m=ee(this.options.radius,g),v=Math.max(m*a,0),y=(m-v)/this._getVisibleDatasetWeightTotal();this.offsetX=f*m,this.offsetY=p*m,r.total=this.calculateTotal(),this.outerRadius=m-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(i,0,i.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/ev)}updateElements(e,t,n,r){let i,o="reset"===r,s=this.chart,a=s.chartArea,l=s.options.animation,u=(a.left+a.right)/2,c=(a.top+a.bottom)/2,d=o&&l.animateScale,h=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(t,r),m=this._getRotation();for(i=0;i<t;++i)m+=this._circumference(i,o);for(i=t;i<t+n;++i){let t=this._circumference(i,o),n=e[i],s={x:u+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+t,circumference:t,outerRadius:f,innerRadius:h};g&&(s.options=p||this.resolveDataElementOptions(i,n.active?"active":r)),m+=t,this.updateElement(n,i,s,r)}}calculateTotal(){let e,t=this._cachedMeta,n=t.data,r=0;for(e=0;e<n.length;e++){let i=t._parsed[e];null!==i&&!isNaN(i)&&this.chart.getDataVisibility(e)&&!n[e].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*ev:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=e6(t._parsed[e],n.options.locale);return{label:r[e]||"",value:i}}getMaxBorderWidth(e){let t,n,r,i,o,s=0,a=this.chart;if(!e){for(t=0,n=a.data.datasets.length;t<n;++t)if(a.isDatasetVisible(t)){e=(r=a.getDatasetMeta(t)).data,i=r.controller;break}}if(!e)return 0;for(t=0,n=e.length;t<n;++t)"inner"!==(o=i.resolveDataElementOptions(t)).borderAlign&&(s=Math.max(s,o.borderWidth||0,o.hoverBorderWidth||0));return s}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(J(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class nE extends ny{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,o=this.chart._animationsDisabled,{start:s,count:a}=eG(t,r,o);this._drawStart=s,this._drawCount=a,eX(t)&&(s=0,a=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},e),this.updateElements(r,s,a,e)}updateElements(e,t,n,r){let i="reset"===r,{iScale:o,vScale:s,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:c}=this._getSharedOptions(t,r),d=o.axis,h=s.axis,{spanGaps:f,segment:p}=this.options,g=eM(f)?f:1/0,m=this.chart._animationsDisabled||i||"none"===r,v=t+n,y=e.length,b=t>0&&this.getParsed(t-1);for(let n=0;n<y;++n){let f=e[n],y=m?f:{};if(n<t||n>=v){y.skip=!0;continue}let x=this.getParsed(n),w=K(x[h]),_=y[d]=o.getPixelForValue(x[d],n),k=y[h]=i||w?s.getBasePixel():s.getPixelForValue(a?this.applyStack(s,x,a):x[h],n);y.skip=isNaN(_)||isNaN(k)||w,y.stop=n>0&&Math.abs(x[d]-b[d])>g,p&&(y.parsed=x,y.raw=l.data[n]),c&&(y.options=u||this.resolveDataElementOptions(n,f.active?"active":r)),m||this.updateElement(f,n,y,r),b=x}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];return r.length?Math.max(n,r[0].size(this.resolveDataElementOptions(0)),r[r.length-1].size(this.resolveDataElementOptions(r.length-1)))/2:n}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}class nM extends ny{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map((t,i)=>{let o=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:r,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=e6(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:i}}parseObjectData(e,t,n,r){return tN.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:1/0,max:-1/0};return e.data.forEach((e,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,n=e.options,r=Math.max(Math.min(t.right-t.left,t.bottom-t.top)/2,0),i=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),o=(r-i)/e.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,t,n,r){let i,o="reset"===r,s=this.chart,a=s.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,c=l.yCenter,d=l.getIndexAngle(0)-.5*em,h=d,f=360/this.countVisibleElements();for(i=0;i<t;++i)h+=this._computeAngle(i,r,f);for(i=t;i<t+n;i++){let t=e[i],n=h,p=h+this._computeAngle(i,r,f),g=s.getDataVisibility(i)?l.getDistanceFromCenterForValue(this.getParsed(i).r):0;h=p,o&&(a.animateScale&&(g=0),a.animateRotate&&(n=p=d));let m={x:u,y:c,innerRadius:0,outerRadius:g,startAngle:n,endAngle:p,options:this.resolveDataElementOptions(i,t.active?"active":r)};this.updateElement(t,i,m,r)}}countVisibleElements(){let e=this._cachedMeta,t=0;return e.data.forEach((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?eP(this.resolveDataElementOptions(e,t).angle||n):0}}class nA extends nO{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class nP extends ny{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){let t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return tN.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta,n=t.dataset,r=t.data||[],i=t.iScale.getLabels();if(n.points=r,"resize"!==e){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);let o={_loop:!0,_fullLoop:i.length===r.length,options:t};this.updateElement(n,void 0,o,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){let i=this._cachedMeta.rScale,o="reset"===r;for(let s=t;s<t+n;s++){let t=e[s],n=this.resolveDataElementOptions(s,t.active?"active":r),a=i.getPointPositionForValue(s,this.getParsed(s).r),l=o?i.xCenter:a.x,u=o?i.yCenter:a.y,c={x:l,y:u,angle:a.angle,skip:isNaN(l)||isNaN(u),options:n};this.updateElement(t,s,c,r)}}}class nT extends ny{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,o=this.getParsed(e),s=r.getLabelForValue(o.x),a=i.getLabelForValue(o.y);return{label:n[e]||"",value:"("+s+", "+a+")"}}update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:o}=eG(t,n,r);if(this._drawStart=i,this._drawCount=o,eX(t)&&(i=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:i,_dataset:o}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;let s=this.resolveDatasetElementOptions(e);s.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:s},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,i,o,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,r){let i="reset"===r,{iScale:o,vScale:s,_stacked:a,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(t,r),c=this.getSharedOptions(u),d=this.includeOptions(r,c),h=o.axis,f=s.axis,{spanGaps:p,segment:g}=this.options,m=eM(p)?p:1/0,v=this.chart._animationsDisabled||i||"none"===r,y=t>0&&this.getParsed(t-1);for(let u=t;u<t+n;++u){let t=e[u],n=this.getParsed(u),p=v?t:{},b=K(n[f]),x=p[h]=o.getPixelForValue(n[h],u),w=p[f]=i||b?s.getBasePixel():s.getPixelForValue(a?this.applyStack(s,n,a):n[f],u);p.skip=isNaN(x)||isNaN(w)||b,p.stop=u>0&&Math.abs(n[h]-y[h])>m,g&&(p.parsed=n,p.raw=l.data[u]),d&&(p.options=c||this.resolveDataElementOptions(u,t.active?"active":r)),v||this.updateElement(t,u,p,r),y=n}this.updateSharedOptions(c,r,u)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;return t.length?Math.max(r,t[0].size(this.resolveDataElementOptions(0)),t[t.length-1].size(this.resolveDataElementOptions(t.length-1)))/2:r}}function nR(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}class nI{static override(e){Object.assign(nI.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return nR()}parse(){return nR()}format(){return nR()}add(){return nR()}diff(){return nR()}startOf(){return nR()}endOf(){return nR()}}function nD(e,t,n,r,i){let o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let e=0,n=o.length;e<n;++e){let{index:n,data:a}=o[e],{lo:l,hi:u}=function(e,t,n,r){let{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&"r"!==t&&s&&o.length){let s=a._reversePixels?eV:ez;if(r){if(i._sharedOptions){let e=o[0],r="function"==typeof e.getRange&&e.getRange(t);if(r){let e=s(o,t,n-r),i=s(o,t,n+r);return{lo:e.lo,hi:i.hi}}}}else{let r=s(o,t,n);if(l){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,o=n.slice(0,r.lo+1).reverse().findIndex(e=>!K(e[t.axis]));r.lo-=Math.max(0,o);let s=n.slice(r.hi).findIndex(e=>!K(e[t.axis]));r.hi+=Math.max(0,s)}return r}}return{lo:0,hi:o.length-1}}(o[e],t,s,i);for(let e=l;e<=u;++e){let t=a[e];t.skip||r(t,n,e)}}}function nL(e,t,n,r,i){let o=[];return(i||e.isPointInArea(t))&&nD(e,n,t,function(n,s,a){(i||tu(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&o.push({element:n,datasetIndex:s,index:a})},!0),o}function nj(e,t,n,r,i,o){let s,a,l,u,c,d;return o||e.isPointInArea(t)?"r"!==n||r?(s=[],a=-1!==n.indexOf("x"),l=-1!==n.indexOf("y"),u=function(e,t){return Math.sqrt(Math.pow(a?Math.abs(e.x-t.x):0,2)+Math.pow(l?Math.abs(e.y-t.y):0,2))},c=1/0,nD(e,n,t,function(n,a,l){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let h=n.getCenterPoint(i);if(!(o||e.isPointInArea(h))&&!d)return;let f=u(t,h);f<c?(s=[{element:n,datasetIndex:a,index:l}],c=f):f===c&&s.push({element:n,datasetIndex:a,index:l})}),s):(d=[],nD(e,n,t,function(e,n,r){let{startAngle:o,endAngle:s}=e.getProps(["startAngle","endAngle"],i),{angle:a}=eR(e,{x:t.x,y:t.y});ej(a,o,s)&&d.push({element:e,datasetIndex:n,index:r})}),d):[]}function nN(e,t,n,r,i){let o=[],s="x"===n?"inXRange":"inYRange",a=!1;return(nD(e,n,t,(e,r,l)=>{e[s]&&e[s](t[n],i)&&(o.push({element:e,datasetIndex:r,index:l}),a=a||e.inRange(t.x,t.y,i))}),r&&!a)?[]:o}var nF={modes:{index(e,t,n,r){let i=tK(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?nL(e,i,o,r,s):nj(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=a[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,n,r){let i=tK(t,e),o=n.axis||"xy",s=n.includeInvisible||!1,a=n.intersect?nL(e,i,o,r,s):nj(e,i,o,!1,r,s);if(a.length>0){let t=a[0].datasetIndex,n=e.getDatasetMeta(t).data;a=[];for(let e=0;e<n.length;++e)a.push({element:n[e],datasetIndex:t,index:e})}return a},point(e,t,n,r){let i=tK(t,e);return nL(e,i,n.axis||"xy",r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=tK(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return nj(e,i,o,n.intersect,r,s)},x(e,t,n,r){let i=tK(t,e);return nN(e,i,"x",n.intersect,r)},y(e,t,n,r){let i=tK(t,e);return nN(e,i,"y",n.intersect,r)}}};let nB=["left","top","right","bottom"];function nz(e,t){return e.filter(e=>e.pos===t)}function nV(e,t){return e.filter(e=>-1===nB.indexOf(e.pos)&&e.box.axis===t)}function nH(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function n$(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function nW(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function nU(e,t,n,r){let i,o,s,a,l,u,c=[];for(i=0,o=e.length,l=0;i<o;++i){(a=(s=e[i]).box).update(s.width||t.w,s.height||t.h,function(e,t){let n=t.maxPadding;return function(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}(e?["left","right"]:["top","bottom"])}(s.horizontal,t));let{same:o,other:d}=function(e,t,n,r){let{pos:i,box:o}=n,s=e.maxPadding;if(!X(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?o.height:o.width),n.size=t.size/t.count,e[i]+=n.size}o.getPadding&&nW(s,o.getPadding());let a=Math.max(0,t.outerWidth-n$(s,e,"left","right")),l=Math.max(0,t.outerHeight-n$(s,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}(t,n,s,r);l|=o&&c.length,u=u||d,a.fullSize||c.push(s)}return l&&nU(c,t,n,r)||u}function nq(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function nQ(e,t,n,r){let i=n.padding,{x:o,y:s}=t;for(let a of e){let e=a.box,l=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){let r=t.w*u,o=l.size||e.height;ef(l.start)&&(s=l.start),e.fullSize?nq(e,i.left,s,n.outerWidth-i.right-i.left,o):nq(e,t.left+l.placed,s,r,o),l.start=s,l.placed+=r,s=e.bottom}else{let r=t.h*u,s=l.size||e.width;ef(l.start)&&(o=l.start),e.fullSize?nq(e,o,i.top,s,n.outerHeight-i.bottom-i.top):nq(e,o,t.top+l.placed,s,r),l.start=o,l.placed+=r,o=e.right}}t.x=o,t.y=s}var nK={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){let i,o,s,a,l,u,c,d;if(!e)return;let h=t_(e.options.layout.padding),f=Math.max(t-h.width,0),p=Math.max(n-h.height,0),g=(o=nH((i=function(e){let t,n,r,i,o,s,a=[];for(t=0,n=(e||[]).length;t<n;++t)r=e[t],({position:i,options:{stack:o,stackWeight:s=1}}=r),a.push({index:t,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:s});return a}(e.boxes)).filter(e=>e.box.fullSize),!0),s=nH(nz(i,"left"),!0),a=nH(nz(i,"right")),l=nH(nz(i,"top"),!0),u=nH(nz(i,"bottom")),c=nV(i,"x"),d=nV(i,"y"),{fullSize:o,leftAndTop:s.concat(l),rightAndBottom:a.concat(d).concat(u).concat(c),chartArea:nz(i,"chartArea"),vertical:s.concat(a).concat(d),horizontal:l.concat(u).concat(c)}),m=g.vertical,v=g.horizontal;en(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});let y=Object.freeze({outerWidth:t,outerHeight:n,padding:h,availableWidth:f,availableHeight:p,vBoxMaxWidth:f/2/(m.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1),hBoxMaxHeight:p/2}),b=Object.assign({},h);nW(b,t_(r));let x=Object.assign({maxPadding:b,w:f,h:p,x:h.left,y:h.top},h),w=function(e,t){let n,r,i,o=function(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!nB.includes(r))continue;let o=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return t}(e),{vBoxMaxWidth:s,hBoxMaxHeight:a}=t;for(n=0,r=e.length;n<r;++n){let{fullSize:r}=(i=e[n]).box,l=o[i.stack],u=l&&i.stackWeight/l.weight;i.horizontal?(i.width=u?u*s:r&&t.availableWidth,i.height=a):(i.width=s,i.height=u?u*a:r&&t.availableHeight)}return o}(m.concat(v),y);nU(g.fullSize,x,y,w),nU(m,x,y,w),nU(v,x,y,w)&&nU(m,x,y,w);let _=x.maxPadding;function k(e){let t=Math.max(_[e]-x[e],0);return x[e]+=t,t}x.y+=k("top"),x.x+=k("left"),k("right"),k("bottom"),nQ(g.leftAndTop,x,y,w),x.x+=x.w,x.y+=x.h,nQ(g.rightAndBottom,x,y,w),e.chartArea={left:x.left,top:x.top,right:x.left+x.w,bottom:x.top+x.h,height:x.h,width:x.w},en(g.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(x.w,x.h,{left:0,top:0,right:0,bottom:0})})}};class nG{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class nX extends nG{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}let nY="$chartjs",nZ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},nJ=e=>null===e||""===e,n0=!!tY&&{passive:!0};function n1(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function n2(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t=(t=t||n1(n.addedNodes,r))&&!n1(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function n5(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t=(t=t||n1(n.removedNodes,r))&&!n1(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}let n3=new Map,n4=0;function n8(){let e=window.devicePixelRatio;e!==n4&&(n4=e,n3.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function n6(e,t,n){let r=e.canvas,i=r&&t$(r);if(!i)return;let o=eq((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),s=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(0!==n||0!==r)&&o(n,r)});return s.observe(i),n3.size||window.addEventListener("resize",n8),n3.set(e,o),s}function n7(e,t,n){n&&n.disconnect(),"resize"===t&&(n3.delete(e),n3.size||window.removeEventListener("resize",n8))}function n9(e,t,n){let r=e.canvas,i=eq(t=>{null!==e.ctx&&n(function(e,t){let n=nZ[e.type]||e.type,{x:r,y:i}=tK(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==i?i:null}}(t,e))},e);return r&&r.addEventListener(t,i,n0),i}class re extends nG{acquireContext(e,t){let n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(!function(e,t){let n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[nY]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",nJ(i)){let t=tZ(e,"width");void 0!==t&&(e.width=t)}if(nJ(r))if(""===e.style.height)e.height=e.width/(t||2);else{let t=tZ(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[nY])return!1;let n=t[nY].initial;["height","width"].forEach(e=>{let r=n[e];K(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[nY],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||(e.$proxies={}),i={attach:n2,detach:n5,resize:n6}[t]||n9;r[t]=i(e,t,n)}removeEventListener(e,t){let n=e.$proxies||(e.$proxies={}),r=n[t];r&&((({attach:n7,detach:n7,resize:n7})[t]||function(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,n0)})(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return function(e,t,n,r){let i=tU(e),o=tQ(i,"margin"),s=tW(i.maxWidth,e,"clientWidth")||eb,a=tW(i.maxHeight,e,"clientHeight")||eb,l=function(e,t,n){let r,i;if(void 0===t||void 0===n){let o=e&&t$(e);if(o){let e=o.getBoundingClientRect(),s=tU(o),a=tQ(s,"border","width"),l=tQ(s,"padding");t=e.width-l.width-a.width,n=e.height-l.height-a.height,r=tW(s.maxWidth,o,"clientWidth"),i=tW(s.maxHeight,o,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||eb,maxHeight:i||eb}}(e,t,n),{width:u,height:c}=l;if("content-box"===i.boxSizing){let e=tQ(i,"border","width"),t=tQ(i,"padding");u-=t.width+e.width,c-=t.height+e.height}return u=Math.max(0,u-o.width),c=Math.max(0,r?u/r:c-o.height),u=tG(Math.min(u,s,l.maxWidth)),c=tG(Math.min(c,a,l.maxHeight)),u&&!c&&(c=tG(u/2)),(void 0!==t||void 0!==n)&&r&&l.height&&c>l.height&&(u=tG(Math.floor((c=l.height)*r))),{width:u,height:c}}(e,t,n,r)}isAttached(e){let t=e&&t$(e);return!!(t&&t.isConnected)}}class rt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return eM(this.x)&&eM(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}}function rn(e,t,n,r,i){let o,s,a,l=J(r,0),u=Math.min(J(i,e.length),e.length),c=0;for(n=Math.ceil(n),i&&(n=(o=i-r)/Math.floor(o/n)),a=l;a<0;)a=Math.round(l+ ++c*n);for(s=Math.max(l,0);s<u;s++)s===a&&(t.push(e[s]),a=Math.round(l+ ++c*n))}let rr=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,ri=(e,t)=>Math.min(t||e,e);function ro(e,t){let n=[],r=e.length/t,i=e.length,o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function rs(e){return e.drawTicks?e.tickLength:0}function ra(e,t){if(!e.display)return 0;let n=tk(e.font,t),r=t_(e.padding);return(G(e.text)?e.text.length:1)*n.lineHeight+r.height}class rl extends rt{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=Z(e,1/0),t=Z(t,-1/0),n=Z(n,1/0),r=Z(r,-1/0),{min:Z(e,n),max:Z(t,r),minDefined:Y(e),maxDefined:Y(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds();if(i&&o)return{min:n,max:r};let s=this.getMatchingVisibleMetas();for(let a=0,l=s.length;a<l;++a)t=s[a].controller.getMinMax(this,e),i||(n=Math.min(n,t.min)),o||(r=Math.max(r,t.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Z(n,Z(r,n)),max:Z(r,Z(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){et(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){let{min:r,max:i}=e,o=ee(t,(i-r)/2),s=(e,t)=>n&&0===e?0:e+t;return{min:s(r,-Math.abs(o)),max:s(i,o)}}(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let a=s<this.ticks.length;this._convertTicksToLabels(a?ro(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(e,t){var n;let r,i,o=e.options.ticks,s=(r=(n=e).options.offset,i=n._tickSize(),Math.floor(Math.min(n._length/i+ +!r,n._maxLength/i))),a=Math.min(o.maxTicksLimit||s,s),l=o.major.enabled?function(e){let t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t].major&&r.push(t);return r}(t):[],u=l.length,c=l[0],d=l[u-1],h=[];if(u>a)return function(e,t,n,r){let i,o=0,s=n[0];for(i=0,r=Math.ceil(r);i<e.length;i++)i===s&&(t.push(e[i]),s=n[++o*r])}(t,h,l,u/a),h;let f=function(e,t,n){let r=function(e){let t,n,r=e.length;if(r<2)return!1;for(n=e[0],t=1;t<r;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),i=t.length/n;if(!r)return Math.max(i,1);let o=function(e){let t,n=[],r=Math.sqrt(e);for(t=1;t<r;t++)e%t==0&&(n.push(t),n.push(e/t));return r===(0|r)&&n.push(r),n.sort((e,t)=>e-t).pop(),n}(r);for(let e=0,t=o.length-1;e<t;e++){let t=o[e];if(t>i)return t}return Math.max(i,1)}(l,t,a);if(u>0){let e,n,r=u>1?Math.round((d-c)/(u-1)):null;for(rn(t,h,f,K(r)?0:c-r,c),e=0,n=u-1;e<n;e++)rn(t,h,f,l[e],l[e+1]);return rn(t,h,f,d,K(r)?t.length:d+r),h}return rn(t,h,f),h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){et(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),et(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t,n,r,i=this.options.ticks;for(t=0,n=e.length;t<n;t++)(r=e[t]).label=et(i.callback,[r.value,t,e],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e,t,n,r=this.options,i=r.ticks,o=ri(this.ticks.length,r.ticks.maxTicksLimit),s=i.minRotation||0,a=i.maxRotation,l=s;if(!this._isVisible()||!i.display||s>=a||o<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,h=eN(this.chart.width-c,0,this.maxWidth);c+6>(e=r.offset?this.maxWidth/o:h/(o-1))&&(e=h/(o-(r.offset?.5:1)),t=this.maxHeight-rs(r.grid)-i.padding-ra(r.title,this.chart.options.font),n=Math.sqrt(c*c+d*d),l=Math.max(s,Math.min(a,l=180/em*Math.min(Math.asin(eN((u.highest.height+6)/e,-1,1)),Math.asin(eN(t/n,-1,1))-Math.asin(eN(d/n,-1,1)))))),this.labelRotation=l}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){let o=ra(r,t.options.font);if(s?(e.width=this.maxWidth,e.height=rs(i)+o):(e.height=this.maxHeight,e.width=rs(i)+o),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:o}=this._getLabelSizes(),a=2*n.padding,l=eP(this.labelRotation),u=Math.cos(l),c=Math.sin(l);if(s){let t=n.mirror?0:c*i.width+u*o.height;e.height=Math.min(this.maxHeight,e.height+t+a)}else{let t=n.mirror?0:u*i.width+c*o.height;e.width=Math.min(this.maxWidth,e.width+t+a)}this._calculatePadding(t,r,c,u)}}this._handleMargins(),s?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:o},position:s}=this.options,a=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){let s=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),c=0,d=0;a?l?(c=r*e.width,d=n*t.height):(c=n*e.height,d=r*t.width):"start"===i?d=t.width:"end"===i?c=e.width:"inner"!==i&&(c=e.width/2,d=t.width/2),this.paddingLeft=Math.max((c-s+o)*this.width/(this.width-s),0),this.paddingRight=Math.max((d-u+o)*this.width/(this.width-u),0)}else{let n=t.height/2,r=e.height/2;"start"===i?(n=0,r=e.height):"end"===i&&(n=t.height,r=0),this.paddingTop=n+o,this.paddingBottom=r+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){et(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)K(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=ro(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let r,i,o,s,a,l,u,c,d,h,f,{ctx:p,_longestTextCache:g}=this,m=[],v=[],y=Math.floor(t/ri(t,n)),b=0,x=0;for(r=0;r<t;r+=y){if(s=e[r].label,p.font=l=(a=this._resolveTickFontOptions(r)).string,u=g[l]=g[l]||{data:{},gc:[]},c=a.lineHeight,d=h=0,K(s)||G(s)){if(G(s))for(i=0,o=s.length;i<o;++i)K(f=s[i])||G(f)||(d=ti(p,u.data,u.gc,d,f),h+=c)}else d=ti(p,u.data,u.gc,d,s),h=c;m.push(d),v.push(h),b=Math.max(d,b),x=Math.max(h,x)}en(g,e=>{let n,r=e.gc,i=r.length/2;if(i>t){for(n=0;n<i;++n)delete e.data[r[n]];r.splice(0,i)}});let w=m.indexOf(b),_=v.indexOf(x),k=e=>({width:m[e]||0,height:v[e]||0});return{first:k(0),last:k(t-1),widest:k(w),highest:k(_),widths:m,heights:v}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return eN(this._alignToPixels?to(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){var t,n;let r=this.ticks||[];if(e>=0&&e<r.length){let n=r[e];return n.$context||(t=this.getContext(),n.$context=tC(t,{tick:n,index:e,type:"tick"}))}return this.$context||(this.$context=(n=this.chart.getContext(),tC(n,{scale:this,type:"scale"})))}_tickSize(){let e=this.options.ticks,t=eP(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,s=i?i.widest.width+o:0,a=i?i.highest.height+o:0;return this.isHorizontal()?a*n>s*r?s/n:a/r:a*r<s*n?a/n:s/r}_isVisible(){let e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t,n,r,i,o,s,a,l,u,c,d,h,f=this.axis,p=this.chart,g=this.options,{grid:m,position:v,border:y}=g,b=m.offset,x=this.isHorizontal(),w=this.ticks.length+ +!!b,_=rs(m),k=[],S=y.setContext(this.getContext()),C=S.display?S.width:0,O=C/2,E=function(e){return to(p,e,C)};if("top"===v)t=E(this.bottom),s=this.bottom-_,l=t-O,c=E(e.top)+O,h=e.bottom;else if("bottom"===v)t=E(this.top),c=e.top,h=E(e.bottom)-O,s=t+O,l=this.top+_;else if("left"===v)t=E(this.right),o=this.right-_,a=t-O,u=E(e.left)+O,d=e.right;else if("right"===v)t=E(this.left),u=e.left,d=E(e.right)-O,o=t+O,a=this.left+_;else if("x"===f){if("center"===v)t=E((e.top+e.bottom)/2+.5);else if(X(v)){let e=Object.keys(v)[0],n=v[e];t=E(this.chart.scales[e].getPixelForValue(n))}c=e.top,h=e.bottom,l=(s=t+O)+_}else if("y"===f){if("center"===v)t=E((e.left+e.right)/2);else if(X(v)){let e=Object.keys(v)[0],n=v[e];t=E(this.chart.scales[e].getPixelForValue(n))}a=(o=t-O)-_,u=e.left,d=e.right}let M=J(g.ticks.maxTicksLimit,w),A=Math.max(1,Math.ceil(w/M));for(n=0;n<w;n+=A){let e=this.getContext(n),t=m.setContext(e),f=y.setContext(e),g=t.lineWidth,v=t.color,w=f.dash||[],_=f.dashOffset,S=t.tickWidth,C=t.tickColor,O=t.tickBorderDash||[],E=t.tickBorderDashOffset;void 0!==(r=function(e,t,n){let r,i=e.ticks.length,o=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,l=e.getPixelForTick(o);if(!n||(r=1===i?Math.max(l-s,a-l):0===t?(e.getPixelForTick(1)-l)/2:(l-e.getPixelForTick(o-1))/2,!((l+=o<t?r:-r)<s-1e-6)&&!(l>a+1e-6)))return l}(this,n,b))&&(i=to(p,r,g),x?o=a=u=d=i:s=l=c=h=i,k.push({tx1:o,ty1:s,tx2:a,ty2:l,x1:u,y1:c,x2:d,y2:h,width:g,color:v,borderDash:w,borderDashOffset:_,tickWidth:S,tickColor:C,tickBorderDash:O,tickBorderDashOffset:E}))}return this._ticksLength=w,this._borderValue=t,k}_computeLabelItems(e){let t,n,r,i,o,s,a,l,u,c,d,h=this.axis,f=this.options,{position:p,ticks:g}=f,m=this.isHorizontal(),v=this.ticks,{align:y,crossAlign:b,padding:x,mirror:w}=g,_=rs(f.grid),k=_+x,S=w?-x:k,C=-eP(this.labelRotation),O=[],E="middle";if("top"===p)o=this.bottom-S,s=this._getXAxisLabelAlignment();else if("bottom"===p)o=this.top+S,s=this._getXAxisLabelAlignment();else if("left"===p){let e=this._getYAxisLabelAlignment(_);s=e.textAlign,i=e.x}else if("right"===p){let e=this._getYAxisLabelAlignment(_);s=e.textAlign,i=e.x}else if("x"===h){if("center"===p)o=(e.top+e.bottom)/2+k;else if(X(p)){let e=Object.keys(p)[0],t=p[e];o=this.chart.scales[e].getPixelForValue(t)+k}s=this._getXAxisLabelAlignment()}else if("y"===h){if("center"===p)i=(e.left+e.right)/2-k;else if(X(p)){let e=Object.keys(p)[0],t=p[e];i=this.chart.scales[e].getPixelForValue(t)}s=this._getYAxisLabelAlignment(_).textAlign}"y"===h&&("start"===y?E="top":"end"===y&&(E="bottom"));let M=this._getLabelSizes();for(t=0,n=v.length;t<n;++t){let e;r=v[t].label;let h=g.setContext(this.getContext(t));a=this.getPixelForTick(t)+g.labelOffset,u=(l=this._resolveTickFontOptions(t)).lineHeight;let f=(c=G(r)?r.length:1)/2,y=h.color,x=h.textStrokeColor,_=h.textStrokeWidth,k=s;if(m?(i=a,"inner"===s&&(k=t===n-1?this.options.reverse?"left":"right":0===t?this.options.reverse?"right":"left":"center"),d="top"===p?"near"===b||0!==C?-c*u+u/2:"center"===b?-M.highest.height/2-f*u+u:-M.highest.height+u/2:"near"===b||0!==C?u/2:"center"===b?M.highest.height/2-f*u:M.highest.height-c*u,w&&(d*=-1),0===C||h.showLabelBackdrop||(i+=u/2*Math.sin(C))):(o=a,d=(1-c)*u/2),h.showLabelBackdrop){let r=t_(h.backdropPadding),i=M.heights[t],o=M.widths[t],a=d-r.top,l=0-r.left;switch(E){case"middle":a-=i/2;break;case"bottom":a-=i}switch(s){case"center":l-=o/2;break;case"right":l-=o;break;case"inner":t===n-1?l-=o:t>0&&(l-=o/2)}e={left:l,top:a,width:o+r.width,height:i+r.height,color:h.backdropColor}}O.push({label:r,font:l,textOffset:d,options:{rotation:C,color:y,strokeColor:x,strokeWidth:_,textAlign:k,textBaseline:E,translation:[i,o],backdrop:e}})}return O}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-eP(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){let t,n,{position:r,ticks:{crossAlign:i,mirror:o,padding:s}}=this.options,a=this._getLabelSizes(),l=e+s,u=a.widest.width;return"left"===r?o?(n=this.right+s,"near"===i?t="left":"center"===i?(t="center",n+=u/2):(t="right",n+=u)):(n=this.right-l,"near"===i?t="right":"center"===i?(t="center",n-=u/2):(t="left",n=this.left)):"right"===r?o?(n=this.left+s,"near"===i?t="right":"center"===i?(t="center",n-=u/2):(t="left",n-=u)):(n=this.left+l,"near"===i?t="left":"center"===i?(t="center",n+=u/2):(t="right",n=this.right)):t="right",{textAlign:t,x:n}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t,n,r=this.options.grid,i=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),s=(e,t,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(e.x,e.y),i.lineTo(t.x,t.y),i.stroke(),i.restore())};if(r.display)for(t=0,n=o.length;t<n;++t){let e=o[t];r.drawOnChartArea&&s({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),r.drawTicks&&s({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let e,t,n,r,{chart:i,ctx:o,options:{border:s,grid:a}}=this,l=s.setContext(this.getContext()),u=s.display?l.width:0;if(!u)return;let c=a.setContext(this.getContext(0)).lineWidth,d=this._borderValue;this.isHorizontal()?(e=to(i,this.left,u)-u/2,t=to(i,this.right,c)+c/2,n=r=d):(n=to(i,this.top,u)-u/2,r=to(i,this.bottom,c)+c/2,e=t=d),o.save(),o.lineWidth=l.width,o.strokeStyle=l.color,o.beginPath(),o.moveTo(e,n),o.lineTo(t,r),o.stroke(),o.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();for(let r of(n&&tc(t,n),this.getLabelItems(e))){let e=r.options,n=r.font;tp(t,r.label,0,r.textOffset,n,e)}n&&td(t)}drawTitle(){let e,t,{ctx:n,options:{position:r,title:i,reverse:o}}=this;if(!i.display)return;let s=tk(i.font),a=t_(i.padding),l=i.align,u=s.lineHeight/2;"bottom"===r||"center"===r||X(r)?(u+=a.bottom,G(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;let{titleX:c,titleY:d,maxWidth:h,rotation:f}=function(e,t,n,r){let i,o,s,{top:a,left:l,bottom:u,right:c,chart:d}=e,{chartArea:h,scales:f}=d,p=0,g=u-a,m=c-l;if(e.isHorizontal()){if(o=eK(r,l,c),X(n)){let e=Object.keys(n)[0],r=n[e];s=f[e].getPixelForValue(r)+g-t}else s="center"===n?(h.bottom+h.top)/2+g-t:rr(e,n,t);i=c-l}else{if(X(n)){let e=Object.keys(n)[0],r=n[e];o=f[e].getPixelForValue(r)-m+t}else o="center"===n?(h.left+h.right)/2-m+t:rr(e,n,t);s=eK(r,u,a),p="left"===n?-ew:ew}return{titleX:o,titleY:s,maxWidth:i,rotation:p}}(this,u,r,l);tp(n,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:f,textAlign:(e=eQ(l),(o&&"right"!==r||!o&&"right"===r)&&(e="left"===(t=e)?"right":"right"===t?"left":t),e),textBaseline:"middle",translation:[c,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,n=J(e.grid&&e.grid.z,-1),r=J(e.border&&e.border.z,0);return this._isVisible()&&this.draw===rl.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){let t,n,r=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",o=[];for(t=0,n=r.length;t<n;++t){let n=r[t];n[i]!==this.id||e&&n.type!==e||o.push(n)}return o}_resolveTickFontOptions(e){return tk(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ru{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){var t,n,r,i,o,s;let a,l,u=Object.getPrototypeOf(e);"id"in(t=u)&&"defaults"in t&&(l=this.register(u));let c=this.items,d=e.id,h=this.scope+"."+d;if(!d)throw Error("class does not have id: "+e);return d in c||(c[d]=e,n=e,r=h,i=l,a=ea(Object.create(null),[i?tr.get(i):{},tr.get(r),n.defaults]),tr.set(r,a),n.defaultRoutes&&(o=r,Object.keys(s=n.defaultRoutes).forEach(e=>{let t=e.split("."),n=t.pop(),r=[o].concat(t).join("."),i=s[e].split("."),a=i.pop(),l=i.join(".");tr.route(r,n,l,a)})),n.descriptors&&tr.describe(r,n.descriptors),this.override&&tr.override(e.id,e.overrides)),h}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in tr[r]&&(delete tr[r][n],this.override&&delete e9[n])}}var rc=new class{constructor(){this.controllers=new ru(ny,"datasets",!0),this.elements=new ru(rt,"elements"),this.plugins=new ru(Object,"plugins"),this.scales=new ru(rl,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):en(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=eh(e);et(n["before"+r],[],n),t[e](n),et(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(void 0===r)throw Error('"'+e+'" is not a registered '+n+".");return r}};class rd{constructor(){this._init=void 0}notify(e,t,n,r){if("beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),void 0===this._init)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,t,n);return"afterDestroy"===t&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,t,n,r){for(let i of(r=r||{},e)){let e=i.plugin;if(!1===et(e[n],[t,r,i.options],e)&&r.cancelable)return!1}return!0}invalidate(){K(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=J(n.options&&n.options.plugins,{}),i=function(e){let t={},n=[],r=Object.keys(rc.plugins.items);for(let e=0;e<r.length;e++)n.push(rc.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];-1===n.indexOf(r)&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,{plugins:t,localIds:n},r,i){let o=[],s=e.getContext();for(let l of t){var a;let t=l.id,u=(a=r[t],i||!1!==a?!0===a?{}:a:null);null!==u&&o.push({plugin:l,options:function(e,{plugin:t,local:n},r,i){let o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(e.config,{plugin:l,local:n[t]},u,s)})}return o}(e,i,r,t):[]}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function rh(e,t){let n=tr.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function rf(e){if("x"===e||"y"===e||"r"===e)return e}function rp(e,...t){if(rf(e))return e;for(let r of t){var n;let t=r.axis||("top"===(n=r.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||e.length>1&&rf(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function rg(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function rm(e){let t,n,r,i,o=e.options||(e.options={});o.plugins=J(o.plugins,{}),t=e9[e.type]||{scales:{}},n=o.scales||{},r=rh(e.type,o),i=Object.create(null),Object.keys(n).forEach(o=>{let s=n[o];if(!X(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let a=rp(o,s,function(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return rg(e,"x",n[0])||rg(e,"y",n[0])}return{}}(o,e),tr.scales[s.type]),l=a===r?"_index_":"_value_",u=t.scales||{};i[o]=el(Object.create(null),[{axis:a},s,u[a],u[l]])}),e.data.datasets.forEach(t=>{let r=t.type||e.type,s=t.indexAxis||rh(r,o),a=(e9[r]||{}).scales||{};Object.keys(a).forEach(e=>{let r,o=(r=e,"_index_"===e?r=s:"_value_"===e&&(r="x"===s?"y":"x"),r),l=t[o+"AxisID"]||o;i[l]=i[l]||Object.create(null),el(i[l],[{axis:o},n[l],a[e]])})}),Object.keys(i).forEach(e=>{let t=i[e];el(t,[tr.scales[t.type],tr.scale])}),o.scales=i}function rv(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}let ry=new Map,rb=new Set;function rx(e,t){let n=ry.get(e);return n||(n=t(),ry.set(e,n),rb.add(n)),n}let rw=(e,t,n)=>{let r=ed(t,n);void 0!==r&&e.add(r)};class r_{constructor(e){this._config=function(e){return(e=e||{}).data=rv(e.data),rm(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=rv(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),rm(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return rx(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return rx(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return rx(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,n=this.type;return rx(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,o=this._cachedScopes(e,n),s=o.get(t);if(s)return s;let a=new Set;t.forEach(t=>{e&&(a.add(e),t.forEach(t=>rw(a,e,t))),t.forEach(e=>rw(a,r,e)),t.forEach(e=>rw(a,e9[i]||{},e)),t.forEach(e=>rw(a,tr,e)),t.forEach(e=>rw(a,te,e))});let l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),rb.has(t)&&o.set(t,l),l}chartOptionScopes(){let{options:e,type:t}=this;return[e,e9[t]||{},tr.datasets[t]||{},{type:t},tr,te]}resolveNamedOptions(e,t,n,r=[""]){let i={$shared:!0},{resolver:o,subPrefixes:s}=rk(this._resolverCache,e,r),a=o;if(function(e,t){let{isScriptable:n,isIndexable:r}=tM(e);for(let i of t){let t=n(i),o=r(i),s=(o||t)&&e[i];if(t&&(ep(s)||rS(s))||o&&G(s))return!0}return!1}(o,t)){i.$shared=!1,n=ep(n)?n():n;let t=this.createResolver(e,n,s);a=tE(o,n,t)}for(let e of t)i[e]=a[e];return i}createResolver(e,t,n=[""],r){let{resolver:i}=rk(this._resolverCache,e,n);return X(t)?tE(i,t,void 0,r):i}}function rk(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),o=r.get(i);return o||(o={resolver:tO(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes("hover"))},r.set(i,o)),o}let rS=e=>X(e)&&Object.getOwnPropertyNames(e).some(t=>ep(e[t])),rC=["top","bottom","left","right","chartArea"];function rO(e,t){return"top"===e||"bottom"===e||-1===rC.indexOf(e)&&"x"===t}function rE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function rM(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function rA(e){let t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function rP(e){return tH()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}let rT={},rR=e=>{let t=rP(e);return Object.values(rT).filter(e=>e.canvas===t).pop()};class rI{static defaults=tr;static instances=rT;static overrides=e9;static registry=rc;static version="4.5.1";static getChart=rR;static register(...e){rc.add(...e),rD()}static unregister(...e){rc.remove(...e),rD()}constructor(e,t){const n=this.config=new r_(t),r=rP(e),i=rR(r);if(i)throw Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(!tH()||"undefined"!=typeof OffscreenCanvas&&r instanceof OffscreenCanvas?nX:re)),this.platform.updateConfig(n);const s=this.platform.acquireContext(r,o.aspectRatio),a=s&&s.canvas,l=a&&a.height,u=a&&a.width;if(this.id=Q(),this.ctx=s,this.canvas=a,this.width=u,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new rd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}(e=>this.update(e),o.resizeDelay||0),this._dataChanges=[],rT[this.id]=this,!s||!a)return void console.error("Failed to create chart: can't acquire context from the given item");nr.listen(this,"complete",rM),nr.listen(this,"progress",rA),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return K(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return rc}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tX(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ts(this.canvas,this.ctx),this}stop(){return nr.stop(this),this}resize(e,t){nr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,t,i),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tX(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),et(n.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){en(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=rp(e,n),i="r"===r,o="x"===r;return{options:n,dposition:i?"chartArea":o?"bottom":"left",dtype:i?"radialLinear":o?"category":"linear"}}))),en(i,t=>{let i=t.options,o=i.id,s=rp(o,i),a=J(i.type,t.dtype);(void 0===i.position||rO(i.position,s)!==rO(t.dposition))&&(i.position=t.dposition),r[o]=!0;let l=null;o in n&&n[o].type===a?l=n[o]:n[(l=new(rc.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this})).id]=l,l.init(i,e)}),en(r,(e,t)=>{e||delete n[t]}),en(n,e=>{nK.configure(this,e,e.options),nK.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(rE("order","index"))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e,t,n=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),e=0,t=r.length;e<t;e++){let t=r[e],i=this.getDatasetMeta(e),o=t.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(e),i=this.getDatasetMeta(e)),i.type=o,i.indexAxis=t.indexAxis||rh(o,this.options),i.order=t.order||0,i.index=e,i.label=""+t.label,i.visible=this.isDatasetVisible(e),i.controller)i.controller.updateIndex(e),i.controller.linkScales();else{let t=rc.getController(o),{datasetElementType:r,dataElementType:s}=tr.datasets[o];Object.assign(t,{dataElementType:rc.getElement(s),datasetElementType:r&&rc.getElement(r)}),i.controller=new t(this,e),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){en(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;let i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&-1===i.indexOf(t);t.buildOrUpdateElements(n),o=Math.max(+t.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),r||en(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(rE("z","_idx"));let{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){en(this.scales,e=>{nK.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;eg(new Set(Object.keys(this._listeners)),new Set(e.events))&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this;for(let{method:n,start:r,count:i}of this._getUniformDataChanges()||[]){var t="_removeElements"===n?-i:i;for(let n of Object.keys(e)){let i=+n;if(i>=r){let o=e[n];delete e[n],(t>0||i>r)&&(e[i+t]=o)}}}}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),r=n(0);for(let e=1;e<t;e++)if(!eg(r,n(e)))return;return Array.from(r).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;nK.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],en(this.boxes,e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,ep(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(nr.has(this)?this.attached&&!nr.running(this)&&nr.start(this):(this.draw(),rM({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){let t,n,r=this._sortedMetasets,i=[];for(t=0,n=r.length;t<n;++t){let n=r[t];(!e||n.visible)&&i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=nn(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(r&&tc(t,r),e.controller.draw(),r&&td(t),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(e){return tu(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=nF.modes[t];return"function"==typeof i?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=tC(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);ef(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),o.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),nr.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),ts(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete rT[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};en(this.options.events,e=>n(e,r))}bindResponsiveEvents(){let e;this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,r=(e,r)=>{n.addEventListener(this,e,r),t[e]=r},i=(e,r)=>{t[e]&&(n.removeEventListener(this,e,r),delete t[e])},o=(e,t)=>{this.canvas&&this.resize(e,t)},s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",e)};e=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():e()}unbindEvents(){en(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},en(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r,i,o,s=n?"set":"remove";for("dataset"===t&&this.getDatasetMeta(e[0].datasetIndex).controller["_"+s+"DatasetHoverStyle"](),i=0,o=e.length;i<o;++i){let t=(r=e[i])&&this.getDatasetMeta(r.datasetIndex).controller;t&&t[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}});er(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),o=i(t,e),s=n?e:i(e,t);o.length&&this.updateHoverStyle(o,r.mode,!1),s.length&&r.mode&&this.updateHoverStyle(s,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){var r;let{_active:i=[],options:o}=this,s=this._getActiveElements(e,i,n,t),a="mouseup"===e.type||"click"===e.type||"contextmenu"===e.type,l=(r=this._lastEvent,n&&"mouseout"!==e.type?a?r:e:null);n&&(this._lastEvent=null,et(o.onHover,[e,s,this],this),a&&et(o.onClick,[e,s,this],this));let u=!er(s,i);return(u||t)&&(this._active=s,this._updateHoverStyles(s,i,t)),this._lastEvent=l,u}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}}function rD(){return en(rI.instances,e=>e._plugins.invalidate())}function rL(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rj(e,t,n,r,i,o){var s,a,l,u;let c,d,h,f,{x:p,y:g,startAngle:m,pixelMargin:v,innerRadius:y}=t,b=Math.max(t.outerRadius+r+n-v,0),x=y>0?y+r+n+v:0,w=0,_=i-m;if(r){let e=b>0?b-r:0,t=((y>0?y-r:0)+e)/2;w=(_-(0!==t?_*t/(t+r):_))/2}let k=Math.max(.001,_*b-n/em)/b,S=(_-k)/2,C=m+S+w,O=i-S-w,{outerStart:E,outerEnd:M,innerStart:A,innerEnd:P}=(s=t,a=x,l=b,u=O-C,c=tb(s.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),h=Math.min(d=(l-a)/2,u*a/2),{outerStart:(f=e=>{let t=(l-Math.min(d,e))*u/2;return eN(e,0,Math.min(d,t))})(c.outerStart),outerEnd:f(c.outerEnd),innerStart:eN(c.innerStart,0,h),innerEnd:eN(c.innerEnd,0,h)}),T=b-E,R=b-M,I=C+E/T,D=O-M/R,L=x+A,j=x+P,N=C+A/L,F=O-P/j;if(e.beginPath(),o){let t=(I+D)/2;if(e.arc(p,g,b,I,t),e.arc(p,g,b,t,D),M>0){let t=rL(R,D,p,g);e.arc(t.x,t.y,M,D,O+ew)}let n=rL(j,O,p,g);if(e.lineTo(n.x,n.y),P>0){let t=rL(j,F,p,g);e.arc(t.x,t.y,P,O+ew,F+Math.PI)}let r=(O-P/x+(C+A/x))/2;if(e.arc(p,g,x,O-P/x,r,!0),e.arc(p,g,x,r,C+A/x,!0),A>0){let t=rL(L,N,p,g);e.arc(t.x,t.y,A,N+Math.PI,C-ew)}let i=rL(T,C,p,g);if(e.lineTo(i.x,i.y),E>0){let t=rL(T,I,p,g);e.arc(t.x,t.y,E,C-ew,I)}}else{e.moveTo(p,g);let t=Math.cos(I)*b+p,n=Math.sin(I)*b+g;e.lineTo(t,n);let r=Math.cos(D)*b+p,i=Math.sin(D)*b+g;e.lineTo(r,i)}e.closePath()}class rN extends rt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=eR(this.getProps(["x","y"],n),{x:e,y:t}),{startAngle:o,endAngle:s,innerRadius:a,outerRadius:l,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),c=(this.options.spacing+this.options.borderWidth)/2,d=J(u,s-o),h=ej(r,o,s)&&o!==s,f=d>=ev||h,p=eF(i,a+c,l+c);return f&&p}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:o,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:a,spacing:l}=this.options,u=(r+i)/2,c=(o+s+l+a)/2;return{x:t+Math.cos(u)*c,y:n+Math.sin(u)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=.33*("inner"===t.borderAlign),this.fullCircles=n>ev?Math.floor(n/ev):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();let s=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(s)*r,Math.sin(s)*r);let a=r*(1-Math.sin(Math.min(em,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,i){let{fullCircles:o,startAngle:s,circumference:a}=t,l=t.endAngle;if(o){rj(e,t,n,r,l,i);for(let t=0;t<o;++t)e.fill();isNaN(a)||(l=s+(a%ev||ev))}rj(e,t,n,r,l,i),e.fill()}(e,this,a,i,o),function(e,t,n,r,i){let{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h,borderRadius:f}=l,p="inner"===l.borderAlign;if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=2*u,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(o){rj(e,t,n,r,g,i);for(let t=0;t<o;++t)e.stroke();isNaN(a)||(g=s+(a%ev||ev))}p&&function(e,t,n){let{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t,u=i/a;e.beginPath(),e.arc(o,s,a,r-u,n+u),l>i?(u=i/l,e.arc(o,s,l,n+u,r-u,!0)):e.arc(o,s,i,n+ew,r-ew),e.closePath(),e.clip()}(e,t,g),l.selfJoin&&g-s>=em&&0===f&&"miter"!==c&&function(e,t,n){let{startAngle:r,x:i,y:o,outerRadius:s,innerRadius:a,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,d=Math.min(u/s,eL(r-n));if(e.beginPath(),e.arc(i,o,s-u/2,r+d/2,n-d/2),a>0){let t=Math.min(u/a,eL(r-n));e.arc(i,o,a+u/2,n-t/2,r+t/2,!0)}else{let t=Math.min(u/2,s*eL(r-n));if("round"===c)e.arc(i,o,t,n-em/2,r+em/2,!0);else if("bevel"===c){let s=2*t*t,a=-s*Math.cos(n+em/2)+i,l=-s*Math.sin(n+em/2)+o,u=s*Math.cos(r+em/2)+i,c=s*Math.sin(r+em/2)+o;e.lineTo(a,l),e.lineTo(u,c)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}(e,t,g),o||(rj(e,t,n,r,g,i),e.stroke())}(e,this,a,i,o),e.restore()}}function rF(e,t,n=t){e.lineCap=J(n.borderCapStyle,t.borderCapStyle),e.setLineDash(J(n.borderDash,t.borderDash)),e.lineDashOffset=J(n.borderDashOffset,t.borderDashOffset),e.lineJoin=J(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=J(n.borderWidth,t.borderWidth),e.strokeStyle=J(n.borderColor,t.borderColor)}function rB(e,t,n){e.lineTo(n.x,n.y)}function rz(e,t,n={}){let r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),u=Math.min(o,a);return{count:r,start:l,loop:t.loop,ilen:u<l&&!(i<s&&o<s||i>a&&o>a)?r+u-l:u-l}}function rV(e,t,n,r){let i,o,s,{points:a,options:l}=t,{count:u,start:c,loop:d,ilen:h}=rz(a,n,r),f=l.stepped?th:l.tension||"monotone"===l.cubicInterpolationMode?tf:rB,{move:p=!0,reverse:g}=r||{};for(i=0;i<=h;++i)(o=a[(c+(g?h-i:i))%u]).skip||(p?(e.moveTo(o.x,o.y),p=!1):f(e,s,o,g,l.stepped),s=o);return d&&f(e,s,o=a[(c+(g?h:0))%u],g,l.stepped),!!d}function rH(e,t,n,r){let i,o,s,a,l,u,c=t.points,{count:d,start:h,ilen:f}=rz(c,n,r),{move:p=!0,reverse:g}=r||{},m=0,v=0,y=e=>(h+(g?f-e:e))%d,b=()=>{a!==l&&(e.lineTo(m,l),e.lineTo(m,a),e.lineTo(m,u))};for(p&&(o=c[y(0)],e.moveTo(o.x,o.y)),i=0;i<=f;++i){if((o=c[y(i)]).skip)continue;let t=o.x,n=o.y,r=0|t;r===s?(n<a?a=n:n>l&&(l=n),m=(v*m+t)/++v):(b(),e.lineTo(t,n),s=r,v=0,a=l=n),u=n}b()}function r$(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n?rV:rH}let rW="function"==typeof Path2D;class rU extends rt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;!function(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)!function(e,t="x"){let n,r,i,o=tz(t),s=e.length,a=Array(s).fill(0),l=Array(s),u=tB(e,0);for(n=0;n<s;++n)if(r=i,i=u,u=tB(e,n+1),i){if(u){let e=u[t]-i[t];a[n]=0!==e?(u[o]-i[o])/e:0}l[n]=r?u?eC(a[n-1])!==eC(a[n])?0:(a[n-1]+a[n])/2:a[n-1]:a[n]}!function(e,t,n){let r,i,o,s,a,l=e.length,u=tB(e,0);for(let c=0;c<l-1;++c)if(a=u,u=tB(e,c+1),a&&u){if(eO(t[c],0,tF)){n[c]=n[c+1]=0;continue}(s=Math.pow(r=n[c]/t[c],2)+Math.pow(i=n[c+1]/t[c],2))<=9||(o=3/Math.sqrt(s),n[c]=r*o*t[c],n[c+1]=i*o*t[c])}}(e,a,l),function(e,t,n="x"){let r,i,o,s=tz(n),a=e.length,l=tB(e,0);for(let u=0;u<a;++u){if(i=o,o=l,l=tB(e,u+1),!o)continue;let a=o[n],c=o[s];i&&(r=(a-i[n])/3,o[`cp1${n}`]=a-r,o[`cp1${s}`]=c-r*t[u]),l&&(r=(l[n]-a)/3,o[`cp2${n}`]=a+r,o[`cp2${s}`]=c+r*t[u])}}(e,l,t)}(e,i);else{let n=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)l=function(e,t,n,r){let i=e.skip?t:e,o=n.skip?t:n,s=eI(t,i),a=eI(o,t),l=s/(s+a),u=a/(s+a);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let c=r*l,d=r*u;return{previous:{x:t.x-c*(o.x-i.x),y:t.y-c*(o.y-i.y)},next:{x:t.x+d*(o.x-i.x),y:t.y+d*(o.y-i.y)}}}(n,a=e[o],e[Math.min(o+1,s-!r)%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,n=a}t.capBezierPoints&&function(e,t){let n,r,i,o,s,a=tu(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&tu(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=tV(i.cp1x,t.left,t.right),i.cp1y=tV(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=tV(i.cp2x,t.left,t.right),i.cp2y=tV(i.cp2y,t.top,t.bottom)))}(e,n)}(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let o=!!e._loop,{start:s,end:a}=function(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return{start:i,end:o%=t}}(n,i,o,r);if(!0===r)return t9(e,[{start:s,end:a,loop:o}],n,t);let l=a<s?a+i:a,u=!!e._fullLoop&&0===s&&a===i-1;return t9(e,function(e,t,n,r){let i,o=e.length,s=[],a=t,l=e[t];for(i=t+1;i<=n;++i){let n=e[i%o];n.skip||n.stop?l.skip||(r=!1,s.push({start:t%o,end:(i-1)%o,loop:r}),t=a=n.stop?i:null):(a=i,l.skip&&(t=i)),l=n}return null!==a&&s.push({start:t%o,end:a%o,loop:r}),s}(n,s,l,u),n,t)}(this,this.options.segment))}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n,r,i=this.options,o=e[t],s=this.points,a=t7(this,{property:t,start:o,end:o});if(!a.length)return;let l=[],u=i.stepped?t0:i.tension||"monotone"===i.cubicInterpolationMode?t1:tJ;for(n=0,r=a.length;n<r;++n){let{start:r,end:c}=a[n],d=s[r],h=s[c];if(d===h){l.push(d);continue}let f=Math.abs((o-d[t])/(h[t]-d[t])),p=u(d,h,f,i.stepped);p[t]=e[t],l.push(p)}return 1===l.length?l[0]:l}pathSegment(e,t,n){return r$(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=r$(this),o=this._loop;for(let s of(t=t||0,n=n||this.points.length-t,r))o&=i(e,this,s,{start:t,end:t+n-1});return!!o}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),function(e,t,n,r){if(rW&&!t.options.segment){let i;(i=t._path)||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),rF(e,t.options),e.stroke(i)}else!function(e,t,n,r){let{segments:i,options:o}=t,s=r$(t);for(let a of i)rF(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}(e,t,n,r)}(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function rq(e,t){let n,r,i,o,s,{x:a,y:l,base:u,width:c,height:d}=e.getProps(["x","y","base","width","height"],t);return e.horizontal?(s=d/2,n=Math.min(a,u),r=Math.max(a,u),i=l-s,o=l+s):(n=a-(s=c/2),r=a+s,i=Math.min(l,u),o=Math.max(l,u)),{left:n,top:i,right:r,bottom:o}}function rQ(e,t,n,r){return e?0:eN(t,n,r)}function rK(e,t,n,r){let i=null===t,o=null===n,s=e&&!(i&&o)&&rq(e,r);return s&&(i||eF(t,s.left,s.right))&&(o||eF(n,s.top,s.bottom))}function rG(e,t){e.rect(t.x,t.y,t.w,t.h)}function rX(e,t,n={}){let r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class rY extends rt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){var t,n,r;let i,o,s,a,l,u,c,d,{inflateAmount:h,options:{borderColor:f,backgroundColor:p}}=this,{inner:g,outer:m}=(o=(i=rq(this)).right-i.left,s=i.bottom-i.top,t=o/2,n=s/2,a=this.options.borderWidth,l=this.borderSkipped,u=tx(a),c={t:rQ(l.top,u.top,0,n),r:rQ(l.right,u.right,0,t),b:rQ(l.bottom,u.bottom,0,n),l:rQ(l.left,u.left,0,t)},d=function(e,t,n){let{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=tw(i),s=Math.min(t,n),a=e.borderSkipped,l=r||X(i);return{topLeft:rQ(!l||a.top||a.left,o.topLeft,0,s),topRight:rQ(!l||a.top||a.right,o.topRight,0,s),bottomLeft:rQ(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:rQ(!l||a.bottom||a.right,o.bottomRight,0,s)}}(this,o/2,s/2),{outer:{x:i.left,y:i.top,w:o,h:s,radius:d},inner:{x:i.left+c.l,y:i.top+c.t,w:o-c.l-c.r,h:s-c.t-c.b,radius:{topLeft:Math.max(0,d.topLeft-Math.max(c.t,c.l)),topRight:Math.max(0,d.topRight-Math.max(c.t,c.r)),bottomLeft:Math.max(0,d.bottomLeft-Math.max(c.b,c.l)),bottomRight:Math.max(0,d.bottomRight-Math.max(c.b,c.r))}}}),v=(r=m.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?tg:rG;e.save(),(m.w!==g.w||m.h!==g.h)&&(e.beginPath(),v(e,rX(m,h,g)),e.clip(),v(e,rX(g,-h,m)),e.fillStyle=f,e.fill("evenodd")),e.beginPath(),v(e,rX(g,h)),e.fillStyle=p,e.fill(),e.restore()}inRange(e,t,n){return rK(this,e,t,n)}inXRange(e,t){return rK(this,e,null,t)}inYRange(e,t){return rK(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}let rZ=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],rJ=rZ.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)")),r0=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}};class r1 extends rt{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=et(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let e,t,{options:n,ctx:r}=this;if(!n.display){this.width=this.height=0;return}let i=n.labels,o=tk(i.font),s=o.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=r0(i,s);r.font=o.string,this.isHorizontal()?(e=this.maxWidth,t=this._fitRows(a,s,l,u)+10):(t=this.maxHeight,e=this._fitCols(a,o,l,u)+10),this.width=Math.min(e,n.maxWidth||this.maxWidth),this.height=Math.min(t,n.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:o,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],u=r+s,c=e;i.textAlign="left",i.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((e,f)=>{let p=n+t/2+i.measureText(e.text).width;(0===f||l[l.length-1]+p+2*s>o)&&(c+=u,l[l.length-(f>0?0:1)]=0,h+=u,d++),a[f]={left:0,top:h,row:d,width:p,height:r},l[l.length-1]+=p+s}),c}_fitCols(e,t,n,r){let{ctx:i,maxHeight:o,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],u=o-e,c=s,d=0,h=0,f=0,p=0;return this.legendItems.forEach((e,o)=>{var g,m,v,y,b,x,w,_,k,S,C,O;let E,M,{itemWidth:A,itemHeight:P}=(g=n,m=t,v=i,y=e,b=r,{itemWidth:(x=y,w=g,_=m,k=v,(E=x.text)&&"string"!=typeof E&&(E=E.reduce((e,t)=>e.length>t.length?e:t)),w+_.size/2+k.measureText(E).width),itemHeight:(S=b,C=y,O=m.lineHeight,M=S,"string"!=typeof C.text&&(M=r2(C,O)),M)});o>0&&h+P+2*s>u&&(c+=d+s,l.push({width:d,height:h}),f+=d+s,p++,d=h=0),a[o]={left:f,top:h,col:p,width:A,height:P},d=Math.max(d,A),h+=P+s}),c+=d,l.push({width:d,height:h}),c}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,o=t2(i,this.left,this.width);if(this.isHorizontal()){let i=0,s=eK(n,this.left+r,this.right-this.lineWidths[i]);for(let a of t)i!==a.row&&(i=a.row,s=eK(n,this.left+r,this.right-this.lineWidths[i])),a.top+=this.top+e+r,a.left=o.leftForLtr(o.x(s),a.width),s+=a.width+r}else{let i=0,s=eK(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let a of t)a.col!==i&&(i=a.col,s=eK(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),a.top=s,a.left+=this.left+r,a.left=o.leftForLtr(o.x(a.left),a.width),s+=a.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let e=this.ctx;tc(e,this),this._draw(),td(e)}}_draw(){let e,{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=tr.color,l=t2(t.rtl,this.left,this.width),u=tk(s.font),{padding:c}=s,d=u.size,h=d/2;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;let{boxWidth:f,boxHeight:p,itemHeight:g}=r0(s,d),m=function(e,t,n){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;i.save();let r=J(n.lineWidth,1);if(i.fillStyle=J(n.fillStyle,a),i.lineCap=J(n.lineCap,"butt"),i.lineDashOffset=J(n.lineDashOffset,0),i.lineJoin=J(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=J(n.strokeStyle,a),i.setLineDash(J(n.lineDash,[])),s.usePointStyle)tl(i,{radius:p*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},l.xPlus(e,f/2),t+h,s.pointStyleWidth&&f);else{let o=t+Math.max((d-p)/2,0),s=l.leftForLtr(e,f),a=tw(n.borderRadius);i.beginPath(),Object.values(a).some(e=>0!==e)?tg(i,{x:s,y:o,w:f,h:p,radius:a}):i.rect(s,o,f,p),i.fill(),0!==r&&i.stroke()}i.restore()},v=function(e,t,n){tp(i,n.text,e,t+g/2,u,{strikethrough:n.hidden,textAlign:l.textAlign(n.textAlign)})},y=this.isHorizontal(),b=this._computeTitleHeight();e=y?{x:eK(o,this.left+c,this.right-r[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:eK(o,this.top+b+c,this.bottom-n[0].height),line:0},t5(this.ctx,t.textDirection);let x=g+c;this.legendItems.forEach((a,d)=>{var p,g;i.strokeStyle=a.fontColor,i.fillStyle=a.fontColor;let w=i.measureText(a.text).width,_=l.textAlign(a.textAlign||(a.textAlign=s.textAlign)),k=f+h+w,S=e.x,C=e.y;if(l.setWidth(this.width),y?d>0&&S+k+c>this.right&&(C=e.y+=x,e.line++,S=e.x=eK(o,this.left+c,this.right-r[e.line])):d>0&&C+x>this.bottom&&(S=e.x=S+n[e.line].width+c,e.line++,C=e.y=eK(o,this.top+b+c,this.bottom-n[e.line].height)),m(l.x(S),C,a),p=S+f+h,g=y?S+k:this.right,S=_===(t.rtl?"left":"right")?g:"center"===_?(p+g)/2:p,v(l.x(S),C,a),y)e.x+=k+c;else if("string"!=typeof a.text){let t=u.lineHeight;e.y+=r2(a,t)+c}else e.y+=x}),t3(this.ctx,t.textDirection)}drawTitle(){let e,t=this.options,n=t.title,r=tk(n.font),i=t_(n.padding);if(!n.display)return;let o=t2(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,u=i.top+l,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),e=this.top+u,c=eK(t.align,c,this.right-d);else{let n=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);e=u+eK(t.align,this.top,this.bottom-n-t.labels.padding-this._computeTitleHeight())}let h=eK(a,c,c+d);s.textAlign=o.textAlign(eQ(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,tp(s,n.text,h,e,r)}_computeTitleHeight(){let e=this.options.title,t=tk(e.font),n=t_(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(eF(e,this.left,this.right)&&eF(t,this.top,this.bottom)){for(n=0,i=this.legendHitBoxes;n<i.length;++n)if(eF(e,(r=i[n]).left,r.left+r.width)&&eF(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){var t,n;let r=this.options;if(t=e.type,n=r,("mousemove"!==t&&"mouseout"!==t||!n.onHover&&!n.onLeave)&&(!n.onClick||"click"!==t&&"mouseup"!==t))return;let i=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){let t=this._hoveredItem,n=null!==t&&null!==i&&t.datasetIndex===i.datasetIndex&&t.index===i.index;t&&!n&&et(r.onLeave,[e,t,this],this),this._hoveredItem=i,i&&!n&&et(r.onHover,[e,i,this],this)}else i&&et(r.onClick,[e,i,this],this)}}function r2(e,t){return t*(e.text?e.text.length:0)}var r5={id:"legend",_element:r1,start(e,t,n){let r=e.legend=new r1({ctx:e.ctx,options:n,chart:e});nK.configure(e,r,n),nK.addBox(e,r)},stop(e){nK.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;nK.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let l=e.controller.getStyle(n?0:void 0),u=t_(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:s&&(a||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class r3 extends rt{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=G(n.text)?n.text.length:1;this._padding=t_(n.padding);let i=r*tk(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){let t,n,r,{top:i,left:o,bottom:s,right:a,options:l}=this,u=l.align,c=0;return this.isHorizontal()?(n=eK(u,o,a),r=i+e,t=a-o):("left"===l.position?(n=o+e,r=eK(u,s,i),c=-.5*em):(n=a-e,r=eK(u,i,s),c=.5*em),t=s-i),{titleX:n,titleY:r,maxWidth:t,rotation:c}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=tk(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:o,maxWidth:s,rotation:a}=this._drawArgs(r);tp(e,t.text,0,0,n,{color:t.color,maxWidth:s,rotation:a,textAlign:eQ(t.align),textBaseline:"middle",translation:[i,o]})}}var r4={id:"title",_element:r3,start(e,t,n){let r;r=new r3({ctx:e.ctx,options:n,chart:e}),nK.configure(e,r,n),nK.addBox(e,r),e.titleBlock=r},stop(e){let t=e.titleBlock;nK.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;nK.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;let r8={average(e){let t,n;if(!e.length)return!1;let r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++o}}return 0!==o&&0!==r.size&&{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/o}},nearest(e,t){let n,r,i;if(!e.length)return!1;let o=t.x,s=t.y,a=1/0;for(n=0,r=e.length;n<r;++n){let r=e[n].element;if(r&&r.hasValue()){let e=eI(t,r.getCenterPoint());e<a&&(a=e,i=r)}}if(i){let e=i.tooltipPosition();o=e.x,s=e.y}return{x:o,y:s}}};function r6(e,t){return t&&(G(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function r7(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function r9(e,t){let n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=tk(t.bodyFont),u=tk(t.titleFont),c=tk(t.footerFont),d=o.length,h=i.length,f=r.length,p=t_(t.padding),g=p.height,m=0,v=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);v+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v&&(g+=f*(t.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*t.bodySpacing),h&&(g+=t.footerMarginTop+h*c.lineHeight+(h-1)*t.footerSpacing);let y=0,b=function(e){m=Math.max(m,n.measureText(e).width+y)};return n.save(),n.font=u.string,en(e.title,b),n.font=l.string,en(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?s+2+t.boxPadding:0,en(r,e=>{en(e.before,b),en(e.lines,b),en(e.after,b)}),y=0,n.font=c.string,en(e.footer,b),n.restore(),{width:m+=p.width,height:g}}function ie(e,t,n){let r=n.yAlign||t.yAlign||function(e,t){let{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||function(e,t,n,r){let{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e,u="center";return"center"===r?u=i<=(a+l)/2?"left":"right":i<=o/2?u="left":i>=s-o/2&&(u="right"),function(e,t,n,r){let{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if("left"===e&&i+o+s>t.width||"right"===e&&i-o-s<0)return!0}(u,e,t,n)&&(u="center"),u}(e,t,n,r),yAlign:r}}function it(e,t,n,r){let{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,u=i+o,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=tw(s),p=function(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,a),g=function(e,t,n){let{y:r,height:i}=e;return"top"===t?r+=n:"bottom"===t?r-=i+n:r-=i/2,r}(t,l,u);return"center"===l?"left"===a?p+=u:"right"===a&&(p-=u):"left"===a?p-=Math.max(c,h)+i:"right"===a&&(p+=Math.max(d,f)+i),{x:eN(p,0,r.width-t.width),y:eN(g,0,r.height-t.height)}}function ir(e,t,n){let r=t_(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function ii(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}let io={beforeTitle:q,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:q,beforeBody:q,beforeLabel:q,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return K(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:q,afterBody:q,beforeFooter:q,footer:q,afterFooter:q};function is(e,t,n,r){let i=e[t].call(n,r);return void 0===i?io[t].call(n,r):i}class ia extends rt{static positioners=r8;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new na(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){var e;return this.$context||(this.$context=(e=this.chart.getContext(),tC(e,{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(e,t){let{callbacks:n}=t,r=is(n,"beforeTitle",this,e),i=is(n,"title",this,e),o=is(n,"afterTitle",this,e),s=[];return s=r6(s,r7(r)),s=r6(s,r7(i)),s=r6(s,r7(o))}getBeforeBody(e,t){return r6([],r7(is(t.callbacks,"beforeBody",this,e)))}getBody(e,t){let{callbacks:n}=t,r=[];return en(e,e=>{let t={before:[],lines:[],after:[]},i=ii(n,e);r6(t.before,r7(is(i,"beforeLabel",this,e))),r6(t.lines,is(i,"label",this,e)),r6(t.after,r7(is(i,"afterLabel",this,e))),r.push(t)}),r}getAfterBody(e,t){return r6([],r7(is(t.callbacks,"afterBody",this,e)))}getFooter(e,t){let{callbacks:n}=t,r=is(n,"beforeFooter",this,e),i=is(n,"footer",this,e),o=is(n,"afterFooter",this,e),s=[];return s=r6(s,r7(r)),s=r6(s,r7(i)),s=r6(s,r7(o))}_createItems(e){let t,n,r=this._active,i=this.chart.data,o=[],s=[],a=[],l=[];for(t=0,n=r.length;t<n;++t)l.push(function(e,t){let{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}(this.chart,r[t]));return e.filter&&(l=l.filter((t,n,r)=>e.filter(t,n,r,i))),e.itemSort&&(l=l.sort((t,n)=>e.itemSort(t,n,i))),en(l,t=>{let n=ii(e.callbacks,t);o.push(is(n,"labelColor",this,t)),s.push(is(n,"labelPointStyle",this,t)),a.push(is(n,"labelTextColor",this,t))}),this.labelColors=o,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){let n,r=this.options.setContext(this.getContext()),i=this._active,o=[];if(i.length){let e=r8[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);let t=this._size=r9(this,r),s=Object.assign({},e,t),a=ie(this.chart,r,s),l=it(r,s,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let r,i,o,s,a,l,{xAlign:u,yAlign:c}=this,{caretSize:d,cornerRadius:h}=n,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=tw(h),{x:v,y:y}=e,{width:b,height:x}=t;return"center"===c?(a=y+x/2,"left"===u?(i=(r=v)-d,s=a+d,l=a-d):(i=(r=v+b)+d,s=a-d,l=a+d),o=r):(i="left"===u?v+Math.max(f,g)+d:"right"===u?v+b-Math.max(p,m)-d:this.caretX,"top"===c?(a=(s=y)-d,r=i-d,o=i+d):(a=(s=y+x)+d,r=i+d,o=i-d),l=s),{x1:r,x2:i,x3:o,y1:s,y2:a,y3:l}}drawTitle(e,t,n){let r,i,o,s=this.title,a=s.length;if(a){let l=t2(n.rtl,this.x,this.width);for(o=0,e.x=ir(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",r=tk(n.titleFont),i=n.titleSpacing,t.fillStyle=n.titleColor,t.font=r.string;o<a;++o)t.fillText(s[o],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+i,o+1===a&&(e.y+=n.titleMarginBottom-i)}}_drawColorBox(e,t,n,r,i){let o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:a,boxWidth:l}=i,u=tk(i.bodyFont),c=ir(this,"left",i),d=r.x(c),h=a<u.lineHeight?(u.lineHeight-a)/2:0,f=t.y+h;if(i.usePointStyle){let t={radius:Math.min(l,a)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,u=f+a/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,ta(e,t,n,u),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,ta(e,t,n,u)}else{e.lineWidth=X(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;let t=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),s=tw(o.borderRadius);Object.values(s).some(e=>0!==e)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,tg(e,{x:t,y:f,w:l,h:a,radius:s}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),tg(e,{x:n,y:f+1,w:l-2,h:a-2,radius:s}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,f,l,a),e.strokeRect(t,f,l,a),e.fillStyle=o.backgroundColor,e.fillRect(n,f+1,l-2,a-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let r,i,o,s,a,l,{body:u}=this,{bodySpacing:c,bodyAlign:d,displayColors:h,boxHeight:f,boxWidth:p,boxPadding:g}=n,m=tk(n.bodyFont),v=m.lineHeight,y=0,b=t2(n.rtl,this.x,this.width),x=function(n){t.fillText(n,b.x(e.x+y),e.y+v/2),e.y+=v+c},w=b.textAlign(d);for(t.textAlign=d,t.textBaseline="middle",t.font=m.string,e.x=ir(this,w,n),t.fillStyle=n.bodyColor,en(this.beforeBody,x),y=h&&"right"!==w?"center"===d?p/2+g:p+2+g:0,o=0,a=u.length;o<a;++o){for(r=u[o],t.fillStyle=this.labelTextColors[o],en(r.before,x),i=r.lines,h&&i.length&&(this._drawColorBox(t,e,o,b,n),v=Math.max(m.lineHeight,f)),s=0,l=i.length;s<l;++s)x(i[s]),v=m.lineHeight;en(r.after,x)}y=0,v=m.lineHeight,en(this.afterBody,x),e.y-=c}drawFooter(e,t,n){let r,i,o=this.footer,s=o.length;if(s){let a=t2(n.rtl,this.x,this.width);for(e.x=ir(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=a.textAlign(n.footerAlign),t.textBaseline="middle",r=tk(n.footerFont),t.fillStyle=n.footerColor,t.font=r.string,i=0;i<s;++i)t.fillText(o[i],a.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:o}=this,{x:s,y:a}=e,{width:l,height:u}=n,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=tw(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(s+c,a),"top"===o&&this.drawCaret(e,t,n,r),t.lineTo(s+l-d,a),t.quadraticCurveTo(s+l,a,s+l,a+d),"center"===o&&"right"===i&&this.drawCaret(e,t,n,r),t.lineTo(s+l,a+u-f),t.quadraticCurveTo(s+l,a+u,s+l-f,a+u),"bottom"===o&&this.drawCaret(e,t,n,r),t.lineTo(s+h,a+u),t.quadraticCurveTo(s,a+u,s,a+u-h),"center"===o&&"left"===i&&this.drawCaret(e,t,n,r),t.lineTo(s,a+c),t.quadraticCurveTo(s,a,s+c,a),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=r8[e.position].call(this,this._active,this._eventPosition);if(!n)return;let o=this._size=r9(this,e),s=Object.assign({},n,this._size),a=ie(t,e,s),l=it(e,s,a,t);(r._to!==l.x||i._to!==l.y)&&(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=.001>Math.abs(n)?0:n;let o=t_(t.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&s&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),t5(e,t.textDirection),i.y+=o.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),t3(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!er(n,r),o=this._positionChanged(r,t);(i||o)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],o=this._getActiveElements(e,i,t,n),s=this._positionChanged(o,e),a=t||!er(o,i)||s;return a&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,n,r){let i=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));let o=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&o.reverse(),o}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,o=r8[i.position].call(this,e,t);return!1!==o&&(n!==o.x||r!==o.y)}}var il={id:"tooltip",_element:ia,positioners:r8,afterInit(e,t,n){n&&(e.tooltip=new ia({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:io},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function iu(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ic extends rl{static id="category";static defaults={ticks:{callback:iu}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){let n,r;if(K(e))return null;let i=this.getLabels();return n=t=isFinite(t)&&i[t]===e?t:function(e,t,n,r){let i=e.indexOf(t);if(-1===i){var o;return o=n,"string"==typeof t?(o=e.push(t)-1,r.unshift({index:o,label:t})):isNaN(t)&&(o=null),o}return i!==e.lastIndexOf(t)?n:i}(i,e,J(t,e),this._addedLabels),r=i.length-1,null===n?null:eN(Math.round(n),0,r)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=0===e&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-!n,1),this._startValue=this.min-.5*!!n;for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return iu.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function id(e,t,{horizontal:n,minRotation:r}){let i=eP(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class ih extends rl{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return K(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,o=e=>r=t?r:e,s=e=>i=n?i:e;if(e){let e=eC(r),t=eC(i);e<0&&t<0?s(0):e>0&&t>0&&o(0)}if(r===i){let t=0===i?1:Math.abs(.05*i);s(i+t),e||o(r-t)}this.min=r,this.max=i}getTickLimit(){let e,{maxTicksLimit:t,stepSize:n}=this.options.ticks;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3):(e=this.computeTickLimit(),t=t||11),t&&(e=Math.min(t,e)),e}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit(),r=function(e,t){var n,r;let i,o,s,a,l,u=[],{bounds:c,step:d,min:h,max:f,precision:p,count:g,maxTicks:m,maxDigits:v,includeBounds:y}=e,b=d||1,x=m-1,{min:w,max:_}=t,k=!K(h),S=!K(f),C=!K(g),O=(_-w)/(v+1),E=eE((_-w)/x/b)*b;if(E<1e-14&&!k&&!S)return[{value:w},{value:_}];(a=Math.ceil(_/E)-Math.floor(w/E))>x&&(E=eE(a*E/x/b)*b),K(p)||(E=Math.ceil(E*(i=Math.pow(10,p)))/i),"ticks"===c?(o=Math.floor(w/E)*E,s=Math.ceil(_/E)*E):(o=w,s=_),k&&S&&d&&(n=(f-h)/d,r=E/1e3,(l=Math.round(n))-r<=n&&l+r>=n)?(a=Math.round(Math.min((f-h)/E,m)),E=(f-h)/a,o=h,s=f):C?(o=k?h:o,E=((s=S?f:s)-o)/(a=g-1)):a=eO(a=(s-o)/E,Math.round(a),E/1e3)?Math.round(a):Math.ceil(a);let M=Math.max(eT(E),eT(o));o=Math.round(o*(i=Math.pow(10,K(p)?M:p)))/i,s=Math.round(s*i)/i;let A=0;for(k&&(y&&o!==h?(u.push({value:h}),o<h&&A++,eO(Math.round((o+A*E)*i)/i,h,id(h,O,e))&&A++):o<h&&A++);A<a;++A){let e=Math.round((o+A*E)*i)/i;if(S&&e>f)break;u.push({value:e})}return S&&y&&s!==f?u.length&&eO(u[u.length-1].value,f,id(f,O,e))?u[u.length-1].value=f:u.push({value:f}):S&&s!==f||u.push({value:s}),u}({maxTicks:n=Math.max(2,n),bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&eA(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return e6(e,this.chart.options.locale,this.options.ticks.format)}}class ip extends ih{static id="linear";static defaults={ticks:{callback:e7.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Y(e)?e:0,this.max=Y(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=eP(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001;return Math.ceil(t/Math.min(40,this._resolveTickFontOptions(0).lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}let ig=e=>Math.floor(eS(e)),im=(e,t)=>Math.pow(10,ig(e)+t);function iv(e){return 1==e/Math.pow(10,ig(e))}function iy(e,t,n){let r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}class ib extends rl{static id="logarithmic";static defaults={ticks:{callback:e7.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=ih.prototype.parse.apply(this,[e,t]);if(0===n){this._zero=!0;return}return Y(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Y(e)?Math.max(0,e):null,this.max=Y(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=e===im(this.min,0)?im(this.min,-1):im(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,o=e=>r=t?r:e;n===r&&(n<=0?(i(1),o(10)):(i(im(n,-1)),o(im(r,1)))),n<=0&&i(im(r,-1)),r<=0&&o(im(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=function(e,{min:t,max:n}){t=Z(e.min,t);let r=[],i=ig(t),o=function(e,t){let n=ig(t-e);for(;iy(e,t,n)>10;)n++;for(;10>iy(e,t,n);)n--;return Math.min(n,ig(e))}(t,n),s=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,u=Math.round((t-l)*s)/s,c=Math.floor((t-l)/a/10)*a*10,d=Math.floor((u-c)/Math.pow(10,o)),h=Z(e.min,Math.round((l+c+d*Math.pow(10,o))*s)/s);for(;h<n;)r.push({value:h,major:iv(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(d=2,s=++o>=0?1:s),h=Math.round((l+c+d*Math.pow(10,o))*s)/s;let f=Z(e.max,h);return r.push({value:f,major:iv(f),significand:d}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&eA(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":e6(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=eS(e),this._valueRange=eS(this.max)-eS(e)}getPixelForValue(e){return((void 0===e||0===e)&&(e=this.min),null===e||isNaN(e))?NaN:this.getPixelForDecimal(e===this.min?0:(eS(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function ix(e){let t=e.ticks;if(t.display&&e.display){let e=t_(t.backdropPadding);return J(t.font&&t.font.size,tr.font.size)+e.height}return 0}function iw(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function i_(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ev);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let o=1;o<r;o++)n=e.getPointPosition(o,t),i.lineTo(n.x,n.y)}}class ik extends ih{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:e7.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=t_(ix(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=Y(e)&&!isNaN(e)?e:0,this.max=Y(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ix(this.options))}generateTickLabels(e){ih.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=et(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?function(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?em/o:0;for(let c=0;c<o;c++){var l,u;let o=s.setContext(e.getPointLabelContext(c));i[c]=o.padding;let d=e.getPointPosition(c,e.drawingArea+i[c],a),h=tk(o.font),f=(l=e.ctx,u=G(u=e._pointLabels[c])?u:[u],{w:function(e,t,n,r){let i,o,s,a,l,u=(r=r||{}).data=r.data||{},c=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(u=r.data={},c=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let d=0,h=n.length;for(i=0;i<h;i++)if(null==(a=n[i])||G(a)){if(G(a))for(o=0,s=a.length;o<s;o++)null==(l=a[o])||G(l)||(d=ti(e,u,c,d,l))}else d=ti(e,u,c,d,a);e.restore();let f=c.length/2;if(f>n.length){for(i=0;i<f;i++)delete u[c[i]];c.splice(0,f)}return d}(l,h.string,u),h:u.length*h.lineHeight});r[c]=f;let p=eL(e.getIndexAngle(c)+a),g=Math.round(180/em*p);!function(e,t,n,r,i){let o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n)),a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}(n,t,p,iw(g,d.x,f.w,0,180),iw(g,d.y,f.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){let r,i=[],o=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:ix(s)/2,additionalAngle:a?em/o:0};for(let s=0;s<o;s++){u.padding=n[s],u.size=t[s];let o=function(e,t,n){var r,i,o,s,a,l,u;let c=e.drawingArea,{extra:d,additionalAngle:h,padding:f,size:p}=n,g=e.getPointPosition(t,c+d+f,h),m=Math.round(180/em*eL(g.angle+ew)),v=(r=g.y,i=p.h,90===(o=m)||270===o?r-=i/2:(o>270||o<90)&&(r-=i),r),y=0===(s=m)||180===s?"center":s<180?"left":"right",b=(a=g.x,l=p.w,"right"===(u=y)?a-=l:"center"===u&&(a-=l/2),a);return{visible:!0,x:g.x,y:v,textAlign:y,left:b,top:v,right:b+p.w,bottom:v+p.h}}(e,s,u);i.push(o),"auto"===l&&(o.visible=function(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:o}=e;return!(tu({x:n,y:r},t)||tu({x:n,y:o},t)||tu({x:i,y:r},t)||tu({x:i,y:o},t))}(o,r),o.visible&&(r=o))}return i}(e,r,i)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){return eL(e*(ev/(this._pointLabels.length||1))+eP(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(K(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(K(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){var n;let r=t[e];return n=this.getContext(),tC(n,{label:r,index:e,type:"pointLabel"})}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-ew+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),i_(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e,t,n,r=this.ctx,i=this.options,{angleLines:o,grid:s,border:a}=i,l=this._pointLabels.length;if(i.pointLabels.display&&function(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let o=r.setContext(e.getPointLabelContext(i));!function(e,t,n){let{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!K(a)){let n=tw(t.borderRadius),l=t_(t.backdropPadding);e.fillStyle=a;let u=r-l.left,c=i-l.top,d=o-r+l.width,h=s-i+l.height;Object.values(n).some(e=>0!==e)?(e.beginPath(),tg(e,{x:u,y:c,w:d,h:h,radius:n}),e.fill()):e.fillRect(u,c,d,h)}}(n,o,t);let s=tk(o.font),{x:a,y:l,textAlign:u}=t;tp(n,e._pointLabels[i],a,l+s.lineHeight/2,s,{color:o.color,textAlign:u,textBaseline:"middle"})}}(this,l),s.display&&this.ticks.forEach((e,n)=>{if(0!==n||0===n&&this.min<0){t=this.getDistanceFromCenterForValue(e.value);let r=this.getContext(n),i=s.setContext(r),o=a.setContext(r);!function(e,t,n,r,i){let o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;(s||r)&&a&&l&&!(n<0)&&(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),i_(e,n,s,r),o.closePath(),o.stroke(),o.restore())}(this,i,t,l,o)}}),o.display){for(r.save(),e=l-1;e>=0;e--){let s=o.setContext(this.getPointLabelContext(e)),{color:a,lineWidth:l}=s;l&&a&&(r.lineWidth=l,r.strokeStyle=a,r.setLineDash(s.borderDash),r.lineDashOffset=s.borderDashOffset,t=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),n=this.getPointPosition(e,t),r.beginPath(),r.moveTo(this.xCenter,this.yCenter),r.lineTo(n.x,n.y),r.stroke())}r.restore()}}drawBorder(){}drawLabels(){let e,t,n=this.ctx,r=this.options,i=r.ticks;if(!i.display)return;let o=this.getIndexAngle(0);n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(o),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((o,s)=>{if(0===s&&this.min>=0&&!r.reverse)return;let a=i.setContext(this.getContext(s)),l=tk(a.font);if(e=this.getDistanceFromCenterForValue(this.ticks[s].value),a.showLabelBackdrop){n.font=l.string,t=n.measureText(o.label).width,n.fillStyle=a.backdropColor;let r=t_(a.backdropPadding);n.fillRect(-t/2-r.left,-e-l.size/2-r.top,t+r.width,l.size+r.height)}tp(n,o.label,0,-e,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),n.restore()}drawTitle(){}}let iS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},iC=Object.keys(iS);function iO(e,t){return e-t}function iE(e,t){if(K(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts,s=t;return("function"==typeof r&&(s=r(s)),Y(s)||(s="string"==typeof r?n.parse(s,r):n.parse(s)),null===s)?null:(i&&(s="week"===i&&(eM(o)||!0===o)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function iM(e,t,n,r){let i=iC.length;for(let o=iC.indexOf(e);o<i-1;++o){let e=iS[iC[o]],i=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return iC[o]}return iC[i-1]}function iA(e,t,n){if(n){if(n.length){let{lo:r,hi:i}=eB(n,t);e[n[r]>=t?n[r]:n[i]]=!0}}else e[t]=!0}function iP(e,t,n){let r,i,o=[],s={},a=t.length;for(r=0;r<a;++r)s[i=t[r]]=r,o.push({value:i,major:!1});return 0!==a&&n?function(e,t,n,r){let i,o,s=e._adapter,a=+s.startOf(t[0].value,r),l=t[t.length-1].value;for(i=a;i<=l;i=+s.add(i,1,r))(o=n[i])>=0&&(t[o].major=!0);return t}(e,o,s,n):o}class iT extends rl{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||(e.time={}),r=this._adapter=new nI(e.adapters.date);r.init(t),el(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:iE(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||"day",{min:r,max:i,minDefined:o,maxDefined:s}=this.getUserBounds();function a(e){o||isNaN(e.min)||(r=Math.min(r,e.min)),s||isNaN(e.max)||(i=Math.max(i,e.max))}o&&s||(a(this._getLabelBounds()),("ticks"!==e.bounds||"labels"!==e.ticks.source)&&a(this.getMinMax(!1))),r=Y(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=Y(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,o=function(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}(r,i,this.max);return this._unit=t.unit||(n.autoSkip?iM(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(e,t,n,r,i){for(let o=iC.length-1;o>=iC.indexOf(n);o--){let n=iC[o];if(iS[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return iC[n?iC.indexOf(n):0]}(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=iC.indexOf(e)+1,n=iC.length;t<n;++t)if(iS[iC[t]].common)return iC[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&o.reverse(),iP(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,n,r=0,i=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),r=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),i=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);let o=e.length<3?.5:.25;r=eN(r,0,o),i=eN(i,0,o),this._offsets={start:r,end:i,factor:1/(r+1+i)}}_generate(){let e,t,n=this._adapter,r=this.min,i=this.max,o=this.options,s=o.time,a=s.unit||iM(s.minUnit,r,i,this._getLabelCapacity(r)),l=J(o.ticks.stepSize,1),u="week"===a&&s.isoWeekday,c=eM(u)||!0===u,d={},h=r;if(c&&(h=+n.startOf(h,"isoWeek",u)),h=+n.startOf(h,c?"day":a),n.diff(i,r,a)>1e5*l)throw Error(r+" and "+i+" are too far apart with stepSize of "+l+" "+a);let f="data"===o.ticks.source&&this.getDataTimestamps();for(e=h,t=0;e<i;e=+n.add(e,l,a),t++)iA(d,e,f);return(e===i||"ticks"===o.bounds||1===t)&&iA(d,e,f),Object.keys(d).sort(iO).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,o=i.ticks.callback;if(o)return et(o,[e,t,n],this);let s=i.time.displayFormats,a=this._unit,l=this._majorUnit,u=a&&s[a],c=l&&s[l],d=n[t],h=l&&c&&d&&d.major;return this._adapter.format(e,r||(h?c:u))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)(r=e[t]).label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=eP(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),o=Math.sin(r),s=this._resolveTickFontOptions(0).size;return{w:n*i+s*o,h:n*o+s*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,iP(this,[e],this._majorUnit),r),o=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){let e,t,n=this._cache.labels||[];if(n.length)return n;let r=this.getLabels();for(e=0,t=r.length;e<t;++e)n.push(iE(this,r[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(e){return eW(e.sort(iO))}}function iR(e,t,n){let r,i,o,s,a=0,l=e.length-1;n?(t>=e[a].pos&&t<=e[l].pos&&({lo:a,hi:l}=ez(e,"pos",t)),{pos:r,time:o}=e[a],{pos:i,time:s}=e[l]):(t>=e[a].time&&t<=e[l].time&&({lo:a,hi:l}=ez(e,"time",t)),{time:r,pos:o}=e[a],{time:i,pos:s}=e[l]);let u=i-r;return u?o+(s-o)*(t-r)/u:o}class iI extends iT{static id="timeseries";static defaults=iT.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=iR(t,this.min),this._tableRange=iR(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let t,n,r,{min:i,max:o}=this,s=[],a=[];for(t=0,n=e.length;t<n;++t)(r=e[t])>=i&&r<=o&&s.push(r);if(s.length<2)return[{time:i,pos:0},{time:o,pos:1}];for(t=0,n=s.length;t<n;++t)Math.round((s[t+1]+s[t-1])/2)!==(r=s[t])&&a.push({time:r,pos:t/(n-1)});return a}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e}getDecimalForValue(e){return(iR(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return iR(this._table,n*this._tableRange+this._minPos,!0)}}e.s(["BarController",()=>nS,"BarElement",()=>rY,"BubbleController",()=>nC,"CategoryScale",()=>ic,"Chart",()=>rI,"DoughnutController",()=>nO,"Legend",()=>r5,"LineController",()=>nE,"LinearScale",()=>ip,"PieController",()=>nA,"PolarAreaController",()=>nM,"RadarController",()=>nP,"ScatterController",()=>nT,"TimeSeriesScale",()=>iI,"Title",()=>r4,"Tooltip",()=>il],573478);let iD="label";function iL(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function ij(e,t,n=iD){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}let iN=(0,u.forwardRef)(function(e,t){let{height:n=150,width:i=300,redraw:o=!1,datasetIdKey:s,type:a,data:l,options:c,plugins:d=[],fallbackContent:h,updateMode:f,...p}=e,g=(0,u.useRef)(null),m=(0,u.useRef)(null),v=()=>{g.current&&(m.current=new rI(g.current,{type:a,data:function(e,t=iD){let n={labels:[],datasets:[]};return n.labels=e.labels,ij(n,e.datasets,t),n}(l,s),options:c&&{...c},plugins:d}),iL(t,m.current))},y=()=>{iL(t,null),m.current&&(m.current.destroy(),m.current=null)};return(0,u.useEffect)(()=>{var e;let t;!o&&m.current&&c&&(e=m.current,(t=e.options)&&c&&Object.assign(t,c))},[o,c]),(0,u.useEffect)(()=>{!o&&m.current&&(m.current.config.data.labels=l.labels)},[o,l.labels]),(0,u.useEffect)(()=>{!o&&m.current&&l.datasets&&ij(m.current.config.data,l.datasets,s)},[o,l.datasets]),(0,u.useEffect)(()=>{m.current&&(o?(y(),setTimeout(v)):m.current.update(f))},[o,c,l.labels,l.datasets,f]),(0,u.useEffect)(()=>{m.current&&(y(),setTimeout(v))},[a]),(0,u.useEffect)(()=>(v(),()=>y()),[]),(0,r.jsx)("canvas",{ref:g,role:"img",height:n,width:i,...p,children:h})}),iF=(rI.register(nS),(0,u.forwardRef)((e,t)=>(0,r.jsx)(iN,{...e,ref:t,type:"bar"})));e.s(["Bar",()=>iF,"Chart",()=>iN],520584)},742760,(e,t,n)=>{var r,i="__lodash_hash_undefined__",o="[object Arguments]",s="[object Boolean]",a="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",h="[object Object]",f="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",v="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",k="[object Int8Array]",S="[object Int16Array]",C="[object Int32Array]",O="[object Uint8Array]",E="[object Uint8ClampedArray]",M="[object Uint16Array]",A="[object Uint32Array]",P=/\w*$/,T=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,I={};I[o]=I["[object Array]"]=I[b]=I[x]=I[s]=I[a]=I[w]=I[_]=I[k]=I[S]=I[C]=I[c]=I[d]=I[h]=I[p]=I[g]=I[m]=I[v]=I[O]=I[E]=I[M]=I[A]=!0,I["[object Error]"]=I[l]=I[y]=!1;var D=e.g&&e.g.Object===Object&&e.g,L="object"==typeof self&&self&&self.Object===Object&&self,j=D||L||Function("return this")(),N=n&&!n.nodeType&&n,F=N&&t&&!t.nodeType&&t,B=F&&F.exports===N;function z(e,t){return e.set(t[0],t[1]),e}function V(e,t){return e.add(t),e}function H(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function W(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function U(e,t){return function(n){return e(t(n))}}function q(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Q=Array.prototype,K=Function.prototype,G=Object.prototype,X=j["__core-js_shared__"],Y=(r=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Z=K.toString,J=G.hasOwnProperty,ee=G.toString,et=RegExp("^"+Z.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),en=B?j.Buffer:void 0,er=j.Symbol,ei=j.Uint8Array,eo=U(Object.getPrototypeOf,Object),es=Object.create,ea=G.propertyIsEnumerable,el=Q.splice,eu=Object.getOwnPropertySymbols,ec=en?en.isBuffer:void 0,ed=U(Object.keys,Object),eh=eD(j,"DataView"),ef=eD(j,"Map"),ep=eD(j,"Promise"),eg=eD(j,"Set"),em=eD(j,"WeakMap"),ev=eD(Object,"create"),ey=eF(eh),eb=eF(ef),ex=eF(ep),ew=eF(eg),e_=eF(em),ek=er?er.prototype:void 0,eS=ek?ek.valueOf:void 0;function eC(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function eO(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function eE(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function eM(e){this.__data__=new eO(e)}function eA(e,t,n){var r=e[t];J.call(e,t)&&eB(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function eP(e,t){for(var n=e.length;n--;)if(eB(e[n][0],t))return n;return -1}function eT(e){var t=new e.constructor(e.byteLength);return new ei(t).set(new ei(e)),t}function eR(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],a=r?r(n[s],e[s],s,n,e):void 0;eA(n,s,void 0===a?e[s]:a)}return n}function eI(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function eD(e,t){var n,r=null==e?void 0:e[t];return!(!eW(r)||(n=r,Y&&Y in n))&&(e$(r)||$(r)?et:T).test(eF(r))?r:void 0}eC.prototype.clear=function(){this.__data__=ev?ev(null):{}},eC.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},eC.prototype.get=function(e){var t=this.__data__;if(ev){var n=t[e];return n===i?void 0:n}return J.call(t,e)?t[e]:void 0},eC.prototype.has=function(e){var t=this.__data__;return ev?void 0!==t[e]:J.call(t,e)},eC.prototype.set=function(e,t){return this.__data__[e]=ev&&void 0===t?i:t,this},eO.prototype.clear=function(){this.__data__=[]},eO.prototype.delete=function(e){var t=this.__data__,n=eP(t,e);return!(n<0)&&(n==t.length-1?t.pop():el.call(t,n,1),!0)},eO.prototype.get=function(e){var t=this.__data__,n=eP(t,e);return n<0?void 0:t[n][1]},eO.prototype.has=function(e){return eP(this.__data__,e)>-1},eO.prototype.set=function(e,t){var n=this.__data__,r=eP(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(ef||eO),string:new eC}},eE.prototype.delete=function(e){return eI(this,e).delete(e)},eE.prototype.get=function(e){return eI(this,e).get(e)},eE.prototype.has=function(e){return eI(this,e).has(e)},eE.prototype.set=function(e,t){return eI(this,e).set(e,t),this},eM.prototype.clear=function(){this.__data__=new eO},eM.prototype.delete=function(e){return this.__data__.delete(e)},eM.prototype.get=function(e){return this.__data__.get(e)},eM.prototype.has=function(e){return this.__data__.has(e)},eM.prototype.set=function(e,t){var n=this.__data__;if(n instanceof eO){var r=n.__data__;if(!ef||r.length<199)return r.push([e,t]),this;n=this.__data__=new eE(r)}return n.set(e,t),this};var eL=eu?U(eu,Object):function(){return[]},ej=function(e){return ee.call(e)};function eN(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||G)}function eF(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eB(e,t){return e===t||e!=e&&t!=t}(eh&&ej(new eh(new ArrayBuffer(1)))!=x||ef&&ej(new ef)!=c||ep&&ej(ep.resolve())!=f||eg&&ej(new eg)!=g||em&&ej(new em)!=y)&&(ej=function(e){var t=ee.call(e),n=t==h?e.constructor:void 0,r=n?eF(n):void 0;if(r)switch(r){case ey:return x;case eb:return c;case ex:return f;case ew:return g;case e_:return y}return t});var ez=Array.isArray;function eV(e){var t;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&!e$(e)}var eH=ec||function(){return!1};function e$(e){var t=eW(e)?ee.call(e):"";return t==l||t==u}function eW(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eU(e){return eV(e)?function(e,t){var n,r,i,s,a,l=ez(e)||(i=r=n=e)&&"object"==typeof i&&eV(r)&&J.call(n,"callee")&&(!ea.call(n,"callee")||ee.call(n)==o)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=l.length,c=!!u;for(var d in e){J.call(e,d)&&!(c&&("length"==d||(s=d,(a=null==(a=u)?0x1fffffffffffff:a)&&("number"==typeof s||R.test(s))&&s>-1&&s%1==0&&s<a)))&&l.push(d)}return l}(e):function(e){if(!eN(e))return ed(e);var t=[];for(var n in Object(e))J.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}t.exports=function(e){return function e(t,n,r,i,f,y,T){if(i&&(R=y?i(t,f,y,T):i(t)),void 0!==R)return R;if(!eW(t))return t;var R,D=ez(t);if(D){if(j=(L=t).length,N=L.constructor(j),j&&"string"==typeof L[0]&&J.call(L,"index")&&(N.index=L.index,N.input=L.input),R=N,!n){var L,j,N,F=t,B=R,U=-1,Q=F.length;for(B||(B=Array(Q));++U<Q;)B[U]=F[U];return B}}else{var K,G,X,Y,Z,ee=ej(t),et=ee==l||ee==u;if(eH(t)){var en=t,er=n;if(er)return en.slice();var ei=new en.constructor(en.length);return en.copy(ei),ei}if(ee==h||ee==o||et&&!y){if($(t))return y?t:{};if(R="function"!=typeof(K=et?{}:t).constructor||eN(K)?{}:eW(G=eo(K))?es(G):{},!n){return X=t,Y=(Z=R)&&eR(t,eU(t),Z),eR(X,eL(X),Y)}}else{if(!I[ee])return y?t:{};R=function(e,t,n,r){var i,o,l,u=e.constructor;switch(t){case b:return eT(e);case s:case a:return new u(+e);case x:return i=r?eT(e.buffer):e.buffer,new e.constructor(i,e.byteOffset,e.byteLength);case w:case _:case k:case S:case C:case O:case E:case M:case A:return o=r?eT(e.buffer):e.buffer,new e.constructor(o,e.byteOffset,e.length);case c:return H(r?n(W(e),!0):W(e),z,new e.constructor);case d:case m:return new u(e);case p:return(l=new e.constructor(e.source,P.exec(e))).lastIndex=e.lastIndex,l;case g:return H(r?n(q(e),!0):q(e),V,new e.constructor);case v:return eS?Object(eS.call(e)):{}}}(t,ee,e,n)}}T||(T=new eM);var ea=T.get(t);if(ea)return ea;if(T.set(t,R),!D)var el=r?function(e){var t;return t=eU(e),ez(e)?t:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(t,eL(e))}(t):eU(t);return!function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(el||t,function(o,s){el&&(o=t[s=o]),eA(R,s,e(o,n,r,i,s,t,T))}),R}(e,!0,!0)}},238153,492421,e=>{"use strict";var t;let n={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function r(e){return (t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}let i={date:r({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:r({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:r({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},o={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function s(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):t;r=e.formattingValues[i]||e.formattingValues[t]}else{let t=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}let a={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:s({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:s({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:s({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:s({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:s({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function l(e){return(t,n={})=>{let r,i=n.width,o=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;let a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(l,e=>e.test(a)):function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(a));return r=e.valueCallback?e.valueCallback(u):u,{value:r=n.valueCallback?n.valueCallback(r):r,rest:t.slice(a.length)}}}let u={ordinalNumber:(t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,n={})=>{let r=e.match(t.matchPattern);if(!r)return null;let i=r[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:e.slice(i.length)}}),era:l({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:l({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:l({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:l({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:l({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};e.s(["defaultLocale",0,{code:"en-US",formatDistance:(e,t,r)=>{let i,o=n[e];if(i="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+i;else return i+" ago";return i},formatLong:i,formatRelative:(e,t,n,r)=>o[e],localize:a,match:u,options:{weekStartsOn:0,firstWeekContainsDate:1}}],238153);let c={};function d(){return c}e.s(["getDefaultOptions",()=>d],492421)},487122,511518,e=>{"use strict";let t=Symbol.for("constructDateFrom");function n(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&t in e?e[t](n):e instanceof Date?new e.constructor(n):new Date(n)}e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200],511518),e.s(["constructFrom",()=>n],487122)},632713,516467,539392,e=>{"use strict";var t=e.i(487122);function n(e,n){return(0,t.constructFrom)(n||e,e)}function r(e){let t=n(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function i(e,...n){let r=t.constructFrom.bind(null,e||n.find(e=>"object"==typeof e));return n.map(r)}e.s(["toDate",()=>n],516467),e.s(["getTimezoneOffsetInMilliseconds",()=>r],632713),e.s(["normalizeDates",()=>i],539392)},230902,e=>{"use strict";var t=e.i(238153),n=e.i(492421),r=e.i(632713),i=e.i(539392),o=e.i(511518),s=e.i(516467);function a(e,t){let n=(0,s.toDate)(e,t?.in);return n.setHours(0,0,0,0),n}function l(e,t){let r=(0,n.getDefaultOptions)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=(0,s.toDate)(e,t?.in),a=o.getDay();return o.setDate(o.getDate()-(7*(a<i)+a-i)),o.setHours(0,0,0,0),o}function u(e,t){return l(e,{...t,weekStartsOn:1})}var c=e.i(487122);function d(e,t){let n=(0,s.toDate)(e,t?.in),r=n.getFullYear(),i=(0,c.constructFrom)(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let o=u(i),a=(0,c.constructFrom)(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);let l=u(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function h(e,t){let r=(0,s.toDate)(e,t?.in),i=r.getFullYear(),o=(0,n.getDefaultOptions)(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,u=(0,c.constructFrom)(t?.in||e,0);u.setFullYear(i+1,0,a),u.setHours(0,0,0,0);let d=l(u,t),h=(0,c.constructFrom)(t?.in||e,0);h.setFullYear(i,0,a),h.setHours(0,0,0,0);let f=l(h,t);return+r>=+d?i+1:+r>=+f?i:i-1}function f(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+n}let p={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return f("yy"===t?r%100:r,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):f(n+1,2)},d:(e,t)=>f(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>f(e.getHours()%12||12,t.length),H:(e,t)=>f(e.getHours(),t.length),m:(e,t)=>f(e.getMinutes(),t.length),s:(e,t)=>f(e.getSeconds(),t.length),S(e,t){let n=t.length;return f(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},g={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return p.y(e,t)},Y:function(e,t,n,r){let i=h(e,r),o=i>0?i:1-i;return"YY"===t?f(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):f(o,t.length)},R:function(e,t){return f(d(e),t.length)},u:function(e,t){return f(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return f(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return f(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){let r=e.getMonth();switch(t){case"M":case"MM":return p.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return f(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){let a,u,d,p,g,m=Math.round((l(a=(0,s.toDate)(e,i?.in),i)-(u=(0,n.getDefaultOptions)(),d=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,p=h(a,i),(g=(0,c.constructFrom)(i?.in||a,0)).setFullYear(p,0,d),g.setHours(0,0,0,0),l(g,i)))/o.millisecondsInWeek)+1;return"wo"===t?r.ordinalNumber(m,{unit:"week"}):f(m,t.length)},I:function(e,t,n){let r,i,a,l=Math.round((u(r=(0,s.toDate)(e,void 0))-(i=d(r,void 0),(a=(0,c.constructFrom)(r,0)).setFullYear(i,0,4),a.setHours(0,0,0,0),u(a)))/o.millisecondsInWeek)+1;return"Io"===t?n.ordinalNumber(l,{unit:"week"}):f(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):p.d(e,t)},D:function(e,t,n){let l,u,c=function(e,t,n){let[s,l]=(0,i.normalizeDates)(void 0,e,t),u=a(s),c=a(l);return Math.round((u-(0,r.getTimezoneOffsetInMilliseconds)(u)-(c-(0,r.getTimezoneOffsetInMilliseconds)(c)))/o.millisecondsInDay)}(l=(0,s.toDate)(e,void 0),((u=(0,s.toDate)(l,void 0)).setFullYear(u.getFullYear(),0,1),u.setHours(0,0,0,0),u))+1;return"Do"===t?n.ordinalNumber(c,{unit:"dayOfYear"}):f(c,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return f(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return f(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){let r=e.getDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return f(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){let r,i=e.getHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){let r,i=e.getHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return p.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):p.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},k:function(e,t,n){let r=e.getHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):p.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):p.s(e,t)},S:function(e,t){return p.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return v(r);case"XXXX":case"XX":return y(r);default:return y(r,":")}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"x":return v(r);case"xxxx":case"xx":return y(r);default:return y(r,":")}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+m(r,":");default:return"GMT"+y(r,":")}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+m(r,":");default:return"GMT"+y(r,":")}},t:function(e,t,n){return f(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return f(+e,t.length)}};function m(e,t=""){let n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+f(o,2)}function v(e,t){return e%60==0?(e>0?"-":"+")+f(Math.abs(e)/60,2):y(e,t)}function y(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+f(Math.trunc(n/60),2)+t+f(n%60,2)}let b=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},x=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},w={p:x,P:(e,t)=>{let n,r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return b(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",b(i,t)).replace("{{time}}",x(o,t))}},_=/^D+$/,k=/^Y+$/,S=["D","DD","YY","YYYY"],C=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,O=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E=/^'([^]*?)'?$/,M=/''/g,A=/[a-zA-Z]/;function P(e,r,i){let o=(0,n.getDefaultOptions)(),a=i?.locale??o.locale??t.defaultLocale,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,c=(0,s.toDate)(e,i?.in);if(!(c instanceof Date||"object"==typeof c&&"[object Date]"===Object.prototype.toString.call(c))&&"number"!=typeof c||isNaN(+(0,s.toDate)(c)))throw RangeError("Invalid time value");let d=r.match(O).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,w[t])(e,a.formatLong):e}).join("").match(C).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(E))?t[1].replace(M,"'"):n}}if(g[t])return{isToken:!0,value:e};if(t.match(A))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(d=a.localize.preprocessor(c,d));let h={firstWeekContainsDate:l,weekStartsOn:u,locale:a};return d.map(t=>{if(!t.isToken)return t.value;let n=t.value;return(!i?.useAdditionalWeekYearTokens&&k.test(n)||!i?.useAdditionalDayOfYearTokens&&_.test(n))&&function(e,t,n){var r,i,o;let s,a=(r=e,i=t,o=n,s="Y"===r[0]?"years":"days of the month",`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${i}\`) for formatting ${s} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(a),S.includes(e))throw RangeError(a)}(n,r,String(e)),(0,g[n[0]])(c,n,a.localize,h)}).join("")}e.s(["format",()=>P],230902)},353406,122429,665521,660844,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(187725),i=e.i(862754),o=e.i(573478),s=e.i(520584);function a(e,t="en-US",n){return"number"!=typeof e?e:new Intl.NumberFormat(t,n).format(e)}function l(e){let t=(t=e)=>a(t,"en-US",{style:"percent",minimumFractionDigits:1});if(e>0&&e<=.001){let e=t(.001);return`<${e}`}if(e<1&&e>=.999){let e=t(.999);return`>${e}`}return t()}function u(e){if("number"!=typeof e)return e;{let t=Math.abs(e),n=t>=.01,r=t>=1e6,i=t>=1e9,o=t>=1e15;if(o||t>=1e12)return new Intl.NumberFormat("en-US",{style:"unit",unit:"liter",unitDisplay:"narrow",maximumFractionDigits:2*!o}).format(e/1e12).replace("L","T");if(i||r||t>=1e3){let t={base:i?1e9:r?1e6:1e3,unit:i?"B":r?"M":"K"};return new Intl.NumberFormat("en-US",{style:"unit",unit:"liter",unitDisplay:"narrow",maximumFractionDigits:1}).format(e/t.base).replace("L",t.unit)}if(t>=1)return new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e);else return new Intl.NumberFormat("en-US",{maximumFractionDigits:n?3:2,notation:n||0===t?"standard":"scientific"}).format(e)}}e.i(742760),e.i(230902),e.s(["formatAsAbbreviatedNumber",()=>u,"formatIntervalMinMax",()=>l,"formatNumber",()=>a],122429);let c="#63B3ED",d="#F6AD55",h=`${c}A5`,f=`${d}A5`;function p({color:e}){return(0,t.jsx)(n.default,{sx:{display:"inline-block",width:"10px",height:"10px",bgcolor:e,mr:1,borderRadius:"4px"}})}function g({data:e,hideAxis:n=!1,animation:r=!1}){o.Chart.register(o.BarElement,o.TimeSeriesScale,o.LinearScale,o.CategoryScale,o.Title,o.Legend,o.Tooltip);let i=function(e,t=!1,{...n}={}){let{title:r,datasets:i,type:o,samples:s=0,binEdges:a}=e,[c,d]=i,h="datetime"===o;return{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{reverse:!0},title:{display:!0,text:r,font:{size:20}},tooltip:{mode:"index",intersect:!1,callbacks:{title([{dataIndex:e,datasetIndex:t}]){let n=v(a,e);return`${h?"Date Range":"string"===o?"Text Length":"Value Range"}
2
+ ${n}`},label({datasetIndex:e,dataIndex:t,dataset:{label:n}}){let r=0===e?d.counts:c.counts,i=l(r[t]/s),o=r[t];return`${n}: ${o} (${i})`}}}},scales:function({datasets:e,min:t=0,max:n=0,type:r,binEdges:i},o=!1){let[s,a]=e,l=Math.max(...a.counts,...s.counts),c=i.map((e,t)=>v(i,t)).slice(0,-1);return{x:"datetime"===r?{display:!o,type:"timeseries",min:t,max:n,adapters:{date:{}},time:{minUnit:"day"},grid:{display:!1},ticks:{minRotation:30,maxRotation:30,maxTicksLimit:8}}:{display:!o,type:"category",grid:{display:!1},ticks:{callback:(e,t)=>c[t]},stacked:!0},y:{display:!o,type:"linear",max:l,border:{dash:[2,2]},grid:{color:"lightgray"},ticks:{maxTicksLimit:8,callback:function(e){return u(e)}},beginAtZero:!0}}}(e,t),...n}}(e,n,{animation:r}),a=function(e){let{datasets:t,type:n,binEdges:r}=e,[i,o]=t,s=m(n,r,"Current",h,o),a=m(n,r,"Base",f,i);return{labels:r.map((e,t)=>v(r,t)).slice(0,-1),datasets:[s,a]}}(e);return(0,t.jsx)(s.Chart,{type:"bar",options:i,data:a,plugins:[]})}function m(e,t,n,r,i){let{counts:o=[]}=i;return{label:n,data:"datetime"===e?o.map((e,n)=>[t[n],e]):o,backgroundColor:r,borderColor:r,hoverBackgroundColor:r,borderWidth:0,categoryPercentage:1,barPercentage:1,xAxisID:"x"}}function v(e,t){let n=e[t],r=e[t+1],i=u(n),o=u(r);return`${i} - ${o}`}e.s(["BASE_BAR_COLOR",0,d,"BASE_BAR_COLOR_WITH_ALPHA",0,f,"CURRENT_BAR_COLOR",0,c,"CURRENT_BAR_COLOR_WITH_ALPHA",0,h,"SquareIcon",()=>p],665521);let y=(0,r.forwardRef)(({backgroundColor:e="white",blockSize:r,children:i,...o},s)=>(0,t.jsx)(n.default,{ref:s,...o,sx:{overflowY:"auto",overflowX:"hidden",...o.sx},children:(0,t.jsx)(n.default,{sx:{backgroundColor:e,height:"100%",blockSize:r},children:i})}));e.s(["ScreenshotBox",0,y],660844);let b=(0,r.forwardRef)(function({run:e},r){if(!(0,i.isHistogramDiffRun)(e))throw Error("Run type must be histogram_diff");let o=e.params,s=e.result?.base,a=e.result?.current,l=e.result?.min,u=e.result?.max,c=e.result?.bin_edges??[];return s&&a?(0,t.jsx)(n.default,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:(0,t.jsx)(y,{ref:r,height:"100%",children:(0,t.jsxs)(n.default,{sx:{display:"flex",flexDirection:"row"},children:[(0,t.jsx)(n.default,{sx:{flex:1}}),(0,t.jsx)(n.default,{sx:{width:"80%",height:"35vh",m:4},children:(0,t.jsx)(g,{data:{title:`Model ${o.model}.${o.column_name}`,type:e.params?.column_type??"",datasets:[s,a],min:l,max:u,samples:s.total,binEdges:c}})}),(0,t.jsx)(n.default,{sx:{flex:1}})]})})}):(0,t.jsx)("div",{children:"Loading..."})});e.s(["HistogramDiffResultView",0,b],353406)},623786,e=>{"use strict";e.i(316575);var t=e.i(187725);e.s(["default",0,function(e){let{controlled:n,default:r,name:i,state:o="value"}=e,{current:s}=t.useRef(void 0!==n),[a,l]=t.useState(r),u=t.useCallback(e=>{s||l(e)},[]);return[s?n:a,u]}],623786)},700425,e=>{"use strict";var t=e.i(435983),n=e.i(446519);function r(e){return(0,n.default)("PrivateSwitchBase",e)}(0,t.default)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]),e.s(["getSwitchBaseUtilityClass",()=>r])},605679,e=>{"use strict";var t=e.i(187725),n=e.i(778024),r=e.i(578509),i=e.i(451962),o=e.i(446547),s=e.i(623786),a=e.i(331943),l=e.i(98648),u=e.i(700425),c=e.i(577950),d=e.i(19483);let h=(0,o.styled)(l.default,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),f=(0,o.styled)("input",{name:"MuiSwitchBase",shouldForwardProp:i.default})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),p=t.forwardRef(function(e,t){let{autoFocus:i,checked:o,checkedIcon:l,defaultChecked:p,disabled:g,disableFocusRipple:m=!1,edge:v=!1,icon:y,id:b,inputProps:x,inputRef:w,name:_,onBlur:k,onChange:S,onFocus:C,readOnly:O,required:E=!1,tabIndex:M,type:A,value:P,slots:T={},slotProps:R={},...I}=e,[D,L]=(0,s.default)({controlled:o,default:!!p,name:"SwitchBase",state:"checked"}),j=(0,a.default)(),N=g;j&&void 0===N&&(N=j.disabled);let F="checkbox"===A||"radio"===A,B={...e,checked:D,disabled:N,disableFocusRipple:m,edge:v},z=(e=>{let{classes:t,checked:i,disabled:o,edge:s}=e,a={root:["root",i&&"checked",o&&"disabled",s&&`edge${(0,r.default)(s)}`],input:["input"]};return(0,n.default)(a,u.getSwitchBaseUtilityClass,t)})(B),V={slots:T,slotProps:{input:x,...R}},[H,$]=(0,c.default)("root",{ref:t,elementType:h,className:z.root,shouldForwardComponentProp:!0,externalForwardedProps:{...V,component:"span",...I},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),C&&C(t),j&&j.onFocus&&j.onFocus(t)},onBlur:t=>{e.onBlur?.(t),k&&k(t),j&&j.onBlur&&j.onBlur(t)}}),ownerState:B,additionalProps:{centerRipple:!0,focusRipple:!m,disabled:N,role:void 0,tabIndex:null}}),[W,U]=(0,c.default)("input",{ref:w,elementType:f,className:z.input,externalForwardedProps:V,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked;L(t),S&&S(e,t)})(t)}}),ownerState:B,additionalProps:{autoFocus:i,checked:o,defaultChecked:p,disabled:N,id:F?b:void 0,name:_,readOnly:O,required:E,tabIndex:M,type:A,..."checkbox"===A&&void 0===P?{}:{value:P}}});return(0,d.jsxs)(H,{...$,children:[(0,d.jsx)(W,{...U}),D?l:y]})});e.s(["default",0,p])},562903,233799,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(605679),o=e.i(36297),s=e.i(19483);let a=(0,o.default)((0,s.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),l=(0,o.default)((0,s.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),u=(0,o.default)((0,s.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var c=e.i(578509),d=e.i(451962),h=e.i(435983),f=e.i(446519);function p(e){return(0,f.default)("MuiCheckbox",e)}let g=(0,h.default)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var m=e.i(446547),v=e.i(73205),y=e.i(860223),b=e.i(519273),x=e.i(937253),w=e.i(577950);let _=(0,m.styled)(i.default,{shouldForwardProp:e=>(0,d.default)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,c.default)(n.size)}`],"default"!==n.color&&t[`color${(0,c.default)(n.color)}`]]}})((0,v.default)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,y.default)()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter((0,y.default)()).map(([t])=>({props:{color:t},style:{[`&.${g.checked}, &.${g.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${g.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),k=(0,s.jsx)(l,{}),S=(0,s.jsx)(a,{}),C=(0,s.jsx)(u,{}),O=t.forwardRef(function(e,i){let o=(0,b.useDefaultProps)({props:e,name:"MuiCheckbox"}),{checkedIcon:a=k,color:l="primary",icon:u=S,indeterminate:d=!1,indeterminateIcon:h=C,inputProps:f,size:g="medium",disableRipple:m=!1,className:v,slots:y={},slotProps:O={},...E}=o,M=d?h:u,A=d?h:a,P={...o,disableRipple:m,color:l,indeterminate:d,size:g},T=(e=>{let{classes:t,indeterminate:n,color:i,size:o}=e,s={root:["root",n&&"indeterminate",`color${(0,c.default)(i)}`,`size${(0,c.default)(o)}`]},a=(0,r.default)(s,p,t);return{...t,...a}})(P),R=O.input??f,[I,D]=(0,w.default)("root",{ref:i,elementType:_,className:(0,n.default)(T.root,v),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:O,...E},ownerState:P,additionalProps:{type:"checkbox",icon:t.cloneElement(M,{fontSize:M.props.fontSize??g}),checkedIcon:t.cloneElement(A,{fontSize:A.props.fontSize??g}),disableRipple:m,slots:y,slotProps:{input:(0,x.mergeSlotProps)("function"==typeof R?R(P):R,{"data-indeterminate":d})}}});return(0,s.jsx)(I,{...D,classes:T})});e.s(["default",0,O],562903);var E=e.i(331943),E=E,M=e.i(427938);function A(e){return(0,f.default)("MuiFormControlLabel",e)}let P=(0,h.default)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);var T=e.i(854816);let R=(0,m.styled)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${P.label}`]:t.label},t.root,t[`labelPlacement${(0,c.default)(n.labelPlacement)}`]]}})((0,v.default)(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${P.disabled}`]:{cursor:"default"},[`& .${P.label}`]:{[`&.${P.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),I=(0,m.styled)("span",{name:"MuiFormControlLabel",slot:"Asterisk"})((0,v.default)(({theme:e})=>({[`&.${P.error}`]:{color:(e.vars||e).palette.error.main}}))),D=t.forwardRef(function(e,i){let o=(0,b.useDefaultProps)({props:e,name:"MuiFormControlLabel"}),{checked:a,className:l,componentsProps:u={},control:d,disabled:h,disableTypography:f,inputRef:p,label:g,labelPlacement:m="end",name:v,onChange:y,required:x,slots:_={},slotProps:k={},value:S,...C}=o,O=(0,E.default)(),P=h??d.props.disabled??O?.disabled,D=x??d.props.required,L={disabled:P,required:D};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===d.props[e]&&void 0!==o[e]&&(L[e]=o[e])});let j=(0,T.default)({props:o,muiFormControl:O,states:["error"]}),N={...o,disabled:P,labelPlacement:m,required:D,error:j.error},F=(e=>{let{classes:t,disabled:n,labelPlacement:i,error:o,required:s}=e,a={root:["root",n&&"disabled",`labelPlacement${(0,c.default)(i)}`,o&&"error",s&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return(0,r.default)(a,A,t)})(N),B={slots:_,slotProps:{...u,...k}},[z,V]=(0,w.default)("typography",{elementType:M.default,externalForwardedProps:B,ownerState:N}),H=g;return null==H||H.type===M.default||f||(H=(0,s.jsx)(z,{component:"span",...V,className:(0,n.default)(F.label,V?.className),children:H})),(0,s.jsxs)(R,{className:(0,n.default)(F.root,l),ownerState:N,ref:i,...C,children:[t.cloneElement(d,L),D?(0,s.jsxs)("div",{children:[H,(0,s.jsxs)(I,{ownerState:N,"aria-hidden":!0,className:F.asterisk,children:[" ","*"]})]}):H]})});e.s(["default",0,D],233799)},889857,335706,e=>{"use strict";e.i(316575);var t,n=e.i(187725),r=e.i(456132),i=e.i(778024),o=e.i(278903),s=e.i(451962),a=e.i(446547),l=e.i(73205),u=e.i(860223),c=e.i(519273),d=e.i(435983),h=e.i(446519),f=e.i(330978);function p(e){return(0,h.default)("MuiFilledInput",e)}let g={...f.inputBaseClasses,...(0,d.default)("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])};var m=e.i(578509),m=m,v=e.i(19483);let y=(0,a.styled)(o.InputBaseRoot,{shouldForwardProp:e=>(0,s.default)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...(0,o.rootOverridesResolver)(e,t),!n.disableUnderline&&t.underline]}})((0,l.default)(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${g.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${g.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${g.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${g.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${g.disabled}, .${g.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${g.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter((0,u.default)()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&"small"===e.size,style:{paddingTop:8,paddingBottom:9}}]}})),b=(0,a.styled)(o.InputBaseInput,{name:"MuiFilledInput",slot:"Input",overridesResolver:o.inputOverridesResolver})((0,l.default)(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&"small"===e.size,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),x=n.forwardRef(function(e,t){let n=(0,c.useDefaultProps)({props:e,name:"MuiFilledInput"}),{disableUnderline:s=!1,components:a={},componentsProps:l,fullWidth:u=!1,hiddenLabel:d,inputComponent:h="input",multiline:f=!1,slotProps:g,slots:x={},type:w="text",..._}=n,k={...n,disableUnderline:s,fullWidth:u,inputComponent:h,multiline:f,type:w},S=(e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:s,hiddenLabel:a,multiline:l}=e,u={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd","small"===s&&`size${(0,m.default)(s)}`,a&&"hiddenLabel",l&&"multiline"],input:["input"]},c=(0,i.default)(u,p,t);return{...t,...c}})(n),C={root:{ownerState:k},input:{ownerState:k}},O=g??l?(0,r.default)(C,g??l):C,E=x.root??a.Root??y,M=x.input??a.Input??b;return(0,v.jsx)(o.default,{slots:{root:E,input:M},slotProps:O,fullWidth:u,inputComponent:h,multiline:f,ref:t,type:w,..._,classes:S})});x.muiName="Input",e.s(["default",0,x],889857);let w=(0,a.styled)("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:s.default})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),_=(0,a.styled)("legend",{name:"MuiNotchedOutlined",shouldForwardProp:s.default})((0,l.default)(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));var k=e.i(331943),S=e.i(854816);function C(e){return(0,h.default)("MuiOutlinedInput",e)}let O={...f.inputBaseClasses,...(0,d.default)("MuiOutlinedInput",["root","notchedOutline","input"])};var E=e.i(577950);let M=(0,a.styled)(o.InputBaseRoot,{shouldForwardProp:e=>(0,s.default)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:o.rootOverridesResolver})((0,l.default)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${O.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${O.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${O.focused} .${O.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter((0,u.default)()).map(([t])=>({props:{color:t},style:{[`&.${O.focused} .${O.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${O.error} .${O.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${O.disabled} .${O.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{padding:"8.5px 14px"}}]}})),A=(0,a.styled)(function(e){let{children:n,classes:r,className:i,label:o,notched:s,...a}=e,l=null!=o&&""!==o,u={...e,notched:s,withLabel:l};return(0,v.jsx)(w,{"aria-hidden":!0,className:i,ownerState:u,...a,children:(0,v.jsx)(_,{ownerState:u,children:l?(0,v.jsx)("span",{children:o}):t||(t=(0,v.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})},{name:"MuiOutlinedInput",slot:"NotchedOutline"})((0,l.default)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),P=(0,a.styled)(o.InputBaseInput,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:o.inputOverridesResolver})((0,l.default)(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),T=n.forwardRef(function(e,t){let r=(0,c.useDefaultProps)({props:e,name:"MuiOutlinedInput"}),{components:s={},fullWidth:a=!1,inputComponent:l="input",label:u,multiline:d=!1,notched:h,slots:f={},slotProps:p={},type:g="text",...m}=r,y=(e=>{let{classes:t}=e,n=(0,i.default)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},C,t);return{...t,...n}})(r),b=(0,k.default)(),x=(0,S.default)({props:r,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),w={...r,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:b,fullWidth:a,hiddenLabel:x.hiddenLabel,multiline:d,size:x.size,type:g},_=f.root??s.Root??M,O=f.input??s.Input??P,[T,R]=(0,E.default)("notchedOutline",{elementType:A,className:y.notchedOutline,shouldForwardComponentProp:!0,ownerState:w,externalForwardedProps:{slots:f,slotProps:p},additionalProps:{label:null!=u&&""!==u&&x.required?(0,v.jsxs)(n.Fragment,{children:[u," ","*"]}):u}});return(0,v.jsx)(o.default,{slots:{root:_,input:O},slotProps:p,renderSuffix:e=>(0,v.jsx)(T,{...R,notched:void 0!==h?h:!!(e.startAdornment||e.filled||e.focused)}),fullWidth:a,inputComponent:l,multiline:d,ref:t,type:g,...m,classes:{...y,notchedOutline:null}})});T.muiName="Input",e.s(["default",0,T],335706)},417636,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(778024),r=e.i(7284),i=e.i(854816),o=e.i(331943),s=e.i(384339),a=e.i(883124),a=a,l=e.i(578509),u=e.i(451962),c=e.i(446547),d=e.i(73205),h=e.i(519273),f=e.i(435983),p=e.i(446519);function g(e){return(0,p.default)("MuiInputLabel",e)}(0,f.default)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var m=e.i(19483);let v=(0,c.styled)(s.default,{shouldForwardProp:e=>(0,u.default)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${a.default.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})((0,d.default)(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:t})=>"filled"===e&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:t,size:n})=>"filled"===e&&t.shrink&&"small"===n,style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:t})=>"outlined"===e&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),y=t.forwardRef(function(e,t){let s=(0,h.useDefaultProps)({name:"MuiInputLabel",props:e}),{disableAnimation:a=!1,margin:u,shrink:c,variant:d,className:f,...p}=s,y=(0,o.default)(),b=c;void 0===b&&y&&(b=y.filled||y.focused||y.adornedStart);let x=(0,i.default)({props:s,muiFormControl:y,states:["size","variant","required","focused"]}),w={...s,disableAnimation:a,formControl:y,shrink:b,size:x.size,variant:x.variant,required:x.required,focused:x.focused},_=(e=>{let{classes:t,formControl:r,size:i,shrink:o,disableAnimation:s,variant:a,required:u}=e,c={root:["root",r&&"formControl",!s&&"animated",o&&"shrink",i&&"medium"!==i&&`size${(0,l.default)(i)}`,a],asterisk:[u&&"asterisk"]},d=(0,n.default)(c,g,t);return{...t,...d}})(w);return(0,m.jsx)(v,{"data-shrink":b,ref:t,className:(0,r.default)(_.root,f),...p,ownerState:w,classes:_})});e.s(["default",0,y],417636)},343020,e=>{"use strict";e.i(316575);var t,n=e.i(187725),r=e.i(7284),i=e.i(778024),o=e.i(854816),s=e.i(331943),a=e.i(446547),l=e.i(73205),u=e.i(519273),c=e.i(578509),d=e.i(435983),h=e.i(446519);function f(e){return(0,h.default)("MuiFormHelperText",e)}let p=(0,d.default)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var g=e.i(19483);let m=(0,a.styled)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${(0,c.default)(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})((0,l.default)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${p.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${p.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),v=n.forwardRef(function(e,n){let a=(0,u.useDefaultProps)({props:e,name:"MuiFormHelperText"}),{children:l,className:d,component:h="p",disabled:p,error:v,filled:y,focused:b,margin:x,required:w,variant:_,...k}=a,S=(0,s.default)(),C=(0,o.default)({props:a,muiFormControl:S,states:["variant","size","disabled","error","filled","focused","required"]}),O={...a,component:h,contained:"filled"===C.variant||"outlined"===C.variant,variant:C.variant,size:C.size,disabled:C.disabled,error:C.error,filled:C.filled,focused:C.focused,required:C.required};delete O.ownerState;let E=(e=>{let{classes:t,contained:n,size:r,disabled:o,error:s,filled:a,focused:l,required:u}=e,d={root:["root",o&&"disabled",s&&"error",r&&`size${(0,c.default)(r)}`,n&&"contained",l&&"focused",a&&"filled",u&&"required"]};return(0,i.default)(d,f,t)})(O);return(0,g.jsx)(m,{as:h,className:(0,r.default)(E.root,d),ref:n,...k,ownerState:O,children:" "===l?t||(t=(0,g.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"})):l})});e.s(["default",0,v],343020)},523086,e=>{"use strict";var t=e.i(995044),n=e.i(345058),r=e.i(749661),i=e.i(752754);e.s(["default",0,function(e){let{elementType:o,externalSlotProps:s,ownerState:a,skipResolvingSlotProps:l=!1,...u}=e,c=l?{}:(0,i.default)(s,a),{props:d,internalRef:h}=(0,r.default)({...u,externalSlotProps:c}),f=(0,t.default)(h,c?.ref,e.additionalProps?.ref);return(0,n.default)(o,{...d,ref:f},a)}])},838443,e=>{"use strict";let t=e.i(187725).createContext({});e.s(["default",0,t])},228628,96336,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(446547),o=e.i(519273),s=e.i(838443),a=e.i(435983),l=e.i(446519);function u(e){return(0,l.default)("MuiList",e)}(0,a.default)("MuiList",["root","padding","dense","subheader"]);var c=e.i(19483);let d=(0,i.styled)("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),h=t.forwardRef(function(e,i){let a=(0,o.useDefaultProps)({props:e,name:"MuiList"}),{children:l,className:h,component:f="ul",dense:p=!1,disablePadding:g=!1,subheader:m,...v}=a,y=t.useMemo(()=>({dense:p}),[p]),b={...a,component:f,dense:p,disablePadding:g},x=(e=>{let{classes:t,disablePadding:n,dense:i,subheader:o}=e;return(0,r.default)({root:["root",!n&&"padding",i&&"dense",o&&"subheader"]},u,t)})(b);return(0,c.jsx)(s.default.Provider,{value:y,children:(0,c.jsxs)(d,{as:f,className:(0,n.default)(x.root,h),ref:i,ownerState:b,...v,children:[m,l]})})});e.s(["default",0,h],228628);let f=e.i(589624).default;e.s(["default",0,f],96336)},392744,889095,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(817360),r=e.i(228628),i=e.i(592468),o=e.i(96336),s=e.i(723938),a=e.i(921301),l=e.i(144758);e.s(["ownerWindow",()=>l.default],889095);var l=l,u=e.i(19483);function c(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function d(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function h(e,t){if(void 0===t)return!0;let n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join("")))}function f(e,t,n,r,i,o){let s=!1,a=i(e,t,!!t&&n);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}let t=!r&&(a.disabled||"true"===a.getAttribute("aria-disabled"));if(a.hasAttribute("tabindex")&&h(a,o)&&!t)return a.focus(),!0;a=i(e,a,n)}return!1}let p=t.forwardRef(function(e,p){let{actions:g,autoFocus:m=!1,autoFocusItem:v=!1,children:y,className:b,disabledItemsFocusable:x=!1,disableListWrap:w=!1,onKeyDown:_,variant:k="selectedMenu",...S}=e,C=t.useRef(null),O=t.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,a.default)(()=>{m&&C.current.focus()},[m]),t.useImperativeHandle(g,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!C.current.style.width;if(e.clientHeight<C.current.clientHeight&&n){let n=`${(0,o.default)((0,l.default)(e))}px`;C.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,C.current.style.width=`calc(100% + ${n})`}return C.current}}),[]);let E=(0,s.default)(C,p),M=-1;t.Children.forEach(y,(e,n)=>{if(!t.isValidElement(e)){M===n&&(M+=1)>=y.length&&(M=-1);return}e.props.disabled||("selectedMenu"===k&&e.props.selected?M=n:-1===M&&(M=n)),M===n&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(M+=1)>=y.length&&(M=-1)});let A=t.Children.map(y,(e,n)=>{if(n===M){let n={};return v&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===k&&(n.tabIndex=0),t.cloneElement(e,n)}return e});return(0,u.jsx)(r.default,{role:"menu",ref:E,className:b,onKeyDown:e=>{let t=C.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey){_&&_(e);return}let o=(0,i.default)((0,n.default)(t));if("ArrowDown"===r)e.preventDefault(),f(t,o,w,x,c);else if("ArrowUp"===r)e.preventDefault(),f(t,o,w,x,d);else if("Home"===r)e.preventDefault(),f(t,null,w,x,c);else if("End"===r)e.preventDefault(),f(t,null,w,x,d);else if(1===r.length){let n=O.current,i=r.toLowerCase(),s=performance.now();n.keys.length>0&&(s-n.lastTime>500?(n.keys=[],n.repeating=!0,n.previousKeyMatched=!0):n.repeating&&i!==n.keys[0]&&(n.repeating=!1)),n.lastTime=s,n.keys.push(i);let a=o&&!n.repeating&&h(o,n);n.previousKeyMatched&&(a||f(t,o,!1,x,c,n))?e.preventDefault():n.previousKeyMatched=!1}_&&_(e)},tabIndex:m?0:-1,...S,children:A})});e.s(["default",0,p],392744)},135301,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(358102),o=e.i(523086),s=e.i(392744),a=e.i(359143),l=e.i(451962),u=e.i(446547),c=e.i(519273),d=e.i(435983),h=e.i(446519);function f(e){return(0,h.default)("MuiMenu",e)}(0,d.default)("MuiMenu",["root","paper","list"]);var p=e.i(577950),g=e.i(19483);let m={vertical:"top",horizontal:"right"},v={vertical:"top",horizontal:"left"},y=(0,u.styled)(a.default,{shouldForwardProp:e=>(0,l.default)(e)||"classes"===e,name:"MuiMenu",slot:"Root"})({}),b=(0,u.styled)(a.PopoverPaper,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),x=(0,u.styled)(s.default,{name:"MuiMenu",slot:"List"})({outline:0}),w=t.forwardRef(function(e,s){let a=(0,c.useDefaultProps)({props:e,name:"MuiMenu"}),{autoFocus:l=!0,children:u,className:d,disableAutoFocusItem:h=!1,MenuListProps:w={},onClose:_,open:k,PaperProps:S={},PopoverClasses:C,transitionDuration:O="auto",TransitionProps:{onEntering:E,...M}={},variant:A="selectedMenu",slots:P={},slotProps:T={},...R}=a,I=(0,i.useRtl)(),D={...a,autoFocus:l,disableAutoFocusItem:h,MenuListProps:w,onEntering:E,PaperProps:S,transitionDuration:O,TransitionProps:M,variant:A},L=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"],paper:["paper"],list:["list"]},f,t)})(D),j=l&&!h&&k,N=t.useRef(null),F=-1;t.Children.map(u,(e,n)=>{t.isValidElement(e)&&(e.props.disabled||("selectedMenu"===A&&e.props.selected?F=n:-1===F&&(F=n)))});let B={slots:P,slotProps:{list:w,transition:M,paper:S,...T}},z=(0,o.default)({elementType:P.root,externalSlotProps:T.root,ownerState:D,className:[L.root,d]}),[V,H]=(0,p.default)("paper",{className:L.paper,elementType:b,externalForwardedProps:B,shouldForwardComponentProp:!0,ownerState:D}),[$,W]=(0,p.default)("list",{className:(0,n.default)(L.list,w.className),elementType:x,shouldForwardComponentProp:!0,externalForwardedProps:B,getSlotProps:e=>({...e,onKeyDown:t=>{"Tab"===t.key&&(t.preventDefault(),_&&_(t,"tabKeyDown")),e.onKeyDown?.(t)}}),ownerState:D}),U="function"==typeof B.slotProps.transition?B.slotProps.transition(D):B.slotProps.transition;return(0,g.jsx)(y,{onClose:_,anchorOrigin:{vertical:"bottom",horizontal:I?"right":"left"},transformOrigin:I?m:v,slots:{root:P.root,paper:V,backdrop:P.backdrop,...P.transition&&{transition:P.transition}},slotProps:{root:z,paper:H,backdrop:"function"==typeof T.backdrop?T.backdrop(D):T.backdrop,transition:{...U,onEntering:(...e)=>{((e,t)=>{N.current&&N.current.adjustStyleForScrollbar(e,{direction:I?"rtl":"ltr"}),E&&E(e,t)})(...e),U?.onEntering?.(...e)}}},open:k,ref:s,transitionDuration:O,ownerState:D,...R,classes:C,children:(0,g.jsx)($,{actions:N,autoFocus:l&&(-1===F||h),autoFocusItem:j,variant:A,...W,children:u})})});e.s(["default",0,w],135301)},908361,383793,e=>{"use strict";e.i(316575);var t,n=e.i(862088),r=e.i(187725),i=e.i(7284),o=e.i(778024),s=e.i(244875),a=e.i(817360),l=e.i(578509),u=e.i(135301),c=e.i(176264),d=e.i(319557),h=e.i(446547),f=e.i(619810),p=e.i(723938),g=e.i(623786),m=e.i(435983),v=e.i(446519);function y(e){return(0,v.default)("MuiSelect",e)}let b=(0,m.default)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);e.s(["default",0,b,"getSelectUtilityClasses",()=>y],383793);var x=e.i(19483);let w=(0,h.styled)(c.StyledSelectSelect,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${b.select}`]:t.select},{[`&.${b.select}`]:t[n.variant]},{[`&.${b.error}`]:t.error},{[`&.${b.multiple}`]:t.multiple}]}})({[`&.${b.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),_=(0,h.styled)(c.StyledSelectIcon,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,l.default)(n.variant)}`],n.open&&t.iconOpen]}})({}),k=(0,h.styled)("input",{shouldForwardProp:e=>(0,f.default)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function S(e,t){return"object"==typeof t&&null!==t?e===t:String(e)===String(t)}let C=r.forwardRef(function(e,c){var h;let f,m,{"aria-describedby":v,"aria-label":b,autoFocus:C,autoWidth:O,children:E,className:M,defaultOpen:A,defaultValue:P,disabled:T,displayEmpty:R,error:I=!1,IconComponent:D,inputRef:L,labelId:j,MenuProps:N={},multiple:F,name:B,onBlur:z,onChange:V,onClose:H,onFocus:$,onKeyDown:W,onMouseDown:U,onOpen:q,open:Q,readOnly:K,renderValue:G,required:X,SelectDisplayProps:Y={},tabIndex:Z,type:J,value:ee,variant:et="standard",...en}=e,[er,ei]=(0,g.default)({controlled:ee,default:P,name:"Select"}),[eo,es]=(0,g.default)({controlled:Q,default:A,name:"Select"}),ea=r.useRef(null),el=r.useRef(null),[eu,ec]=r.useState(null),{current:ed}=r.useRef(null!=Q),[eh,ef]=r.useState(),ep=(0,p.default)(c,L),eg=r.useCallback(e=>{el.current=e,e&&ec(e)},[]),em=eu?.parentNode;r.useImperativeHandle(ep,()=>({focus:()=>{el.current.focus()},node:ea.current,value:er}),[er]),r.useEffect(()=>{A&&eo&&eu&&!ed&&(ef(O?null:em.clientWidth),el.current.focus())},[eu,O]),r.useEffect(()=>{C&&el.current.focus()},[C]),r.useEffect(()=>{if(!j)return;let e=(0,a.default)(el.current).getElementById(j);if(e){let t=()=>{getSelection().isCollapsed&&el.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[j]);let ev=(e,t)=>{e?q&&q(t):H&&H(t),ed||(ef(O?null:em.clientWidth),es(e))},ey=r.Children.toArray(E),eb=null!==eu&&eo;delete en["aria-invalid"];let ex=[],ew=!1;((0,d.isFilled)({value:er})||R)&&(G?f=G(er):ew=!0);let e_=ey.map(e=>{let t;if(!r.isValidElement(e))return null;if(F){if(!Array.isArray(er))throw Error((0,n.default)(2));(t=er.some(t=>S(t,e.props.value)))&&ew&&ex.push(e.props.children)}else(t=S(er,e.props.value))&&ew&&(m=e.props.children);return r.cloneElement(e,{"aria-selected":t?"true":"false",onClick:t=>{let n;if(t.currentTarget.hasAttribute("tabindex")){if(F){n=Array.isArray(er)?er.slice():[];let t=er.indexOf(e.props.value);-1===t?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),er!==n&&(ei(n),V)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:n,name:B}}),V(i,e)}F||ev(!1,t)}},onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})});ew&&(f=F?0===ex.length?null:ex.reduce((e,t,n)=>(e.push(t),n<ex.length-1&&e.push(", "),e),[]):m);let ek=eh;!O&&ed&&eu&&(ek=em.clientWidth);let eS=Y.id||(B?`mui-component-select-${B}`:void 0),eC={...e,variant:et,value:er,open:eb,error:I},eO=(e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:s,error:a}=e,u={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${(0,l.default)(n)}`,s&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return(0,o.default)(u,y,t)})(eC),eE={...N.PaperProps,..."function"==typeof N.slotProps?.paper?N.slotProps.paper(eC):N.slotProps?.paper},eM={...N.MenuListProps,..."function"==typeof N.slotProps?.list?N.slotProps.list(eC):N.slotProps?.list},eA=(0,s.default)();return(0,x.jsxs)(r.Fragment,{children:[(0,x.jsx)(w,{as:"div",ref:eg,tabIndex:void 0!==Z?Z:T?null:0,role:"combobox","aria-controls":eb?eA:void 0,"aria-disabled":T?"true":void 0,"aria-expanded":eb?"true":"false","aria-haspopup":"listbox","aria-label":b,"aria-labelledby":[j,eS].filter(Boolean).join(" ")||void 0,"aria-describedby":v,"aria-required":X?"true":void 0,"aria-invalid":I?"true":void 0,onKeyDown:e=>{K||([" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),ev(!0,e)),W?.(e))},onMouseDown:T||K?null:e=>{U?.(e),0===e.button&&(e.preventDefault(),el.current.focus(),ev(!0,e))},onBlur:e=>{!eb&&z&&(Object.defineProperty(e,"target",{writable:!0,value:{value:er,name:B}}),z(e))},onFocus:$,...Y,ownerState:eC,className:(0,i.default)(Y.className,eO.select,M),id:eS,children:null!=(h=f)&&("string"!=typeof h||h.trim())?f:t||(t=(0,x.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"}))}),(0,x.jsx)(k,{"aria-invalid":I,value:Array.isArray(er)?er.join(","):er,name:B,ref:ea,"aria-hidden":!0,onChange:e=>{let t=ey.find(t=>t.props.value===e.target.value);void 0!==t&&(ei(t.props.value),V&&V(e,t))},tabIndex:-1,disabled:T,className:eO.nativeInput,autoFocus:C,required:X,...en,ownerState:eC}),(0,x.jsx)(_,{as:D,className:eO.icon,ownerState:eC}),(0,x.jsx)(u.default,{id:`menu-${B||""}`,anchorEl:em,open:eb,onClose:e=>{ev(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...N,slotProps:{...N.slotProps,list:{"aria-labelledby":j,role:"listbox","aria-multiselectable":F?"true":void 0,disableListWrap:!0,id:eA,...eM},paper:{...eE,style:{minWidth:ek,...null!=eE?eE.style:null}}},children:e_})]})});e.s(["default",0,C],908361)},664766,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(244875),o=e.i(446547),s=e.i(519273),a=e.i(973250),l=e.i(889857),u=e.i(335706),c=e.i(417636),d=e.i(992089),h=e.i(343020),f=e.i(456132),p=e.i(272866),g=e.i(908361),m=e.i(854816),v=e.i(331943),y=e.i(861207),b=e.i(176264),x=e.i(723938),w=e.i(451962),_=e.i(383793),k=e.i(19483);let S={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>(0,w.default)(e)&&"variant"!==e},C=(0,o.styled)(a.default,S)(""),O=(0,o.styled)(u.default,S)(""),E=(0,o.styled)(l.default,S)(""),M=t.forwardRef(function(e,i){let o=(0,s.useDefaultProps)({name:"MuiSelect",props:e}),{autoWidth:a=!1,children:l,classes:u={},className:c,defaultOpen:d=!1,displayEmpty:h=!1,IconComponent:w=y.default,id:S,input:M,inputProps:A,label:P,labelId:T,MenuProps:R,multiple:I=!1,native:D=!1,onClose:L,onOpen:j,open:N,renderValue:F,SelectDisplayProps:B,variant:z="outlined",...V}=o,H=D?b.default:g.default,$=(0,v.default)(),W=(0,m.default)({props:o,muiFormControl:$,states:["variant","error"]}),U=W.variant||z,q={...o,variant:U,classes:u},Q=(e=>{let{classes:t}=e,n=(0,r.default)({root:["root"]},_.getSelectUtilityClasses,t);return{...t,...n}})(q),{root:K,...G}=Q,X=M||({standard:(0,k.jsx)(C,{ownerState:q}),outlined:(0,k.jsx)(O,{label:P,ownerState:q}),filled:(0,k.jsx)(E,{ownerState:q})})[U],Y=(0,x.default)(i,(0,p.default)(X));return(0,k.jsx)(t.Fragment,{children:t.cloneElement(X,{inputComponent:H,inputProps:{children:l,error:W.error,IconComponent:w,variant:U,type:void 0,multiple:I,...D?{id:S}:{autoWidth:a,defaultOpen:d,displayEmpty:h,labelId:T,MenuProps:R,onClose:L,onOpen:j,open:N,renderValue:F,SelectDisplayProps:{id:S,...B}},...A,classes:A?(0,f.default)(G,A.classes):G,...M?M.props.inputProps:{}},...(I&&D||h)&&"outlined"===U?{notched:!0}:{},ref:Y,className:(0,n.default)(X.props.className,c,Q.root),...!M&&{variant:U},...V})})});M.muiName="Select";var A=e.i(435983),P=e.i(446519);function T(e){return(0,P.default)("MuiTextField",e)}(0,A.default)("MuiTextField",["root"]);var R=e.i(577950);let I={standard:a.default,filled:l.default,outlined:u.default},D=(0,o.styled)(d.default,{name:"MuiTextField",slot:"Root"})({}),L=t.forwardRef(function(e,t){let o=(0,s.useDefaultProps)({props:e,name:"MuiTextField"}),{autoComplete:a,autoFocus:l=!1,children:u,className:d,color:f="primary",defaultValue:p,disabled:g=!1,error:m=!1,FormHelperTextProps:v,fullWidth:y=!1,helperText:b,id:x,InputLabelProps:w,inputProps:_,InputProps:S,inputRef:C,label:O,maxRows:E,minRows:A,multiline:P=!1,name:L,onBlur:j,onChange:N,onFocus:F,placeholder:B,required:z=!1,rows:V,select:H=!1,SelectProps:$,slots:W={},slotProps:U={},type:q,value:Q,variant:K="outlined",...G}=o,X={...o,autoFocus:l,color:f,disabled:g,error:m,fullWidth:y,multiline:P,required:z,select:H,variant:K},Y=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},T,t)})(X),Z=(0,i.default)(x),J=b&&Z?`${Z}-helper-text`:void 0,ee=O&&Z?`${Z}-label`:void 0,et=I[K],en={slots:W,slotProps:{input:S,inputLabel:w,htmlInput:_,formHelperText:v,select:$,...U}},er={},ei=en.slotProps.inputLabel;"outlined"===K&&(ei&&void 0!==ei.shrink&&(er.notched=ei.shrink),er.label=O),H&&($&&$.native||(er.id=void 0),er["aria-describedby"]=void 0);let[eo,es]=(0,R.default)("root",{elementType:D,shouldForwardComponentProp:!0,externalForwardedProps:{...en,...G},ownerState:X,className:(0,n.default)(Y.root,d),ref:t,additionalProps:{disabled:g,error:m,fullWidth:y,required:z,color:f,variant:K}}),[ea,el]=(0,R.default)("input",{elementType:et,externalForwardedProps:en,additionalProps:er,ownerState:X}),[eu,ec]=(0,R.default)("inputLabel",{elementType:c.default,externalForwardedProps:en,ownerState:X}),[ed,eh]=(0,R.default)("htmlInput",{elementType:"input",externalForwardedProps:en,ownerState:X}),[ef,ep]=(0,R.default)("formHelperText",{elementType:h.default,externalForwardedProps:en,ownerState:X}),[eg,em]=(0,R.default)("select",{elementType:M,externalForwardedProps:en,ownerState:X}),ev=(0,k.jsx)(ea,{"aria-describedby":J,autoComplete:a,autoFocus:l,defaultValue:p,fullWidth:y,multiline:P,name:L,rows:V,maxRows:E,minRows:A,type:q,value:Q,id:Z,inputRef:C,onBlur:j,onChange:N,onFocus:F,placeholder:B,inputProps:eh,slots:{input:W.htmlInput?ed:void 0},...el});return(0,k.jsxs)(eo,{...es,children:[null!=O&&""!==O&&(0,k.jsx)(eu,{htmlFor:Z,id:ee,...ec,children:O}),H?(0,k.jsx)(eg,{"aria-describedby":J,id:Z,labelId:ee,value:Q,input:ev,...em,children:u}):ev,b&&(0,k.jsx)(ef,{id:J,...ep,children:b})]})});e.s(["default",0,L],664766)},728697,982732,838481,e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!=t(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.s(["default",()=>t],982732),e.s(["default",()=>n],838481),e.s(["default",()=>r],728697)},486127,690986,87353,e=>{"use strict";var t=e.i(728697);function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){(0,t.default)(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function i(e){if(Array.isArray(e))return e}function o(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}e.s(["default",()=>r],486127),e.s(["default",()=>i],690986),e.s(["default",()=>o],87353)},484519,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}e.s(["default",()=>t])},886401,e=>{"use strict";var t=e.i(484519);function n(e,n){if(e){if("string"==typeof e)return(0,t.default)(e,n);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,t.default)(e,n):void 0}}e.s(["default",()=>n])},984737,e=>{"use strict";var t=e.i(690986),n=e.i(87353),r=e.i(886401);function i(e,i){return(0,t.default)(e)||(0,n.default)(e,i)||(0,r.default)(e,i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.s(["default",()=>i],984737)},740214,e=>{"use strict";var t=e.i(382034);function n(e,n){if(null==e)return{};var r,i,o=(0,t.default)(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===n.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}e.s(["default",()=>n])},221095,590811,555129,105358,35580,e=>{"use strict";var t=e.i(486127),n=e.i(984737),r=e.i(740214),i=e.i(187725),o=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function s(e){var s=e.defaultInputValue,a=e.defaultMenuIsOpen,l=e.defaultValue,u=e.inputValue,c=e.menuIsOpen,d=e.onChange,h=e.onInputChange,f=e.onMenuClose,p=e.onMenuOpen,g=e.value,m=(0,r.default)(e,o),v=(0,i.useState)(void 0!==u?u:void 0===s?"":s),y=(0,n.default)(v,2),b=y[0],x=y[1],w=(0,i.useState)(void 0!==c?c:void 0!==a&&a),_=(0,n.default)(w,2),k=_[0],S=_[1],C=(0,i.useState)(void 0!==g?g:void 0===l?null:l),O=(0,n.default)(C,2),E=O[0],M=O[1],A=(0,i.useCallback)(function(e,t){"function"==typeof d&&d(e,t),M(e)},[d]),P=(0,i.useCallback)(function(e,t){var n;"function"==typeof h&&(n=h(e,t)),x(void 0!==n?n:e)},[h]),T=(0,i.useCallback)(function(){"function"==typeof p&&p(),S(!0)},[p]),R=(0,i.useCallback)(function(){"function"==typeof f&&f(),S(!1)},[f]),I=void 0!==u?u:b,D=void 0!==c?c:k,L=void 0!==g?g:E;return(0,t.default)((0,t.default)({},m),{},{inputValue:I,menuIsOpen:D,onChange:A,onInputChange:P,onMenuClose:R,onMenuOpen:T,value:L})}function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}e.s(["u",()=>s],221095),e.s(["default",()=>a],590811);var l=e.i(838481);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,l.default)(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}e.s(["default",()=>c],555129);var d=e.i(640141);function h(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,d.default)(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}e.s(["default",()=>h],105358);var g=e.i(982732),m=e.i(73980);function v(e){var t=p();return function(){var n,r=f(e);n=t?Reflect.construct(r,arguments,f(this).constructor):r.apply(this,arguments);if(n&&("object"==(0,g.default)(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return(0,m.default)(this)}}e.s(["default",()=>v],35580)},146679,958124,e=>{"use strict";var t=e.i(484519);function n(e){if(Array.isArray(e))return(0,t.default)(e)}function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}e.s(["default",()=>n],146679),e.s(["default",()=>r],958124)},680152,e=>{"use strict";var t=e.i(146679),n=e.i(958124),r=e.i(886401);function i(e){return(0,t.default)(e)||(0,n.default)(e)||(0,r.default)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.s(["default",()=>i],680152)},909411,497647,231076,e=>{"use strict";var t,n,r,i=e.i(19483),o=e.i(324066),s=e.i(562903),a=e.i(233799),l=e.i(336277),u=e.i(664766),c=e.i(427938),d=e.i(187725),h=e.i(221095),f=e.i(230330);e.i(316575);var p=e.i(486127),g=e.i(590811),m=e.i(555129),v=e.i(105358),y=e.i(35580),b=e.i(680152),x=e.i(51071),w=e.i(984737),_=e.i(740214),k=e.i(982732),S=e.i(728697),C=e.i(316245);let O=Math.min,E=Math.max,M=Math.round,A=Math.floor,P=e=>({x:e,y:e});function T(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function R(){return"undefined"!=typeof window}function I(e){return j(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function L(e){var t;return null==(t=(j(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function j(e){return!!R()&&(e instanceof Node||e instanceof D(e).Node)}function N(e){return!!R()&&(e instanceof Element||e instanceof D(e).Element)}function F(e){return!!R()&&(e instanceof HTMLElement||e instanceof D(e).HTMLElement)}function B(e){return!!R()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof D(e).ShadowRoot)}let z=new Set(["inline","contents"]);function V(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!z.has(i)}function H(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let $=new Set(["html","body","#document"]);function W(e){return $.has(I(e))}function U(e){return D(e).getComputedStyle(e)}function q(e){if("html"===I(e))return e;let t=e.assignedSlot||e.parentNode||B(e)&&e.host||L(e);return B(t)?t.host:t}function Q(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=q(t);return W(n)?t.ownerDocument?t.ownerDocument.body:t.body:F(n)&&V(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=D(i);if(o){let e=K(s);return t.concat(s,s.visualViewport||[],V(i)?i:[],e&&n?Q(e):[])}return t.concat(i,Q(i,[],n))}function K(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function G(e){return N(e)?e:e.contextElement}function X(e){var t;let n,r,i,o,s,a,l,u=G(e);if(!F(u))return P(1);let c=u.getBoundingClientRect(),{width:d,height:h,$:f}=(r=parseFloat((n=U(t=u)).width)||0,i=parseFloat(n.height)||0,s=(o=F(t))?t.offsetWidth:r,a=o?t.offsetHeight:i,(l=M(r)!==s||M(i)!==a)&&(r=s,i=a),{width:r,height:i,$:l}),p=(f?M(c.width):c.width)/d,g=(f?M(c.height):c.height)/h;return p&&Number.isFinite(p)||(p=1),g&&Number.isFinite(g)||(g=1),{x:p,y:g}}let Y=P(0);function Z(e){let t=D(e);return H()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Y}function J(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),s=G(e),a=P(1);t&&(r?N(r)&&(a=X(r)):a=X(e));let l=(void 0===(i=n)&&(i=!1),r&&(!i||r===D(s))&&i)?Z(s):P(0),u=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,d=o.width/a.x,h=o.height/a.y;if(s){let e=D(s),t=r&&N(r)?D(r):r,n=e,i=K(n);for(;i&&r&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=U(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,h*=e.y,u+=o,c+=s,i=K(n=D(i))}}return T({width:d,height:h,x:u,y:c})}function ee(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var et=d.useLayoutEffect,en=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],er=function(){};function ei(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&o.push("".concat(s?"-"===s[0]?e+s:e+"__"+s:e));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var eo=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===(0,k.default)(e)&&null!==e?[e]:[]},es=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=(0,_.default)(e,en);return(0,p.default)({},t)},ea=function(e,t,n){var r=e.cx,i=e.getStyles,o=e.getClassNames,s=e.className;return{css:i(t,e),className:r(null!=n?n:{},o(t,e),s)}};function el(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function eu(e){return el(e)?window.pageYOffset:e.scrollTop}function ec(e,t){el(e)?window.scrollTo(0,t):e.scrollTop=t}function ed(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:er,i=eu(e),o=t-i,s=0;!function t(){var a;s+=10,ec(e,o*((a=(a=s)/n-1)*a*a+1)+i),s<n?window.requestAnimationFrame(t):r(e)}()}function eh(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ec(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ec(e,Math.max(t.offsetTop-i,0))}function ef(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var ep=!1,eg="undefined"!=typeof window?window:{};eg.addEventListener&&eg.removeEventListener&&(eg.addEventListener("p",er,{get passive(){return ep=!0}}),eg.removeEventListener("p",er,!1));var em=ep;function ev(e){return null!=e}var ey=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.entries(e).filter(function(e){var t=(0,w.default)(e,1)[0];return!n.includes(t)}).reduce(function(e,t){var n=(0,w.default)(t,2),r=n[0],i=n[1];return e[r]=i,e},{})},eb=["children","innerProps"],ex=["children","innerProps"],ew=function(e){return"auto"===e?"bottom":e},e_=(0,d.createContext)(null),ek=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,i=e.menuPlacement,o=e.menuPosition,s=e.menuShouldScrollIntoView,a=e.theme,l=((0,d.useContext)(e_)||{}).setPortalPlacement,u=(0,d.useRef)(null),c=(0,d.useState)(r),h=(0,w.default)(c,2),f=h[0],g=h[1],m=(0,d.useState)(null),v=(0,w.default)(m,2),y=v[0],b=v[1],x=a.spacing.controlHeight;return et(function(){var e=u.current;if(e){var t="fixed"===o,a=function(e){var t,n=e.maxHeight,r=e.menuEl,i=e.minHeight,o=e.placement,s=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,u=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}(r),c={placement:"bottom",maxHeight:n};if(!r||!r.offsetParent)return c;var d=u.getBoundingClientRect().height,h=r.getBoundingClientRect(),f=h.bottom,p=h.height,g=h.top,m=r.offsetParent.getBoundingClientRect().top,v=a||el(t=u)?window.innerHeight:t.clientHeight,y=eu(u),b=parseInt(getComputedStyle(r).marginBottom,10),x=parseInt(getComputedStyle(r).marginTop,10),w=m-x,_=v-g,k=w+y,S=d-y-g,C=f-v+y+b,O=y+g-x;switch(o){case"auto":case"bottom":if(_>=p)return{placement:"bottom",maxHeight:n};if(S>=p&&!a)return s&&ed(u,C,160),{placement:"bottom",maxHeight:n};if(!a&&S>=i||a&&_>=i)return s&&ed(u,C,160),{placement:"bottom",maxHeight:a?_-b:S-b};if("auto"===o||a){var E=n,M=a?w:k;return M>=i&&(E=Math.min(M-b-l,n)),{placement:"top",maxHeight:E}}if("bottom"===o)return s&&ec(u,C),{placement:"bottom",maxHeight:n};break;case"top":if(w>=p)return{placement:"top",maxHeight:n};if(k>=p&&!a)return s&&ed(u,O,160),{placement:"top",maxHeight:n};if(!a&&k>=i||a&&w>=i){var A=n;return(!a&&k>=i||a&&w>=i)&&(A=a?w-x:k-x),s&&ed(u,O,160),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:n};default:throw Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:r,menuEl:e,minHeight:n,placement:i,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:x});g(a.maxHeight),b(a.placement),null==l||l(a.placement)}},[r,i,o,s,n,l,x]),t({ref:u,placerProps:(0,p.default)((0,p.default)({},e),{},{placement:y||ew(i),maxHeight:f})})},eS=function(e,t){var n=e.theme,r=n.spacing.baseUnit,i=n.colors;return(0,p.default)({textAlign:"center"},t?{}:{color:i.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},eC=["size"],eO=["innerProps","isRtl","size"],eE={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},eM=function(e){var t=e.size,n=(0,_.default)(e,eC);return(0,x.jsx)("svg",(0,f.default)({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:eE},n))},eA=function(e){return(0,x.jsx)(eM,(0,f.default)({size:20},e),(0,x.jsx)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},eP=function(e){return(0,x.jsx)(eM,(0,f.default)({size:20},e),(0,x.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},eT=function(e,t){var n=e.isFocused,r=e.theme,i=r.spacing.baseUnit,o=r.colors;return(0,p.default)({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i,":hover":{color:n?o.neutral80:o.neutral40}})},eR=(0,x.keyframes)(r||(t=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],n||(n=t.slice(0)),r=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})))),eI=function(e){var t=e.delay,n=e.offset;return(0,x.jsx)("span",{css:(0,x.css)({animation:"".concat(eR," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},eD=["data"],eL=["innerRef","isDisabled","isHidden","inputClassName"],ej={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},eN={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":(0,p.default)({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ej)},eF=function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",n,t)},eB={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||(0,x.jsx)(eA,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.innerRef,o=e.innerProps,s=e.menuIsOpen;return(0,x.jsx)("div",(0,f.default)({ref:i},ea(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":s}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||(0,x.jsx)(eP,null))},DownChevron:eP,CrossIcon:eA,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,i=e.getClassNames,o=e.Heading,s=e.headingProps,a=e.innerProps,l=e.label,u=e.theme,c=e.selectProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"group",{group:!0}),a),(0,x.jsx)(o,(0,f.default)({},s,{selectProps:c,theme:u,getStyles:r,getClassNames:i,cx:n}),l),(0,x.jsx)("div",null,t))},GroupHeading:function(e){var t=es(e);t.data;var n=(0,_.default)(t,eD);return(0,x.jsx)("div",(0,f.default)({},ea(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return(0,x.jsx)("span",(0,f.default)({},t,ea(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=es(e),i=r.innerRef,o=r.isDisabled,s=r.isHidden,a=r.inputClassName,l=(0,_.default)(r,eL);return(0,x.jsx)("div",(0,f.default)({},ea(e,"input",{"input-container":!0}),{"data-value":n||""}),(0,x.jsx)("input",(0,f.default)({className:t({input:!0},a),ref:i,style:(0,p.default)({label:"input",color:"inherit",background:0,opacity:+!s,width:"100%"},ej),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,i=(0,_.default)(e,eO);return(0,x.jsx)("div",(0,f.default)({},ea((0,p.default)((0,p.default)({},i),{},{innerProps:t,isRtl:n,size:void 0===r?4:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),(0,x.jsx)(eI,{delay:0,offset:n}),(0,x.jsx)(eI,{delay:160,offset:!0}),(0,x.jsx)(eI,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,i=e.isMulti;return(0,x.jsx)("div",(0,f.default)({},ea(e,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:r},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,r=e.controlElement,i=e.innerProps,o=e.menuPlacement,s=e.menuPosition,a=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useState)(ew(o)),c=(0,w.default)(u,2),h=c[0],g=c[1],m=(0,d.useMemo)(function(){return{setPortalPlacement:g}},[]),v=(0,d.useState)(null),y=(0,w.default)(v,2),b=y[0],_=y[1],k=(0,d.useCallback)(function(){if(r){var e,t={bottom:(e=r.getBoundingClientRect()).bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width},n="fixed"===s?0:window.pageYOffset,i=t[h]+n;(i!==(null==b?void 0:b.offset)||t.left!==(null==b?void 0:b.rect.left)||t.width!==(null==b?void 0:b.rect.width))&&_({offset:i,rect:t})}},[r,s,h,null==b?void 0:b.offset,null==b?void 0:b.rect.left,null==b?void 0:b.rect.width]);et(function(){k()},[k]);var S=(0,d.useCallback)(function(){"function"==typeof l.current&&(l.current(),l.current=null),r&&a.current&&(l.current=function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=G(e),d=o||s?[...c?Q(c):[],...Q(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});let h=c&&l?function(e,t){let n,r=null,i=L(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();let u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(a||t(),!h||!f)return;let p={rootMargin:-A(d)+"px "+-A(i.clientWidth-(c+h))+"px "+-A(i.clientHeight-(d+f))+"px "+-A(c)+"px",threshold:E(0,O(1,l))||1},g=!0;function m(t){let r=t[0].intersectionRatio;if(r!==l){if(!g)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||ee(u,e.getBoundingClientRect())||s(),g=!1}try{r=new IntersectionObserver(m,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(m,p)}r.observe(e)}(!0),o}(c,n):null,f=-1,p=null;a&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let g=u?J(e):null;return u&&function t(){let r=J(e);g&&!ee(g,r)&&n(),g=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,u&&cancelAnimationFrame(i)}}(r,a.current,k,{elementResize:"ResizeObserver"in window}))},[r,k]);et(function(){S()},[S]);var M=(0,d.useCallback)(function(e){a.current=e,S()},[S]);if(!t&&"fixed"!==s||!b)return null;var P=(0,x.jsx)("div",(0,f.default)({ref:M},ea((0,p.default)((0,p.default)({},e),{},{offset:b.offset,position:s,rect:b.rect}),"menuPortal",{"menu-portal":!0}),i),n);return(0,x.jsx)(e_.Provider,{value:m},t?(0,C.createPortal)(P,t):P)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,i=(0,_.default)(e,ex);return(0,x.jsx)("div",(0,f.default)({},ea((0,p.default)((0,p.default)({},i),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,i=(0,_.default)(e,eb);return(0,x.jsx)("div",(0,f.default)({},ea((0,p.default)((0,p.default)({},i),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:function(e){var t=e.children,n=e.components,r=e.data,i=e.innerProps,o=e.isDisabled,s=e.removeProps,a=e.selectProps,l=n.Container,u=n.Label,c=n.Remove;return(0,x.jsx)(l,{data:r,innerProps:(0,p.default)((0,p.default)({},ea(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),i),selectProps:a},(0,x.jsx)(u,{data:r,innerProps:(0,p.default)({},ea(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),(0,x.jsx)(c,{data:r,innerProps:(0,p.default)((0,p.default)({},ea(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:a}))},MultiValueContainer:eF,MultiValueLabel:eF,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",(0,f.default)({role:"button"},n),t||(0,x.jsx)(eA,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.isSelected,o=e.innerRef,s=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":i}),{ref:o,"aria-disabled":n},s),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,i=e.isRtl;return(0,x.jsx)("div",(0,f.default)({},ea(e,"container",{"--is-disabled":r,"--is-rtl":i}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return(0,x.jsx)("div",(0,f.default)({},ea(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,i=e.hasValue;return(0,x.jsx)("div",(0,f.default)({},ea(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":i}),n),t)}},ez=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function eV(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||ez(n)&&ez(r))&&1)return!1;return!0}for(var eH={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},e$=function(e){return(0,x.jsx)("span",(0,f.default)({css:eH},e))},eW={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,i=e.context,o=e.isInitialFocus;switch(i){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,i=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(i.length>1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return o?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,i=e.label,o=void 0===i?"":i,s=e.selectValue,a=e.isDisabled,l=e.isSelected,u=e.isAppleDevice,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&s)return"value ".concat(o," focused, ").concat(c(s,n),".");if("menu"===t&&u){var d="".concat(l?" selected":"").concat(a?" disabled":"");return"".concat(o).concat(d,", ").concat(c(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},eU=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,i=e.focusableOptions,o=e.isFocused,s=e.selectValue,a=e.selectProps,l=e.id,u=e.isAppleDevice,c=a.ariaLiveMessages,h=a.getOptionLabel,f=a.inputValue,g=a.isMulti,m=a.isOptionDisabled,v=a.isSearchable,y=a.menuIsOpen,b=a.options,w=a.screenReaderStatus,_=a.tabSelectsValue,k=a.isLoading,S=a["aria-label"],C=a["aria-live"],O=(0,d.useMemo)(function(){return(0,p.default)((0,p.default)({},eW),c||{})},[c]),E=(0,d.useMemo)(function(){var e="";if(t&&O.onChange){var n=t.option,r=t.options,i=t.removedValue,o=t.removedValues,a=t.value,l=i||n||(Array.isArray(a)?null:a),u=l?h(l):"",c=r||o||void 0,d=c?c.map(h):[],f=(0,p.default)({isDisabled:l&&m(l,s),label:u,labels:d},t);e=O.onChange(f)}return e},[t,O,m,s,h]),M=(0,d.useMemo)(function(){var e="",t=n||r,o=!!(n&&s&&s.includes(n));if(t&&O.onFocus){var a={focused:t,label:h(t),isDisabled:m(t,s),isSelected:o,options:i,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=O.onFocus(a)}return e},[n,r,h,m,O,i,s,u]),A=(0,d.useMemo)(function(){var e="";if(y&&b.length&&!k&&O.onFilter){var t=w({count:i.length});e=O.onFilter({inputValue:f,resultsMessage:t})}return e},[i,f,y,O,b,w,k]),P=(null==t?void 0:t.action)==="initial-input-focus",T=(0,d.useMemo)(function(){var e="";if(O.guidance){var t=r?"value":y?"menu":"input";e=O.guidance({"aria-label":S,context:t,isDisabled:n&&m(n,s),isMulti:g,isSearchable:v,tabSelectsValue:_,isInitialFocus:P})}return e},[S,n,r,g,m,v,y,O,s,_,P]),R=(0,x.jsx)(d.Fragment,null,(0,x.jsx)("span",{id:"aria-selection"},E),(0,x.jsx)("span",{id:"aria-focused"},M),(0,x.jsx)("span",{id:"aria-results"},A),(0,x.jsx)("span",{id:"aria-guidance"},T));return(0,x.jsx)(d.Fragment,null,(0,x.jsx)(e$,{id:l},P&&R),(0,x.jsx)(e$,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!P&&R))},eq=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],eQ=RegExp("["+eq.map(function(e){return e.letters}).join("")+"]","g"),eK={},eG=0;eG<eq.length;eG++)for(var eX=eq[eG],eY=0;eY<eX.letters.length;eY++)eK[eX.letters[eY]]=eX.base;var eZ=function(e){return e.replace(eQ,function(e){return eK[e]})},eJ=function(e,t){void 0===t&&(t=eV);var n=null;function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}(eZ),e0=function(e){return e.replace(/^\s+|\s+$/g,"")},e1=function(e){return"".concat(e.label," ").concat(e.value)},e2=["innerRef"];function e5(e){var t=e.innerRef,n=ey((0,_.default)(e,e2),"onExited","in","enter","exit","appear");return(0,x.jsx)("input",(0,f.default)({ref:t},n,{css:(0,x.css)({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var e3=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},e4=["boxSizing","height","overflow","paddingRight","position"],e8={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function e6(e){e.cancelable&&e.preventDefault()}function e7(e){e.stopPropagation()}function e9(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function te(){return"ontouchstart"in window||navigator.maxTouchPoints}var tt=!!("undefined"!=typeof window&&window.document&&window.document.createElement),tn=0,tr={capture:!1,passive:!1},ti=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},to={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ts(e){var t,n,r,i,o,s,a,l,u,c,h,f,p,g,m,v,y,b,w,_,k,S,C,O,E=e.children,M=e.lockEnabled,A=e.captureEnabled,P=(n=(t={isEnabled:void 0===A||A,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}).isEnabled,r=t.onBottomArrive,i=t.onBottomLeave,o=t.onTopArrive,s=t.onTopLeave,a=(0,d.useRef)(!1),l=(0,d.useRef)(!1),u=(0,d.useRef)(0),c=(0,d.useRef)(null),h=(0,d.useCallback)(function(e,t){if(null!==c.current){var n=c.current,u=n.scrollTop,d=n.scrollHeight,h=n.clientHeight,f=c.current,p=t>0,g=d-h-u,m=!1;g>t&&a.current&&(i&&i(e),a.current=!1),p&&l.current&&(s&&s(e),l.current=!1),p&&t>g?(r&&!a.current&&r(e),f.scrollTop=d,m=!0,a.current=!0):!p&&-t>u&&(o&&!l.current&&o(e),f.scrollTop=0,m=!0,l.current=!0),m&&e3(e)}},[r,i,o,s]),f=(0,d.useCallback)(function(e){h(e,e.deltaY)},[h]),p=(0,d.useCallback)(function(e){u.current=e.changedTouches[0].clientY},[]),g=(0,d.useCallback)(function(e){var t=u.current-e.changedTouches[0].clientY;h(e,t)},[h]),m=(0,d.useCallback)(function(e){if(e){var t=!!em&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",g,t)}},[g,p,f]),v=(0,d.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",g,!1))},[g,p,f]),(0,d.useEffect)(function(){if(n){var e=c.current;return m(e),function(){v(e)}}},[n,m,v]),function(e){c.current=e}),T=(b=(y={isEnabled:M}).isEnabled,_=void 0===(w=y.accountForScrollbars)||w,k=(0,d.useRef)({}),S=(0,d.useRef)(null),C=(0,d.useCallback)(function(e){if(tt){var t=document.body,n=t&&t.style;if(_&&e4.forEach(function(e){var t=n&&n[e];k.current[e]=t}),_&&tn<1){var r=parseInt(k.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,o=window.innerWidth-i+r||0;Object.keys(e8).forEach(function(e){var t=e8[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(o,"px"))}t&&te()&&(t.addEventListener("touchmove",e6,tr),e&&(e.addEventListener("touchstart",e9,tr),e.addEventListener("touchmove",e7,tr))),tn+=1}},[_]),O=(0,d.useCallback)(function(e){if(tt){var t=document.body,n=t&&t.style;tn=Math.max(tn-1,0),_&&tn<1&&e4.forEach(function(e){var t=k.current[e];n&&(n[e]=t)}),t&&te()&&(t.removeEventListener("touchmove",e6,tr),e&&(e.removeEventListener("touchstart",e9,tr),e.removeEventListener("touchmove",e7,tr)))}},[_]),(0,d.useEffect)(function(){if(b){var e=S.current;return C(e),function(){O(e)}}},[b,C,O]),function(e){S.current=e});return(0,x.jsx)(d.Fragment,null,M&&(0,x.jsx)("div",{onClick:ti,css:to}),E(function(e){P(e),T(e)}))}var ta={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tl=function(e){var t=e.name,n=e.onFocus;return(0,x.jsx)("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:ta,value:"",onChange:function(){}})};function tu(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}var tc={clearIndicator:eT,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.theme,o=i.colors,s=i.borderRadius,a=i.spacing;return(0,p.default)({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:r?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},dropdownIndicator:eT,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,i=n.spacing;return(0,p.default)({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*i.baseUnit,paddingRight:3*i.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing.baseUnit,o=r.colors;return(0,p.default)({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*i,marginTop:2*i})},input:function(e,t){var n=e.isDisabled,r=e.value,i=e.theme,o=i.spacing,s=i.colors;return(0,p.default)((0,p.default)({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},eN),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,i=e.theme,o=i.colors,s=i.spacing.baseUnit;return(0,p.default)({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*s})},loadingMessage:eS,menu:function(e,t){var n,r=e.placement,i=e.theme,o=i.borderRadius,s=i.spacing,a=i.colors;return(0,p.default)((n={label:"menu"},(0,S.default)(n,r?({bottom:"top",top:"bottom"})[r]:"bottom","100%"),(0,S.default)(n,"position","absolute"),(0,S.default)(n,"width","100%"),(0,S.default)(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return(0,p.default)({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,o=n.colors;return(0,p.default)({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:i/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,i=n.colors,o=e.cropWithEllipsis;return(0,p.default)({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,o=n.colors,s=e.isFocused;return(0,p.default)({alignItems:"center",display:"flex"},t?{}:{borderRadius:i/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:eS,option:function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.isSelected,o=e.theme,s=o.spacing,a=o.colors;return(0,p.default)({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:i?a.primary:r?a.primary25:"transparent",color:n?a.neutral20:i?a.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:i?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,i=n.colors;return(0,p.default)({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:i.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing,o=r.colors;return(0,p.default)({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,i=e.hasValue,o=e.selectProps.controlShouldRenderValue;return(0,p.default)({alignItems:"center",display:r&&i&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},td={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},th={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ef(),captureMenuScroll:!ef(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=(0,p.default)({ignoreCase:!0,ignoreAccents:!0,stringify:e1,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,i=n.ignoreAccents,o=n.stringify,s=n.trim,a=n.matchFrom,l=s?e0(t):t,u=s?e0(o(e)):o(e);return r&&(l=l.toLowerCase(),u=u.toLowerCase()),i&&(l=eJ(l),u=eZ(u)),"start"===a?u.substr(0,l.length)===l:u.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function tf(e,t,n,r){var i=tw(e,t,n),o=t_(e,t,n),s=tb(e,t),a=tx(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function tp(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(n,r){return tf(e,n,t,r)}).filter(function(t){return tv(e,t)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=tf(e,n,t,r);return tv(e,o)?o:void 0}).filter(ev)}function tg(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,(0,b.default)(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function tm(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,(0,b.default)(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function tv(e,t){var n=e.inputValue,r=t.data,i=t.isSelected,o=t.label,s=t.value;return(!tS(e)||!i)&&tk(e,{label:o,value:s,data:r},void 0===n?"":n)}var ty=function(e,t){var n;return(null==(n=e.find(function(e){return e.data===t}))?void 0:n.id)||null},tb=function(e,t){return e.getOptionLabel(t)},tx=function(e,t){return e.getOptionValue(t)};function tw(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function t_(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=tx(e,t);return n.some(function(t){return tx(e,t)===r})}function tk(e,t,n){return!e.filterOption||e.filterOption(t,n)}var tS=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},tC=1,tO=function(e){(0,v.default)(n,e);var t=(0,y.default)(n);function n(e){var r;if((0,g.default)(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,i=n.onChange;t.name=n.name,r.ariaOnChange(e,t),i(e,t)},r.setValue=function(e,t,n){var i=r.props,o=i.closeMenuOnSelect,s=i.isMulti,a=i.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:a}),o&&(r.setState({inputIsHiddenAfterUpdate:!s}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,i=t.isMulti,o=t.name,s=r.state.selectValue,a=i&&r.isOptionSelected(e,s),l=r.isOptionDisabled(e,s);if(a){var u=r.getOptionValue(e);r.setValue(s.filter(function(e){return r.getOptionValue(e)!==u}),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:o});i?r.setValue([].concat((0,b.default)(s),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t,n=r.props.isMulti,i=r.state.selectValue,o=r.getOptionValue(e),s=i.filter(function(e){return r.getOptionValue(e)!==o}),a=(t=s[0]||null,n?s:t);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e,t,n=r.state.selectValue;r.onChange((e=r.props.isMulti,t=[],e?t:null),{action:"clear",removedValues:n})},r.popValue=function(){var e,t=r.props.isMulti,n=r.state.selectValue,i=n[n.length-1],o=n.slice(0,n.length-1),s=(e=o[0]||null,t?o:e);i&&r.onChange(s,{action:"pop-value",removedValue:i})},r.getFocusedOptionId=function(e){return ty(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return tm(tp(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return ei.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return tb(r.props,e)},r.getOptionValue=function(e){return tx(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,i=tc[e](t,n);i.boxSizing="border-box";var o=r.props.styles[e];return o?o(i,t):i},r.getClassNames=function(e,t){var n,i;return null==(n=(i=r.props.classNames)[e])?void 0:n.call(i,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){var e;return e=r.props,(0,p.default)((0,p.default)({},eB),e.components)},r.buildCategorizedOptions=function(){return tp(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return tg(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:(0,p.default)({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if((!e||"mousedown"!==e.type||0===e.button)&&!r.props.isDisabled){var t=r.props,n=t.isMulti,i=t.menuIsOpen;r.focusInput(),i?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&el(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var i=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=i>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return tS(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,i=t.backspaceRemovesValue,o=t.escapeClearsValue,s=t.inputValue,a=t.isClearable,l=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,d=t.tabSelectsValue,h=t.openMenuOnFocus,f=r.state,p=f.focusedOption,g=f.focusedValue,m=f.selectValue;if(!l){if("function"==typeof c&&(c(e),e.defaultPrevented))return;switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||s)return;r.focusValue("previous");break;case"ArrowRight":if(!n||s)return;r.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(g)r.removeValue(g);else{if(!i)return;n?r.popValue():a&&r.clearValue()}break;case"Tab":if(r.isComposing||e.shiftKey||!u||!d||!p||h&&r.isOptionSelected(p,m))return;r.selectOption(p);break;case"Enter":if(229===e.keyCode)break;if(u){if(!p||r.isComposing)return;r.selectOption(p);break}return;case"Escape":u?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:s}),r.onMenuClose()):a&&o&&r.clearValue();break;case" ":if(s)return;if(!u){r.openMenu("first");break}if(!p)return;r.selectOption(p);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++tC),r.state.selectValue=eo(e.value),e.menuIsOpen&&r.state.selectValue.length){var i=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),s=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=i,r.state.focusedOption=o[s],r.state.focusedOptionId=ty(i,o[s])}return r}return(0,m.default)(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&eh(this.menuListRef,this.focusedOptionRef),(tu(/^Mac/i)||tu(/^iPhone/i)||tu(/^iPad/i)||tu(/^Mac/i)&&navigator.maxTouchPoints>1)&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,i=this.state.isFocused;(i&&!n&&e.isDisabled||i&&r&&!e.menuIsOpen)&&this.focusInput(),i&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):i||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(eh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,i=n.isFocused,o=this.buildFocusableOptions(),s="first"===e?0:o.length-1;if(!this.props.isMulti){var a=o.indexOf(r[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[s],focusedOptionId:this.getFocusedOptionId(o[s])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var i=n.indexOf(r);r||(i=-1);var o=n.length-1,s=-1;if(n.length){switch(e){case"previous":s=0===i?0:-1===i?o:i-1;break;case"next":i>-1&&i<o&&(s=i+1)}this.setState({inputIsHidden:-1!==s,focusedValue:n[s]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var i=0,o=r.indexOf(n);n||(o=-1),"up"===e?i=o>0?o-1:r.length-1:"down"===e?i=(o+1)%r.length:"pageup"===e?(i=o-t)<0&&(i=0):"pagedown"===e?(i=o+t)>r.length-1&&(i=r.length-1):"last"===e&&(i=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[i],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[i])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(td):(0,p.default)((0,p.default)({},td),this.props.theme):td}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,i=this.getValue,o=this.selectOption,s=this.setValue,a=this.props,l=a.isMulti,u=a.isRtl,c=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:i,hasValue:this.hasValue(),isMulti:l,isRtl:u,options:c,selectOption:o,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return tw(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return t_(this.props,e,t)}},{key:"filterOption",value:function(e,t){return tk(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"!=typeof this.props.formatOptionLabel)return this.getOptionLabel(e);var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,o=e.tabIndex,s=e.form,a=e.menuIsOpen,l=e.required,u=this.getComponents().Input,c=this.state,h=c.inputIsHidden,g=c.ariaSelection,m=this.commonProps,v=r||this.getElementId("input"),y=(0,p.default)((0,p.default)((0,p.default)({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":l,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},a&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?(null==g?void 0:g.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?d.createElement(u,(0,f.default)({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:t,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:i},y)):d.createElement(e5,(0,f.default)({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:er,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:s,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,o=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,l=this.commonProps,u=this.props,c=u.controlShouldRenderValue,h=u.isDisabled,p=u.isMulti,g=u.inputValue,m=u.placeholder,v=this.state,y=v.selectValue,b=v.focusedValue,x=v.isFocused;if(!this.hasValue()||!c)return g?null:d.createElement(a,(0,f.default)({},l,{key:"placeholder",isDisabled:h,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),m);if(p)return y.map(function(t,s){var a=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return d.createElement(n,(0,f.default)({},l,{components:{Container:r,Label:i,Remove:o},isFocused:a,isDisabled:h,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(g)return null;var w=y[0];return d.createElement(s,(0,f.default)({},l,{data:w,isDisabled:h}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(e,(0,f.default)({},t,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,o=this.state.isFocused;return e&&i?d.createElement(e,(0,f.default)({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,o=this.state.isFocused;return d.createElement(n,(0,f.default)({},r,{isDisabled:i,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(e,(0,f.default)({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e,t=this,n=this.getComponents(),r=n.Group,i=n.GroupHeading,o=n.Menu,s=n.MenuList,a=n.MenuPortal,l=n.LoadingMessage,u=n.NoOptionsMessage,c=n.Option,h=this.commonProps,p=this.state.focusedOption,g=this.props,m=g.captureMenuScroll,v=g.inputValue,y=g.isLoading,b=g.loadingMessage,x=g.minMenuHeight,w=g.maxMenuHeight,_=g.menuIsOpen,k=g.menuPlacement,S=g.menuPosition,C=g.menuPortalTarget,O=g.menuShouldBlockScroll,E=g.menuShouldScrollIntoView,M=g.noOptionsMessage,A=g.onMenuScrollToTop,P=g.onMenuScrollToBottom;if(!_)return null;var T=function(e,n){var r=e.type,i=e.data,o=e.isDisabled,s=e.isSelected,a=e.label,l=e.value,u=p===i,g=o?void 0:function(){return t.onOptionHover(i)},m=o?void 0:function(){return t.selectOption(i)},v="".concat(t.getElementId("option"),"-").concat(n),y={id:v,onClick:m,onMouseMove:g,onMouseOver:g,tabIndex:-1,role:"option","aria-selected":t.state.isAppleDevice?void 0:s};return d.createElement(c,(0,f.default)({},h,{innerProps:y,data:i,isDisabled:o,isSelected:s,key:v,label:a,type:r,value:l,isFocused:u,innerRef:u?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())e=this.getCategorizedOptions().map(function(e){if("group"===e.type){var n=e.data,o=e.options,s=e.index,a="".concat(t.getElementId("group"),"-").concat(s),l="".concat(a,"-heading");return d.createElement(r,(0,f.default)({},h,{key:a,data:n,options:o,Heading:i,headingProps:{id:l,data:e.data},label:t.formatGroupLabel(e.data)}),e.options.map(function(e){return T(e,"".concat(s,"-").concat(e.index))}))}if("option"===e.type)return T(e,"".concat(e.index))});else if(y){var R=b({inputValue:v});if(null===R)return null;e=d.createElement(l,h,R)}else{var I=M({inputValue:v});if(null===I)return null;e=d.createElement(u,h,I)}var D={minMenuHeight:x,maxMenuHeight:w,menuPlacement:k,menuPosition:S,menuShouldScrollIntoView:E},L=d.createElement(ek,(0,f.default)({},h,D),function(n){var r=n.ref,i=n.placerProps,a=i.placement,l=i.maxHeight;return d.createElement(o,(0,f.default)({},h,D,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:y,placement:a}),d.createElement(ts,{captureEnabled:m,onTopArrive:A,onBottomArrive:P,lockEnabled:O},function(n){return d.createElement(s,(0,f.default)({},h,{innerRef:function(e){t.getMenuListRef(e),n(e)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:t.getElementId("listbox")},isLoading:y,maxHeight:l,focusedOption:p}),e)}))});return C||"fixed"===S?d.createElement(a,(0,f.default)({},h,{appendTo:C,controlElement:this.controlRef,menuPlacement:k,menuPosition:S}),L):L}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,o=t.name,s=t.required,a=this.state.selectValue;if(s&&!this.hasValue()&&!r)return d.createElement(tl,{name:o,onFocus:this.onValueInputFocus});if(o&&!r)if(i)if(n){var l=a.map(function(t){return e.getOptionValue(t)}).join(n);return d.createElement("input",{name:o,type:"hidden",value:l})}else{var u=a.length>0?a.map(function(t,n){return d.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})}):d.createElement("input",{name:o,type:"hidden",value:""});return d.createElement("div",null,u)}else{var c=a[0]?this.getOptionValue(a[0]):"";return d.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.isFocused,s=t.selectValue,a=this.getFocusableOptions();return d.createElement(eU,(0,f.default)({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:o,selectValue:s,focusableOptions:a,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,o=this.props,s=o.className,a=o.id,l=o.isDisabled,u=o.menuIsOpen,c=this.state.isFocused,h=this.commonProps=this.getCommonProps();return d.createElement(r,(0,f.default)({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:c}),this.renderLiveRegion(),d.createElement(t,(0,f.default)({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:c,menuIsOpen:u}),d.createElement(i,(0,f.default)({},h,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(n,(0,f.default)({},h,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,s=t.ariaSelection,a=t.isFocused,l=t.prevWasFocused,u=t.instancePrefix,c=e.options,d=e.value,h=e.menuIsOpen,f=e.inputValue,g=e.isMulti,m=eo(d),v={};if(r&&(d!==r.value||c!==r.options||h!==r.menuIsOpen||f!==r.inputValue)){var y,b=h?tg(tp(e,m)):[],x=h?tm(tp(e,m),"".concat(u,"-option")):[],w=i?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,m):null,_=(y=t.focusedOption)&&b.indexOf(y)>-1?y:b[0],k=ty(x,_);v={selectValue:m,focusedOption:_,focusedOptionId:k,focusableOptionsWithIds:x,focusedValue:w,clearFocusValueOnUpdate:!1}}var S=null!=o&&e!==r?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},C=s,O=a&&l;return a&&!O&&(C={value:(n=m[0]||null,g?m:n),options:m,action:"initial-input-focus"},O=!l),(null==s?void 0:s.action)==="initial-input-focus"&&(C=null),(0,p.default)((0,p.default)((0,p.default)({},v),S),{},{prevProps:e,ariaSelection:C,prevWasFocused:O})}}]),n}(d.Component);tO.defaultProps=th,e.i(737050),e.i(503172);var tE=(0,d.forwardRef)(function(e,t){var n=(0,h.u)(e);return d.createElement(tO,(0,f.default)({ref:t},n))});e.s(["default",()=>tE],497647);var tM=e.i(400905);function tA({params:e,onParamsChanged:t,setIsReadyToExecute:n}){let[r,h]=(0,d.useState)(!e.columns||0===e.columns.length),f=e.model,{columns:p,isLoading:g,error:m}=(0,tM.default)(e.model);(0,d.useEffect)(()=>{n(!!f)},[f,n]);let v=p.map(e=>e.name);return g?(0,i.jsx)(o.default,{children:"Loading..."}):0===v.length||m?(0,i.jsx)(o.default,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,i.jsxs)(l.default,{spacing:5,sx:{m:"8px 24px",pb:"200px"},children:[(0,i.jsxs)(o.default,{children:[(0,i.jsx)(c.default,{variant:"body2",sx:{mb:1},children:"Model"}),(0,i.jsx)(u.default,{fullWidth:!0,size:"small",value:e.model,slotProps:{input:{readOnly:!0}}})]}),(0,i.jsxs)(o.default,{children:[(0,i.jsx)(c.default,{variant:"body2",sx:{mb:1},children:"Columns"}),(0,i.jsx)(a.default,{control:(0,i.jsx)(s.default,{checked:r,onChange:n=>{h(n.target.checked),t({...e,columns:void 0})},size:"small"}),label:"All columns",sx:{mb:"10px"}}),!r&&(0,i.jsx)(tE,{isMulti:!0,className:"no-track-pii-safe",closeMenuOnSelect:!1,options:v.map(e=>({label:e,value:e})),value:(e.columns??[]).map(e=>({label:e,value:e})),onChange:n=>{let r,i=Array.isArray(n)?n.map(e=>e.value):[];r=0===i.length?void 0:i,t({...e,columns:r})},styles:{container:e=>({...e,width:"100%"}),control:e=>({...e,minHeight:"40px"})}})]})]})}e.s(["ProfileDiffForm",()=>tA],909411);function tP(e){let{columnMap:t,primaryKeys:n,pinnedColumns:r,columnsRenderMode:i,changedOnly:o=!1,rowStats:s,excludeColumns:a=[],strictMode:l=!1}=e,u=(s?.modified??0)>0,c=[];return n.forEach(e=>{let n=t[e];if(!n){if(l)throw Error(`Primary key column "${e}" not found in columnMap`);return}c.push({key:e,name:e,columnType:n.colType,columnStatus:n.status,columnRenderMode:i[e],frozen:!0,isPrimaryKey:!0})}),r.forEach(e=>{if(n.includes(e)||a.includes(e))return;let r=t[e];if(!r){if(l)throw Error(`Pinned column "${e}" not found in columnMap`);return}c.push({key:e,name:e,columnType:r.colType,columnStatus:r.status,columnRenderMode:i[e]})}),Object.entries(t).forEach(([e,t])=>{var s;n.includes(e)||r.includes(e)||!a.includes(e)&&(s=t.status,o&&u&&"added"!==s&&"removed"!==s&&"modified"!==s||c.push({key:e,name:e,columnType:t.colType,columnStatus:t.status,columnRenderMode:i[e]}))}),c}function tT(e){let{columnMap:t,primaryKeys:n,pinnedColumns:r,columnsRenderMode:i,excludeColumns:o=[],strictMode:s=!1}=e,a=[];return n.forEach(e=>{let n=t[e];if(!n){if(s)throw Error(`Primary key column "${e}" not found in columnMap`);return}a.push({key:e,name:e,columnType:n.colType,columnRenderMode:i[e],frozen:!0,isPrimaryKey:!0})}),r.forEach(e=>{if(n.includes(e)||o.includes(e))return;let r=t[e];if(!r){if(s)throw Error(`Pinned column "${e}" not found in columnMap`);return}a.push({key:r.key,name:e,columnType:r.colType,columnRenderMode:i[e]})}),Object.entries(t).forEach(([e,t])=>{n.includes(e)||r.includes(e)||o.includes(e)||a.push({key:t.key,name:e,columnType:t.colType,columnRenderMode:i[e]})}),a}e.s(["getDisplayColumns",()=>tP,"getSimpleDisplayColumns",()=>tT],231076)},332397,e=>{"use strict";var t=e.i(435983),n=e.i(446519);function r(e){return(0,n.default)("MuiDivider",e)}let i=(0,t.default)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);e.s(["default",0,i,"getDividerUtilityClass",()=>r])},386413,e=>{"use strict";var t=e.i(332397);e.s(["dividerClasses",()=>t.default])},89035,e=>{"use strict";var t=e.i(435983),n=e.i(446519);function r(e){return(0,n.default)("MuiListItemIcon",e)}let i=(0,t.default)("MuiListItemIcon",["root","alignItemsFlexStart"]);e.s(["default",0,i,"getListItemIconUtilityClass",()=>r])},950690,e=>{"use strict";var t=e.i(89035);e.s(["listItemIconClasses",()=>t.default])},120875,e=>{"use strict";var t=e.i(435983),n=e.i(446519);function r(e){return(0,n.default)("MuiListItemText",e)}let i=(0,t.default)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);e.s(["default",0,i,"getListItemTextUtilityClass",()=>r])},263712,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(451962),o=e.i(446547),s=e.i(73205),a=e.i(519273),l=e.i(838443),u=e.i(98648),c=e.i(921301),d=e.i(723938),h=e.i(386413),f=e.i(950690),p=e.i(120875),p=p,g=e.i(435983),m=e.i(446519);function v(e){return(0,m.default)("MuiMenuItem",e)}let y=(0,g.default)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var b=e.i(19483);let x=(0,o.styled)(u.default,{shouldForwardProp:e=>(0,i.default)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,s.default)(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${y.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${y.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${y.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${y.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${y.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${h.dividerClasses.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${h.dividerClasses.inset}`]:{marginLeft:52},[`& .${p.default.root}`]:{marginTop:0,marginBottom:0},[`& .${p.default.inset}`]:{paddingLeft:36},[`& .${f.listItemIconClasses.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${f.listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}}]}))),w=t.forwardRef(function(e,i){let o,s=(0,a.useDefaultProps)({props:e,name:"MuiMenuItem"}),{autoFocus:u=!1,component:h="li",dense:f=!1,divider:p=!1,disableGutters:g=!1,focusVisibleClassName:m,role:y="menuitem",tabIndex:w,className:_,...k}=s,S=t.useContext(l.default),C=t.useMemo(()=>({dense:f||S.dense||!1,disableGutters:g}),[S.dense,f,g]),O=t.useRef(null);(0,c.default)(()=>{u&&O.current&&O.current.focus()},[u]);let E={...s,dense:C.dense,divider:p,disableGutters:g},M=(e=>{let{disabled:t,dense:n,divider:i,disableGutters:o,selected:s,classes:a}=e,l=(0,r.default)({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",i&&"divider",s&&"selected"]},v,a);return{...a,...l}})(s),A=(0,d.default)(O,i);return s.disabled||(o=void 0!==w?w:-1),(0,b.jsx)(l.default.Provider,{value:C,children:(0,b.jsx)(x,{ref:A,role:y,tabIndex:o,component:h,focusVisibleClassName:(0,n.default)(M.focusVisible,m),className:(0,n.default)(M.root,_),...k,ownerState:E,classes:M})})});e.s(["default",0,w],263712)},224378,e=>{"use strict";var t=e.i(955343);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M9.588 2.215A5.808 5.808 0 0 0 8 2c-.554 0-1.082.073-1.588.215l-.006.002c-.514.141-.99.342-1.432.601A6.156 6.156 0 0 0 2.82 4.98l-.002.004A5.967 5.967 0 0 0 2.21 6.41 5.986 5.986 0 0 0 2 8c0 .555.07 1.085.21 1.591a6.05 6.05 0 0 0 1.548 2.651c.37.365.774.677 1.216.94a6.1 6.1 0 0 0 1.435.609A6.02 6.02 0 0 0 8 14c.555 0 1.085-.07 1.591-.21.515-.145.99-.348 1.426-.607l.004-.002a6.16 6.16 0 0 0 2.161-2.155 5.85 5.85 0 0 0 .6-1.432l.003-.006A5.807 5.807 0 0 0 14 8c0-.554-.072-1.082-.215-1.588l-.002-.006a5.772 5.772 0 0 0-.6-1.423l-.002-.004a5.9 5.9 0 0 0-.942-1.21l-.008-.008a5.902 5.902 0 0 0-1.21-.942l-.004-.002a5.772 5.772 0 0 0-1.423-.6l-.006-.002zm4.455 9.32a7.157 7.157 0 0 1-2.516 2.508 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 1h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2 13h11V2H2v11z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4H7v3H4v1h3v3h1V8h3V7H8V4z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 1h13l.5.5v13l-.5.5h-13l-.5-.5v-13l.5-.5zM2 2v12h12V2H2zm6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10 7v1H5V7h5z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 1h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2 13h11V2H2v11z"},child:[]}]})(e)}function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 1L4 1.5V3.02746C4.16417 3.00932 4.331 3 4.5 3C4.669 3 4.83583 3.00932 5 3.02746V2H14V7H12.2929L11 8.29289V7H8.97254C8.99068 7.16417 9 7.331 9 7.5C9 7.669 8.99068 7.83583 8.97254 8H10V9.5L10.8536 9.85355L12.7071 8H14.5L15 7.5V1.5L14.5 1H4.5Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6.41705 10.4288C7.37039 9.80348 8 8.72527 8 7.5C8 5.567 6.433 4 4.5 4C2.567 4 1 5.567 1 7.5C1 8.72527 1.62961 9.80348 2.58295 10.4288C2.11364 10.6498 1.68557 10.9505 1.31802 11.318C0.900156 11.7359 0.568688 12.232 0.342542 12.7779C0.180451 13.1692 0.0747425 13.5807 0.0278638 14C0.00933826 14.1657 0 14.3326 0 14.5V15H1L0.999398 14.5C0.999398 14.4784 0.999599 14.4567 1 14.4351C1.00811 13.9975 1.09823 13.5651 1.26587 13.1604C1.44179 12.7357 1.69964 12.3498 2.0247 12.0247C2.34976 11.6996 2.73566 11.4418 3.16038 11.2659C3.57088 11.0958 4.00986 11.0056 4.45387 10.9997C4.46922 10.9999 4.4846 11 4.5 11C4.5154 11 4.53078 10.9999 4.54613 10.9997C4.99014 11.0056 5.42912 11.0958 5.83962 11.2659C6.26433 11.4418 6.65024 11.6996 6.9753 12.0247C7.30036 12.3498 7.55821 12.7357 7.73413 13.1604C7.90177 13.5651 7.99189 13.9975 8 14.4351C8.0004 14.4567 8.0006 14.4784 8.0006 14.5L8 15H9V14.5C9 14.3326 8.99066 14.1657 8.97214 14C8.92526 13.5807 8.81955 13.1692 8.65746 12.7779C8.43131 12.232 8.09984 11.7359 7.68198 11.318C7.31443 10.9505 6.88636 10.6498 6.41705 10.4288ZM4.5 10C3.11929 10 2 8.88071 2 7.5C2 6.11929 3.11929 5 4.5 5C5.88071 5 7 6.11929 7 7.5C7 8.88071 5.88071 10 4.5 10Z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M5.616 4.928a2.487 2.487 0 0 1-1.119.922c-.148.06-.458.138-.458.138v5.008a2.51 2.51 0 0 1 1.579 1.062c.273.412.419.895.419 1.388.008.343-.057.684-.19 1A2.485 2.485 0 0 1 3.5 15.984a2.482 2.482 0 0 1-1.388-.419A2.487 2.487 0 0 1 1.05 13c.095-.486.331-.932.68-1.283.349-.343.79-.579 1.269-.68V5.949a2.6 2.6 0 0 1-1.269-.68 2.503 2.503 0 0 1-.68-1.283 2.487 2.487 0 0 1 1.06-2.565A2.49 2.49 0 0 1 3.5 1a2.504 2.504 0 0 1 1.807.729 2.493 2.493 0 0 1 .729 1.81c.002.494-.144.978-.42 1.389zm-.756 7.861a1.5 1.5 0 0 0-.552-.579 1.45 1.45 0 0 0-.77-.21 1.495 1.495 0 0 0-1.47 1.79 1.493 1.493 0 0 0 1.18 1.179c.288.058.586.03.86-.08.276-.117.512-.312.68-.56.15-.226.235-.49.249-.76a1.51 1.51 0 0 0-.177-.78zM2.708 4.741c.247.161.536.25.83.25.271 0 .538-.075.77-.211a1.514 1.514 0 0 0 .729-1.359 1.513 1.513 0 0 0-.25-.76 1.551 1.551 0 0 0-.68-.56 1.49 1.49 0 0 0-.86-.08 1.494 1.494 0 0 0-1.179 1.18c-.058.288-.03.586.08.86.117.276.312.512.56.68zm10.329 6.296c.48.097.922.335 1.269.68.466.47.729 1.107.725 1.766.002.493-.144.977-.42 1.388a2.499 2.499 0 0 1-4.532-.899 2.5 2.5 0 0 1 1.067-2.565c.267-.183.571-.308.889-.37V5.489a1.5 1.5 0 0 0-1.5-1.499H8.687l1.269 1.27-.71.709L7.117 3.84v-.7l2.13-2.13.71.711-1.269 1.27h1.85a2.484 2.484 0 0 1 2.312 1.541c.125.302.189.628.187.957v5.548zm.557 3.509a1.493 1.493 0 0 0 .191-1.89 1.552 1.552 0 0 0-.68-.559 1.49 1.49 0 0 0-.86-.08 1.493 1.493 0 0 0-1.179 1.18 1.49 1.49 0 0 0 .08.86 1.496 1.496 0 0 0 2.448.49z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.507 12.324a7 7 0 0 0 .065-8.56A7 7 0 0 0 2 4.393V2H1v3.5l.5.5H5V5H2.811a6.008 6.008 0 1 1-.135 5.77l-.887.462a7 7 0 0 0 11.718 1.092zm-3.361-.97l.708-.707L8 7.792V4H7v4l.146.354 3 3z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.351 1.091a4.528 4.528 0 0 1 3.44 3.16c.215.724.247 1.49.093 2.23a4.583 4.583 0 0 1-4.437 3.6c-.438 0-.874-.063-1.293-.19l-.8.938-.379.175H7v1.5l-.5.5H5v1.5l-.5.5h-3l-.5-.5v-2.307l.146-.353L6.12 6.87a4.464 4.464 0 0 1-.2-1.405 4.528 4.528 0 0 1 5.431-4.375zm1.318 7.2a3.568 3.568 0 0 0 1.239-2.005l.004.005A3.543 3.543 0 0 0 9.72 2.08a3.576 3.576 0 0 0-2.8 3.4c-.01.456.07.908.239 1.33l-.11.543L2 12.404v1.6h2v-1.5l.5-.5H6v-1.5l.5-.5h1.245l.876-1.016.561-.14a3.47 3.47 0 0 0 1.269.238 3.568 3.568 0 0 0 2.218-.795zm-.838-2.732a1 1 0 1 0-1.662-1.11 1 1 0 0 0 1.662 1.11z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 5v7h-.278c-.406 0-.778-.086-1.117-.258A2.528 2.528 0 0 1 11.73 11H8.87a3.463 3.463 0 0 1-.546.828 3.685 3.685 0 0 1-.735.633c-.27.177-.565.31-.882.398a3.875 3.875 0 0 1-.985.141h-.5V9H2l-1-.5L2 8h3.222V4h.5c.339 0 .664.047.977.14.312.094.607.227.883.4A3.404 3.404 0 0 1 8.87 6h2.859a2.56 2.56 0 0 1 .875-.734c.338-.172.71-.26 1.117-.266H14zm-.778 1.086a1.222 1.222 0 0 0-.32.156 1.491 1.491 0 0 0-.43.461L12.285 7H8.183l-.117-.336a2.457 2.457 0 0 0-.711-1.047C7.027 5.331 6.427 5.09 6 5v7c.427-.088 1.027-.33 1.355-.617.328-.287.565-.636.71-1.047L8.184 10h4.102l.18.297c.057.094.122.177.195.25.073.073.153.143.242.21.088.069.195.12.32.157V6.086z"},child:[]}]})(e)}function f(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 2h7v.278c0 .406-.086.778-.258 1.117-.172.339-.42.63-.742.875v2.86c.307.145.583.328.828.546.245.219.456.464.633.735.177.27.31.565.398.882.089.318.136.646.141.985v.5H8V14l-.5 1-.5-1v-3.222H3v-.5c0-.339.047-.664.14-.977.094-.312.227-.607.4-.883A3.404 3.404 0 0 1 5 7.13V4.27a2.561 2.561 0 0 1-.734-.875A2.505 2.505 0 0 1 4 2.278V2zm1.086.778c.042.125.094.232.156.32a1.494 1.494 0 0 0 .461.43L6 3.715v4.102l-.336.117c-.411.146-.76.383-1.047.711C4.331 8.973 4.09 9.573 4 10h7c-.088-.427-.33-1.027-.617-1.355a2.456 2.456 0 0 0-1.047-.71L9 7.816V3.715l.297-.18c.094-.057.177-.122.25-.195a2.28 2.28 0 0 0 .21-.242.968.968 0 0 0 .157-.32H5.086z"},child:[]}]})(e)}e.s(["VscCircleLarge",()=>n,"VscClose",()=>r,"VscDiffAdded",()=>i,"VscDiffModified",()=>o,"VscDiffRemoved",()=>s,"VscFeedback",()=>a,"VscGitPullRequest",()=>l,"VscHistory",()=>u,"VscKebabVertical",()=>c,"VscKey",()=>d,"VscPin",()=>h,"VscPinned",()=>f])},861729,251915,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(73371),i=e.i(135301),o=e.i(263712),s=e.i(187725),a=e.i(224378);function l(e,t){return[{value:"Show raw value",onClick:()=>{t({[e]:"raw"})}},{value:"Show 2 decimal points",onClick:()=>{t({[e]:2})}},{value:"Show as percentage",onClick:()=>{t({[e]:"percent"})}},{value:"Show with net change",onClick:()=>{t({[e]:"delta"})}}]}function u({name:e,columnStatus:u,columnType:c,primaryKeys:d=[],onPrimaryKeyChange:h,pinnedColumns:f=[],onPinnedColumnsChange:p,onColumnsRenderModeChanged:g}){let[m,v]=(0,s.useState)(null),y=()=>{v(null)};if("index"===e)return(0,t.jsx)(t.Fragment,{});let b=d.includes(e),x=f.includes(e),w=[];return g&&(w=l(e,g)),(0,t.jsxs)(n.default,{sx:{display:"flex",alignItems:"center",gap:"10px"},className:"grid-header",children:[b&&(0,t.jsx)(a.VscKey,{}),(0,t.jsx)(n.default,{sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),"added"!==u&&"removed"!==u&&h&&(0,t.jsx)(n.default,{component:b?a.VscClose:a.VscKey,className:b?"close-icon":"key-icon",sx:{display:b?"block":"none",cursor:"pointer"},onClick:b?()=>{h&&h(d.filter(t=>t!==e))}:()=>{h&&h([...d.filter(e=>"index"!==e),e])}}),!b&&p&&(0,t.jsx)(n.default,{component:x?a.VscPinned:a.VscPin,className:x?"unpin-icon":"pin-icon",sx:{display:x?"block":"none",cursor:"pointer"},onClick:x?()=>{p&&p(f.filter(t=>t!==e))}:()=>{p&&p([...f,e])}}),!b&&"number"===c&&w.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{"aria-label":"Options",size:"small",className:"!size-4 !min-w-4",onClick:e=>{v(e.currentTarget)},children:(0,t.jsx)(a.VscKebabVertical,{})}),(0,t.jsx)(i.default,{anchorEl:m,open:!!m,onClose:y,children:w.map(e=>(0,t.jsx)(o.default,{onClick:()=>{e.onClick(),y()},children:e.value},e.value))})]})]})}e.s(["columnPrecisionSelectOptions",()=>l],251915),e.s(["DataFrameColumnGroupHeader",()=>u],861729)},388797,e=>{"use strict";var t=e.i(955343);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"},child:[]}]})(e)}function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},child:[]}]})(e)}function f(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z"},child:[]}]})(e)}function p(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"},child:[]}]})(e)}function g(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M24,128A72.08,72.08,0,0,1,96,56H204.69L194.34,45.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L204.69,72H96a56.06,56.06,0,0,0-56,56,8,8,0,0,1-16,0Zm200-8a8,8,0,0,0-8,8,56.06,56.06,0,0,1-56,56H51.31l10.35-10.34a8,8,0,0,0-11.32-11.32l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L51.31,200H160a72.08,72.08,0,0,0,72-72A8,8,0,0,0,224,120Z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"},child:[]}]})(e)}function y(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"},child:[]}]})(e)}function b(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"},child:[]}]})(e)}e.s(["PiBookmarkSimple",()=>i,"PiCaretDown",()=>o,"PiChatText",()=>s,"PiCheck",()=>l,"PiCheckCircle",()=>a,"PiCircle",()=>u,"PiCopy",()=>c,"PiDotsThreeVertical",()=>d,"PiInfo",()=>h,"PiInfoFill",()=>n,"PiNotePencil",()=>f,"PiPencilSimple",()=>p,"PiPlusCircle",()=>g,"PiRepeat",()=>m,"PiTrashFill",()=>r,"PiTrashSimple",()=>v,"PiWarning",()=>y,"PiX",()=>b])},978987,675155,196137,882244,392399,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(73371),i=e.i(135301),o=e.i(263712),s=e.i(187725),a=e.i(388797),l=e.i(224378),u=e.i(251915);function c({name:e,pinnedColumns:c=[],onPinnedColumnsChange:d=()=>{},columnType:h,onColumnsRenderModeChanged:f}){let[p,g]=(0,s.useState)(null),m=()=>{g(null)},v=[];f&&(v=(0,u.columnPrecisionSelectOptions)(e,f));let y=c.includes(e);return(0,t.jsxs)(n.default,{sx:{display:"flex",alignItems:"center"},className:"grid-header",children:[(0,t.jsx)(n.default,{sx:{flex:1},children:e}),(0,t.jsx)(n.default,{component:y?l.VscPinned:l.VscPin,className:y?"unpin-icon":"pin-icon",sx:{display:y?"block":"none",cursor:"pointer"},onClick:y?()=>{d(c.filter(t=>t!==e))}:()=>{d([...c,e])}}),"number"===h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{"aria-label":"Options",size:"small",className:"!size-4 !min-w-4",onClick:e=>{g(e.currentTarget)},children:(0,t.jsx)(a.PiDotsThreeVertical,{})}),(0,t.jsx)(i.default,{anchorEl:p,open:!!p,onClose:m,children:v.map(e=>(0,t.jsx)(o.default,{onClick:()=>{e.onClick(),m()},children:e.value},e.value))})]})]})}e.s(["DataFrameColumnHeader",()=>c],978987);var d=e.i(427938);function h(e,t){let n=[...e],r=[...t],i=[];for(;n.length>0&&r.length>0;)if(i.includes(n[0]))n.shift();else if(i.includes(r[0]))r.shift();else if(n[0]===r[0])i.push(n[0]),n.shift(),r.shift();else if(r.includes(n[0])){let e=r.indexOf(n[0]);for(let t=0;t<e;t++)i.includes(r[t])||i.push(r[t]);i.push(n[0]),n.shift(),r.splice(0,e+1)}else i.push(n[0]),n.shift();return n.forEach(e=>{i.includes(e)||i.push(e)}),r.forEach(e=>{i.includes(e)||i.push(e)}),i}function f(e,t){let n=h(e,t),r={};for(let i of n)e.includes(i)?t.includes(i)?r[i]=void 0:r[i]="removed":r[i]="added";let i={};e.forEach((e,t)=>{i[e]=t});let o=-1;for(let e of n){let t=i[e];null!=t&&(t>o?o=t:r[e]="reordered")}return r}e.i(228337),e.s(["mergeKeys",()=>h,"mergeKeysWithStatus",()=>f],675155);var p=e.i(122429);function g(e){return e.data.map((t,n)=>({...e.columns.reduce((e,n,r)=>(e[n.key]=t[r],e),{}),__status:void 0,_index:n+1}))}function m(e){let t=Number(e);return!isNaN(t)&&isFinite(t)?t:function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(e)}function v(e,t){let n=t.toLowerCase();if(n in e)return e[n];let r=Object.keys(e).find(e=>e.toLowerCase()===n);return r?e[r]:void 0}function y(e){let t={};return e.columns.forEach((e,n)=>{t[e.name]={key:e.key,index:n,colType:e.type}}),t}function b(e){let t={};if(e.columns.forEach((e,n)=>{t[e.key]={key:e.key,index:n,colType:e.type}}),!t.in_a)throw Error("Joined DataFrame missing required 'in_a' column");if(!t.in_b)throw Error("Joined DataFrame missing required 'in_b' column");return t}function x(e,t){let n={};return Object.entries(f(e.columns.map(e=>e.key),t.columns.map(e=>e.key))).forEach(([r,i])=>{let o=e.columns.find(e=>e.key===r),s=t.columns.find(e=>e.key===r);n[r]={status:i,baseColumnKey:o?.key??"unknown",currentColumnKey:s?.key??"unknown",colType:o?.type??s?.type??"unknown",key:o?.key??s?.key??"unknown"}}),n}function w(e,t){let n=[];for(let r of t){let t=e.find(e=>e.key===r);if(!t)throw Error(`Column ${r} not found`);n.push(t.key)}return n}function _(e,t,n){if(0===t.length)return String(n._index);let r=[];for(let i of t){let t=e.find(e=>e.key===i);if(!t)throw Error(`Primary Column ${i} not found`);let o=n[i];r.push(`${t.name}=${o}`)}return r.join("|")}function k(e,t=2){let n=Object.is(e,-0)?0:e,r=(0,p.formatNumber)(n,"en-US",{maximumFractionDigits:t,roundingMode:"halfEven"})??String(e);return"-0"===r?"0":r}function S(e,t){return Number.isNaN(e)?"NaN":Number.isFinite(e)?"raw"===t?String(e):"number"==typeof t?k(e,t):"percent"===t?(0,p.formatNumber)(e,"en-US",{style:"percent",maximumFractionDigits:2})??String(e):k(e,2):e>0?"∞":"-∞"}function C(e,t,n,r){let i,o=v(e,t);if(null==o)return["-",!0];let s=!1;return"boolean"==typeof o?i=o.toString():""===o?(i="(empty)",s=!0):i="number"==typeof o?S(o,r):"number"===n?S(parseFloat(o),r):String(o),[i,s]}function O(e){return"added"===e?"diff-header-added":"removed"===e?"diff-header-removed":void 0}e.s(["dataFrameToRowObjects",()=>g,"getCaseInsensitive",()=>v,"keyToNumber",()=>m],196137),e.s(["buildColumnMap",()=>y,"buildJoinedColumnMap",()=>b,"buildMergedColumnMap",()=>x,"formatSmartDecimal",()=>k,"getHeaderCellClass",()=>O,"getPrimaryKeyValue",()=>_,"toRenderedValue",()=>C,"validatePrimaryKeys",()=>w],882244),e.s(["defaultRenderCell",0,({row:e,column:n})=>{let{columnType:r,columnRenderMode:i}=n,[o,s]=C(e,n.key,r,i);return(0,t.jsx)(d.default,{component:"span",style:{color:s?"gray":"inherit"},children:o})}],392399)},941666,e=>{"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){var n=t(e).Element;return e instanceof n||e instanceof Element}function r(e){var n=t(e).HTMLElement;return e instanceof n||e instanceof HTMLElement}function i(e){if("undefined"==typeof ShadowRoot)return!1;var n=t(e).ShadowRoot;return e instanceof n||e instanceof ShadowRoot}var o,s,a,l,u,c=Math.max,d=Math.min,h=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function p(){return!/^((?!chrome|android).)*safari/i.test(f())}function g(e,i,o){void 0===i&&(i=!1),void 0===o&&(o=!1);var s=e.getBoundingClientRect(),a=1,l=1;i&&r(e)&&(a=e.offsetWidth>0&&h(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&h(s.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,c=!p()&&o,d=(s.left+(c&&u?u.offsetLeft:0))/a,f=(s.top+(c&&u?u.offsetTop:0))/l,g=s.width/a,m=s.height/l;return{width:g,height:m,top:f,right:d+g,bottom:f+m,left:d,x:d,y:f}}function m(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function v(e){return e?(e.nodeName||"").toLowerCase():null}function y(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function b(e){return g(y(e)).left+m(e).scrollLeft}function x(e){return t(e).getComputedStyle(e)}function w(e){var t=x(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function _(e){var t=g(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function k(e){return"html"===v(e)?e:e.assignedSlot||e.parentNode||(i(e)?e.host:null)||y(e)}function S(e,n){void 0===n&&(n=[]);var i,o=function e(t){return["html","body","#document"].indexOf(v(t))>=0?t.ownerDocument.body:r(t)&&w(t)?t:e(k(t))}(e),s=o===(null==(i=e.ownerDocument)?void 0:i.body),a=t(o),l=s?[a].concat(a.visualViewport||[],w(o)?o:[]):o,u=n.concat(l);return s?u:u.concat(S(k(l)))}function C(e){return r(e)&&"fixed"!==x(e).position?e.offsetParent:null}function O(e){for(var n=t(e),o=C(e);o&&["table","td","th"].indexOf(v(o))>=0&&"static"===x(o).position;)o=C(o);return o&&("html"===v(o)||"body"===v(o)&&"static"===x(o).position)?n:o||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===x(e).position)return null;var n=k(e);for(i(n)&&(n=n.host);r(n)&&0>["html","body"].indexOf(v(n));){var o=x(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||n}var E="bottom",M="right",A="left",P="auto",T=["top",E,M,A],R="start",I="viewport",D="popper",L=T.reduce(function(e,t){return e.concat([t+"-"+R,t+"-end"])},[]),j=[].concat(T,[P]).reduce(function(e,t){return e.concat([t,t+"-"+R,t+"-end"])},[]),N=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&i(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function B(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function z(e,r,i){var o,s,a,l,u,d,h,f,v,w;return r===I?B(function(e,n){var r=t(e),i=y(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,l=0,u=0;if(o){s=o.width,a=o.height;var c=p();(c||!c&&"fixed"===n)&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:a,x:l+b(e),y:u}}(e,i)):n(r)?((o=g(r,!1,"fixed"===i)).top=o.top+r.clientTop,o.left=o.left+r.clientLeft,o.bottom=o.top+r.clientHeight,o.right=o.left+r.clientWidth,o.width=r.clientWidth,o.height=r.clientHeight,o.x=o.left,o.y=o.top,o):B((s=y(e),l=y(s),u=m(s),d=null==(a=s.ownerDocument)?void 0:a.body,h=c(l.scrollWidth,l.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),f=c(l.scrollHeight,l.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),v=-u.scrollLeft+b(s),w=-u.scrollTop,"rtl"===x(d||l).direction&&(v+=c(l.clientWidth,d?d.clientWidth:0)-h),{width:h,height:f,x:v,y:w}))}function V(e){return e.split("-")[0]}function H(e){return e.split("-")[1]}function $(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function W(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?V(i):null,s=i?H(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case"top":t={x:a,y:n.y-r.height};break;case E:t={x:a,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:l};break;case A:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?$(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case R:t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function U(){return{top:0,right:0,bottom:0,left:0}}function q(e){return Object.assign({},U(),e)}function Q(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function K(e,t){void 0===t&&(t={});var i,o,s,a,l,u,h,f,p=t,m=p.placement,b=void 0===m?e.placement:m,w=p.strategy,_=void 0===w?e.strategy:w,C=p.boundary,A=p.rootBoundary,P=p.elementContext,R=void 0===P?D:P,L=p.altBoundary,j=p.padding,N=void 0===j?0:j,V=q("number"!=typeof N?N:Q(N,T)),H=e.rects.popper,$=e.elements[void 0!==L&&L?R===D?"reference":D:R],U=(i=n($)?$:$.contextElement||y(e.elements.popper),o=void 0===C?"clippingParents":C,s=void 0===A?I:A,h=(u=[].concat("clippingParents"===o?(a=S(k(i)),!n(l=["absolute","fixed"].indexOf(x(i).position)>=0&&r(i)?O(i):i)?[]:a.filter(function(e){return n(e)&&F(e,l)&&"body"!==v(e)})):[].concat(o),[s]))[0],(f=u.reduce(function(e,t){var n=z(i,t,_);return e.top=c(n.top,e.top),e.right=d(n.right,e.right),e.bottom=d(n.bottom,e.bottom),e.left=c(n.left,e.left),e},z(i,h,_))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),K=g(e.elements.reference),G=W({reference:K,element:H,strategy:"absolute",placement:b}),X=B(Object.assign({},H,G)),Y=R===D?X:K,Z={top:U.top-Y.top+V.top,bottom:Y.bottom-U.bottom+V.bottom,left:U.left-Y.left+V.left,right:Y.right-U.right+V.right},J=e.modifiersData.offset;if(R===D&&J){var ee=J[b];Object.keys(Z).forEach(function(e){var t=[M,E].indexOf(e)>=0?1:-1,n=["top",E].indexOf(e)>=0?"y":"x";Z[e]+=ee[n]*t})}return Z}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function X(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var Y={passive:!0},Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var n,r,i,o,s,a,l,u=e.popper,c=e.popperRect,d=e.placement,f=e.variation,p=e.offsets,g=e.position,m=e.gpuAcceleration,v=e.adaptive,b=e.roundOffsets,w=e.isFixed,_=p.x,k=void 0===_?0:_,S=p.y,C=void 0===S?0:S,P="function"==typeof b?b({x:k,y:C}):{x:k,y:C};k=P.x,C=P.y;var T=p.hasOwnProperty("x"),R=p.hasOwnProperty("y"),I=A,D="top",L=window;if(v){var j=O(u),N="clientHeight",F="clientWidth";j===t(u)&&"static"!==x(j=y(u)).position&&"absolute"===g&&(N="scrollHeight",F="scrollWidth"),("top"===d||(d===A||d===M)&&"end"===f)&&(D=E,C-=(w&&j===L&&L.visualViewport?L.visualViewport.height:j[N])-c.height,C*=m?1:-1),(d===A||("top"===d||d===E)&&"end"===f)&&(I=M,k-=(w&&j===L&&L.visualViewport?L.visualViewport.width:j[F])-c.width,k*=m?1:-1)}var B=Object.assign({position:g},v&&Z),z=!0===b?(n={x:k,y:C},r=t(u),i=n.x,o=n.y,{x:h(i*(s=r.devicePixelRatio||1))/s||0,y:h(o*s)/s||0}):{x:k,y:C};return(k=z.x,C=z.y,m)?Object.assign({},B,((l={})[D]=R?"0":"",l[I]=T?"0":"",l.transform=1>=(L.devicePixelRatio||1)?"translate("+k+"px, "+C+"px)":"translate3d("+k+"px, "+C+"px, 0)",l)):Object.assign({},B,((a={})[D]=R?C+"px":"",a[I]=T?k+"px":"",a.transform="",a))}var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function et(e){return e.replace(/left|right|bottom|top/g,function(e){return ee[e]})}var en={start:"end",end:"start"};function er(e){return e.replace(/start|end/g,function(e){return en[e]})}function ei(e,t,n){return c(e,d(t,n))}function eo(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function es(e){return["top",M,E,A].some(function(t){return e[t]>=0})}var ea=(a=void 0===(s=(o={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,i=e.options,o=i.scroll,s=void 0===o||o,a=i.resize,l=void 0===a||a,u=t(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return s&&c.forEach(function(e){e.addEventListener("scroll",r.update,Y)}),l&&u.addEventListener("resize",r.update,Y),function(){s&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Y)}),l&&u.removeEventListener("resize",r.update,Y)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=W({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,s=void 0===o||o,a={placement:V(t.placement),variation:H(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},a,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},a,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];r(o)&&v(o)&&(Object.assign(o.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],o=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});r(i)&&v(i)&&(Object.assign(i.style,s),Object.keys(o).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=j.reduce(function(e,n){var r,i,s,a,l,u;return e[n]=(r=t.rects,s=[A,"top"].indexOf(i=V(n))>=0?-1:1,l=(a="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0],u=a[1],l=l||0,u=(u||0)*s,[A,M].indexOf(i)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,g=n.allowedAutoPlacements,m=t.options.placement,v=V(m)===m,y=l||(v||!p?[et(m)]:function(e){if(V(e)===P)return[];var t=et(e);return[er(e),t,er(t)]}(m)),b=[m].concat(y).reduce(function(e,n){var r,i,o,s,a,l,h,f,m,v,y,b;return e.concat(V(n)===P?(i=(r={placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:g}).placement,o=r.boundary,s=r.rootBoundary,a=r.padding,l=r.flipVariations,f=void 0===(h=r.allowedAutoPlacements)?j:h,0===(y=(v=(m=H(i))?l?L:L.filter(function(e){return H(e)===m}):T).filter(function(e){return f.indexOf(e)>=0})).length&&(y=v),Object.keys(b=y.reduce(function(e,n){return e[n]=K(t,{placement:n,boundary:o,rootBoundary:s,padding:a})[V(n)],e},{})).sort(function(e,t){return b[e]-b[t]})):n)},[]),x=t.rects.reference,w=t.rects.popper,_=new Map,k=!0,S=b[0],C=0;C<b.length;C++){var O=b[C],I=V(O),D=H(O)===R,N=["top",E].indexOf(I)>=0,F=N?"width":"height",B=K(t,{placement:O,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),z=N?D?M:A:D?E:"top";x[F]>w[F]&&(z=et(z));var $=et(z),W=[];if(o&&W.push(B[I]<=0),a&&W.push(B[z]<=0,B[$]<=0),W.every(function(e){return e})){S=O,k=!1;break}_.set(O,W)}if(k)for(var U=p?3:1,q=function(e){var t=b.find(function(t){var n=_.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return S=t,"break"},Q=U;Q>0&&"break"!==q(Q);Q--);t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=n.altAxis,s=n.boundary,a=n.rootBoundary,l=n.altBoundary,u=n.padding,h=n.tether,f=void 0===h||h,p=n.tetherOffset,g=void 0===p?0:p,m=K(t,{boundary:s,rootBoundary:a,padding:u,altBoundary:l}),v=V(t.placement),y=H(t.placement),b=!y,x=$(v),w="x"===x?"y":"x",k=t.modifiersData.popperOffsets,S=t.rects.reference,C=t.rects.popper,P="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,T="number"==typeof P?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(k){if(void 0===i||i){var L,j="y"===x?"top":A,N="y"===x?E:M,F="y"===x?"height":"width",B=k[x],z=B+m[j],W=B-m[N],q=f?-C[F]/2:0,Q=y===R?S[F]:C[F],G=y===R?-C[F]:-S[F],X=t.elements.arrow,Y=f&&X?_(X):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:U(),J=Z[j],ee=Z[N],et=ei(0,S[F],Y[F]),en=b?S[F]/2-q-et-J-T.mainAxis:Q-et-J-T.mainAxis,er=b?-S[F]/2+q+et+ee+T.mainAxis:G+et+ee+T.mainAxis,eo=t.elements.arrow&&O(t.elements.arrow),es=eo?"y"===x?eo.clientTop||0:eo.clientLeft||0:0,ea=null!=(L=null==I?void 0:I[x])?L:0,el=ei(f?d(z,B+en-ea-es):z,B,f?c(W,B+er-ea):W);k[x]=el,D[x]=el-B}if(void 0!==o&&o){var eu,ec,ed="x"===x?"top":A,eh="x"===x?E:M,ef=k[w],ep="y"===w?"height":"width",eg=ef+m[ed],em=ef-m[eh],ev=-1!==["top",A].indexOf(v),ey=null!=(ec=null==I?void 0:I[w])?ec:0,eb=ev?eg:ef-S[ep]-C[ep]-ey+T.altAxis,ex=ev?ef+S[ep]+C[ep]-ey-T.altAxis:em,ew=f&&ev?(eu=ei(eb,ef,ex))>ex?ex:eu:ei(f?eb:eg,ef,f?ex:em);k[w]=ew,D[w]=ew-ef}t.modifiersData[r]=D}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=V(n.placement),l=$(a),u=[A,M].indexOf(a)>=0?"height":"width";if(o&&s){var c,d=(c=i.padding,q("number"!=typeof(c="function"==typeof c?c(Object.assign({},n.rects,{placement:n.placement})):c)?c:Q(c,T))),h=_(o),f="y"===l?"top":A,p="y"===l?E:M,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=O(o),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=d[f],x=y-h[u]-d[p],w=y/2-h[u]/2+(g/2-m/2),k=ei(b,w,x);n.modifiersData[r]=((t={})[l]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null==r||("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&F(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=K(t,{elementContext:"reference"}),a=K(t,{altBoundary:!0}),l=eo(s,r),u=eo(a,i,o),c=es(l),d=es(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}).defaultModifiers)?[]:s,u=void 0===(l=o.defaultOptions)?G:l,function(e,i,o){void 0===o&&(o=u);var s,l,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},G,u),modifiersData:{},elements:{reference:e,popper:i},attributes:{},styles:{}},d=[],f=!1,p={state:c,setOptions:function(t){var r,o,s,l,h,f,g="function"==typeof t?t(c.options):t;x(),c.options=Object.assign({},u,c.options,g),c.scrollParents={reference:n(e)?S(e):e.contextElement?S(e.contextElement):[],popper:S(i)};var m=(o=Object.keys(r=[].concat(a,c.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),s=new Map,l=new Set,h=[],o.forEach(function(e){s.set(e.name,e)}),o.forEach(function(e){l.has(e.name)||function e(t){l.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!l.has(t)){var n=s.get(t);n&&e(n)}}),h.push(t)}(e)}),f=h,N.reduce(function(e,t){return e.concat(f.filter(function(e){return e.phase===t}))},[]));return c.orderedModifiers=m.filter(function(e){return e.enabled}),c.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:c,name:t,instance:p,options:void 0===n?{}:n});d.push(i||function(){})}}),p.update()},forceUpdate:function(){if(!f){var e=c.elements,n=e.reference,i=e.popper;if(X(n,i)){c.rects={reference:(o=O(i),s="fixed"===c.options.strategy,a=r(o),x=r(o)&&(u=h((l=o.getBoundingClientRect()).width)/o.offsetWidth||1,d=h(l.height)/o.offsetHeight||1,1!==u||1!==d),k=y(o),S=g(n,x,s),C={scrollLeft:0,scrollTop:0},E={x:0,y:0},(a||!a&&!s)&&(("body"!==v(o)||w(k))&&(C=function(e){return e!==t(e)&&r(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:m(e)}(o)),r(o)?(E=g(o,!0),E.x+=o.clientLeft,E.y+=o.clientTop):k&&(E.x=b(k))),{x:S.left+C.scrollLeft-E.x,y:S.top+C.scrollTop-E.y,width:S.width,height:S.height}),popper:_(i)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(e){return c.modifiersData[e.name]=Object.assign({},e.data)});for(var o,s,a,l,u,d,x,k,S,C,E,M=0;M<c.orderedModifiers.length;M++){if(!0===c.reset){c.reset=!1,M=-1;continue}var A=c.orderedModifiers[M],P=A.fn,T=A.options,R=void 0===T?{}:T,I=A.name;"function"==typeof P&&(c=P({state:c,options:R,name:I,instance:p})||c)}}}},update:(s=function(){return new Promise(function(e){p.forceUpdate(),e(c)})},function(){return l||(l=new Promise(function(e){Promise.resolve().then(function(){l=void 0,e(s())})})),l}),destroy:function(){x(),f=!0}};if(!X(e,i))return p;function x(){d.forEach(function(e){return e()}),d=[]}return p.setOptions(o).then(function(e){!f&&o.onFirstUpdate&&o.onFirstUpdate(e)}),p});e.s(["createPopper",()=>ea],941666)},750724,e=>{"use strict";e.i(316575);var t=e.i(358102),n=e.i(187725),r=e.i(842426),i=e.i(86396),o=e.i(995044),s=e.i(941666),a=e.i(778024),l=e.i(523086),u=e.i(355503),c=e.i(435983),d=e.i(446519);function h(e){return(0,d.default)("MuiPopper",e)}(0,c.default)("MuiPopper",["root"]);var f=e.i(19483);function p(e){return"function"==typeof e?e():e}let g={},m=n.forwardRef(function(e,t){let{anchorEl:r,children:u,direction:c,disablePortal:d,modifiers:g,open:m,placement:v,popperOptions:y,popperRef:b,slotProps:x={},slots:w={},TransitionProps:_,ownerState:k,...S}=e,C=n.useRef(null),O=(0,o.default)(C,t),E=n.useRef(null),M=(0,o.default)(E,b),A=n.useRef(M);(0,i.default)(()=>{A.current=M},[M]),n.useImperativeHandle(b,()=>E.current,[]);let P=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(v,c),[T,R]=n.useState(P),[I,D]=n.useState(p(r));n.useEffect(()=>{E.current&&E.current.forceUpdate()}),n.useEffect(()=>{r&&D(p(r))},[r]),(0,i.default)(()=>{if(!I||!m)return;let e=[{name:"preventOverflow",options:{altBoundary:d}},{name:"flip",options:{altBoundary:d}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:e})=>{R(e.placement)}}];null!=g&&(e=e.concat(g)),y&&null!=y.modifiers&&(e=e.concat(y.modifiers));let t=(0,s.createPopper)(I,C.current,{placement:P,...y,modifiers:e});return A.current(t),()=>{t.destroy(),A.current(null)}},[I,d,g,m,y,P]);let L={placement:T};null!==_&&(L.TransitionProps=_);let j=(e=>{let{classes:t}=e;return(0,a.default)({root:["root"]},h,t)})(e),N=w.root??"div",F=(0,l.default)({elementType:N,externalSlotProps:x.root,externalForwardedProps:S,additionalProps:{role:"tooltip",ref:O},ownerState:e,className:j.root});return(0,f.jsx)(N,{...F,children:"function"==typeof u?u(L):u})}),v=n.forwardRef(function(e,t){let i,{anchorEl:o,children:s,container:a,direction:l="ltr",disablePortal:c=!1,keepMounted:d=!1,modifiers:h,open:v,placement:y="bottom",popperOptions:b=g,popperRef:x,style:w,transition:_=!1,slotProps:k={},slots:S={},...C}=e,[O,E]=n.useState(!0);if(!d&&!v&&(!_||O))return null;if(a)i=a;else if(o){let e=p(o);i=e&&void 0!==e.nodeType?(0,r.default)(e).body:(0,r.default)(null).body}let M=!v&&d&&(!_||O)?"none":void 0,A=_?{in:v,onEnter:()=>{E(!1)},onExited:()=>{E(!0)}}:void 0;return(0,f.jsx)(u.default,{disablePortal:c,container:i,children:(0,f.jsx)(m,{anchorEl:o,direction:l,disablePortal:c,modifiers:h,ref:t,open:_?!O:v,placement:y,popperOptions:b,popperRef:x,slotProps:k,slots:S,...C,style:{position:"fixed",top:0,left:0,display:M,...w},TransitionProps:A,children:s})})});var y=e.i(446547),b=e.i(519273);let x=(0,y.styled)(v,{name:"MuiPopper",slot:"Root"})({}),w=n.forwardRef(function(e,n){let r=(0,t.useRtl)(),{anchorEl:i,component:o,components:s,componentsProps:a,container:l,disablePortal:u,keepMounted:c,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:w,..._}=(0,b.useDefaultProps)({props:e,name:"MuiPopper"}),k=y?.root??s?.Root,S={anchorEl:i,container:l,disablePortal:u,keepMounted:c,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,..._};return(0,f.jsx)(x,{as:o,direction:r?"rtl":"ltr",slots:{root:k},slotProps:w??a,...S,ref:n})});e.s(["default",0,w],750724)},197068,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(143696),i=e.i(778024),o=e.i(358102),s=e.i(387301),a=e.i(272866),l=e.i(446547),u=e.i(811347),c=e.i(73205),d=e.i(519273),h=e.i(578509),f=e.i(401440),p=e.i(750724),g=e.i(134030),m=e.i(723938),v=e.i(909005),y=e.i(623786),b=e.i(577950),x=e.i(435983),w=e.i(446519);function _(e){return(0,w.default)("MuiTooltip",e)}let k=(0,x.default)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);var S=e.i(19483);let C=(0,l.styled)(p.default,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((0,c.default)(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${k.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${k.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${k.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${k.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${k.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${k.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${k.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${k.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),O=(0,l.styled)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,h.default)(n.placement.split("-")[0])}`]]}})((0,c.default)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${k.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${k.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${k.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${k.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Math.round(16/14*1e5)/1e5}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${k.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${k.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),E=(0,l.styled)("span",{name:"MuiTooltip",slot:"Arrow"})((0,c.default)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),M=!1,A=new r.Timeout,P={x:0,y:0};function T(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}let R=t.forwardRef(function(e,l){let c=(0,d.useDefaultProps)({props:e,name:"MuiTooltip"}),{arrow:x=!1,children:w,classes:k,components:R={},componentsProps:I={},describeChild:D=!1,disableFocusListener:L=!1,disableHoverListener:j=!1,disableInteractive:N=!1,disableTouchListener:F=!1,enterDelay:B=100,enterNextDelay:z=0,enterTouchDelay:V=700,followCursor:H=!1,id:$,leaveDelay:W=0,leaveTouchDelay:U=1500,onClose:q,onOpen:Q,open:K,placement:G="bottom",PopperComponent:X,PopperProps:Y={},slotProps:Z={},slots:J={},title:ee,TransitionComponent:et,TransitionProps:en,...er}=c,ei=t.isValidElement(w)?w:(0,S.jsx)("span",{children:w}),eo=(0,u.useTheme)(),es=(0,o.useRtl)(),[ea,el]=t.useState(),[eu,ec]=t.useState(null),ed=t.useRef(!1),eh=N||H,ef=(0,r.default)(),ep=(0,r.default)(),eg=(0,r.default)(),em=(0,r.default)(),[ev,ey]=(0,y.default)({controlled:K,default:!1,name:"Tooltip",state:"open"}),eb=ev,ex=(0,v.default)($),ew=t.useRef(),e_=(0,g.default)(()=>{void 0!==ew.current&&(document.body.style.WebkitUserSelect=ew.current,ew.current=void 0),em.clear()});t.useEffect(()=>e_,[e_]);let ek=e=>{A.clear(),M=!0,ey(!0),Q&&!eb&&Q(e)},eS=(0,g.default)(e=>{A.start(800+W,()=>{M=!1}),ey(!1),q&&eb&&q(e),ef.start(eo.transitions.duration.shortest,()=>{ed.current=!1})}),eC=e=>{ed.current&&"touchstart"!==e.type||(ea&&ea.removeAttribute("title"),ep.clear(),eg.clear(),B||M&&z?ep.start(M?z:B,()=>{ek(e)}):ek(e))},eO=e=>{ep.clear(),eg.start(W,()=>{eS(e)})},[,eE]=t.useState(!1),eM=e=>{(0,s.default)(e.target)||(eE(!1),eO(e))},eA=e=>{ea||el(e.currentTarget),(0,s.default)(e.target)&&(eE(!0),eC(e))},eP=e=>{ed.current=!0;let t=ei.props;t.onTouchStart&&t.onTouchStart(e)};t.useEffect(()=>{if(eb)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&eS(e)}},[eS,eb]);let eT=(0,m.default)((0,a.default)(ei),el,l);ee||0===ee||(eb=!1);let eR=t.useRef(),eI={},eD="string"==typeof ee;D?(eI.title=eb||!eD||j?null:ee,eI["aria-describedby"]=eb?ex:null):(eI["aria-label"]=eD?ee:null,eI["aria-labelledby"]=eb&&!eD?ex:null);let eL={...eI,...er,...ei.props,className:(0,n.default)(er.className,ei.props.className),onTouchStart:eP,ref:eT,...H?{onMouseMove:e=>{let t=ei.props;t.onMouseMove&&t.onMouseMove(e),P={x:e.clientX,y:e.clientY},eR.current&&eR.current.update()}}:{}},ej={};F||(eL.onTouchStart=e=>{eP(e),eg.clear(),ef.clear(),e_(),ew.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",em.start(V,()=>{document.body.style.WebkitUserSelect=ew.current,eC(e)})},eL.onTouchEnd=e=>{ei.props.onTouchEnd&&ei.props.onTouchEnd(e),e_(),eg.start(U,()=>{eS(e)})}),!j&&(eL.onMouseOver=T(eC,eL.onMouseOver),eL.onMouseLeave=T(eO,eL.onMouseLeave),eh||(ej.onMouseOver=eC,ej.onMouseLeave=eO)),!L&&(eL.onFocus=T(eA,eL.onFocus),eL.onBlur=T(eM,eL.onBlur),eh||(ej.onFocus=eA,ej.onBlur=eM));let eN={...c,isRtl:es,arrow:x,disableInteractive:eh,placement:G,PopperComponentProp:X,touch:ed.current},eF="function"==typeof Z.popper?Z.popper(eN):Z.popper,eB=t.useMemo(()=>{let e=[{name:"arrow",enabled:!!eu,options:{element:eu,padding:4}}];return Y.popperOptions?.modifiers&&(e=e.concat(Y.popperOptions.modifiers)),eF?.popperOptions?.modifiers&&(e=e.concat(eF.popperOptions.modifiers)),{...Y.popperOptions,...eF?.popperOptions,modifiers:e}},[eu,Y.popperOptions,eF?.popperOptions]),ez=(e=>{let{classes:t,disableInteractive:n,arrow:r,touch:o,placement:s}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${(0,h.default)(s.split("-")[0])}`],arrow:["arrow"]};return(0,i.default)(a,_,t)})(eN),eV="function"==typeof Z.transition?Z.transition(eN):Z.transition,eH={slots:{popper:R.Popper,transition:R.Transition??et,tooltip:R.Tooltip,arrow:R.Arrow,...J},slotProps:{arrow:Z.arrow??I.arrow,popper:{...Y,...eF??I.popper},tooltip:Z.tooltip??I.tooltip,transition:{...en,...eV??I.transition}}},[e$,eW]=(0,b.default)("popper",{elementType:C,externalForwardedProps:eH,ownerState:eN,className:(0,n.default)(ez.popper,Y?.className)}),[eU,eq]=(0,b.default)("transition",{elementType:f.default,externalForwardedProps:eH,ownerState:eN}),[eQ,eK]=(0,b.default)("tooltip",{elementType:O,className:ez.tooltip,externalForwardedProps:eH,ownerState:eN}),[eG,eX]=(0,b.default)("arrow",{elementType:E,className:ez.arrow,externalForwardedProps:eH,ownerState:eN,ref:ec});return(0,S.jsxs)(t.Fragment,{children:[t.cloneElement(ei,eL),(0,S.jsx)(e$,{as:X??p.default,placement:G,anchorEl:H?{getBoundingClientRect:()=>({top:P.y,left:P.x,right:P.x,bottom:P.y,width:0,height:0})}:ea,popperRef:eR,open:!!ea&&eb,id:ex,transition:!0,...ej,...eW,popperOptions:eB,children:({TransitionProps:e})=>(0,S.jsx)(eU,{timeout:eo.transitions.duration.shorter,...e,...eq,children:(0,S.jsxs)(eQ,{...eK,children:[ee,x?(0,S.jsx)(eG,{...eX}):null]})})})]})});e.s(["default",0,R],197068)},351853,(e,t,n)=>{var r=0/0,i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,u=e.g&&e.g.Object===Object&&e.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")(),h=Object.prototype.toString,f=Math.max,p=Math.min,g=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==h.call(t))return r;if(m(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=m(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var u=s.test(e);return u||a.test(e)?l(e.slice(2),u?2:8):o.test(e)?r:+e}t.exports=function(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function b(e){var n=e-l,r=e-u;return void 0===l||n>=t||n<0||d&&r>=o}function x(){var e,n,r,i=g();if(b(i))return w(i);a=setTimeout(x,(e=i-l,n=i-u,r=t-e,d?p(r,o-n):r))}function w(e){return(a=void 0,h&&r)?y(e):(r=i=void 0,s)}function _(){var e,n=g(),o=b(n);if(r=arguments,i=this,l=n,o){if(void 0===a)return u=e=l,a=setTimeout(x,t),c?y(e):s;if(d)return a=setTimeout(x,t),y(l)}return void 0===a&&(a=setTimeout(x,t)),s}return t=v(t)||0,m(n)&&(c=!!n.leading,o=(d="maxWait"in n)?f(v(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},_.flush=function(){return void 0===a?s:w(g())},_}},536925,e=>{"use strict";var t=e.i(187725);e.i(351853);var n="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function r(){let[e,n]=(0,t.useState)(null);return[e,(0,t.useCallback)(async e=>{if(!(null==navigator?void 0:navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),n(e),!0}catch(e){return console.warn("Copy failed",e),n(null),!1}},[])]}function i(e,r){let i=(0,t.useRef)(e);n(()=>{i.current=e},[e]),(0,t.useEffect)(()=>{if(null===r)return;let e=setInterval(()=>{i.current()},r);return()=>{clearInterval(e)}},[r])}e.s(["useCopyToClipboard",()=>r,"useInterval",()=>i])},605740,285297,359761,840908,72039,622670,848148,146459,652058,830055,490395,603634,130115,e=>{"use strict";var t=e.i(231076),n=e.i(19483),r=e.i(861729),i=e.i(978987),o=e.i(392399),s=e.i(324066),a=e.i(197068),l=e.i(427938),u=e.i(73371),c=e.i(187725),d=e.i(388797),h=e.i(536925),f=e.i(960247);let p=({value:e,colorPalette:t,grayOut:r,noCopy:i,fontSize:o})=>{let[a,l]=(0,c.useState)(!1),u=f.colors[t][800],d=f.colors[t][100];return(0,n.jsxs)(s.default,{sx:{display:"flex",p:"2px 5px",minWidth:"30px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",color:u,bgcolor:d,alignItems:"center",gap:"2px",borderRadius:"8px",fontSize:o,flexShrink:i?0:"inherit"},onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},children:[(0,n.jsx)(s.default,{sx:{overflow:"hidden",textOverflow:"ellipsis",color:r?"gray":"inherit"},children:e}),(0,n.jsx)(g,{value:e,noCopy:i,grayOut:r,isHovered:a})]})};function g({value:e,noCopy:t,grayOut:r,isHovered:i}){let[o,s]=(0,h.useCopyToClipboard)();return t||r?(0,n.jsx)(n.Fragment,{}):o?(0,n.jsx)(n.Fragment,{children:"Copied"}):i?(0,n.jsx)(u.default,{"aria-label":"Copy",size:"small",onClick:()=>s(e),sx:{minWidth:"10px",height:"10px",display:"flex",alignItems:"center",justifyContent:"center",p:0},children:(0,n.jsx)(d.PiCopy,{size:"10px"})}):(0,n.jsx)(n.Fragment,{})}e.s(["DiffText",0,p],285297);var m=e.i(882244);let v=({row:e,column:t})=>{let{columnType:r,columnRenderMode:i}=t,o=`base__${t.key}`.toLowerCase(),u=`current__${t.key}`.toLowerCase();if(!Object.hasOwn(e,o)&&!Object.hasOwn(e,u))return"-";let c=Object.hasOwn(e,o),d=Object.hasOwn(e,u),[h,f]=(0,m.toRenderedValue)(e,`base__${t.key}`.toLowerCase(),r,i),[g,v]=(0,m.toRenderedValue)(e,`current__${t.key}`.toLowerCase(),r,i);if(e[o]===e[u])return(0,n.jsx)(l.default,{component:"span",style:{color:v?"gray":"inherit"},children:g});if("delta"===i&&("number"===r||"integer"===r)&&c&&d){let t=y(e[o]),r=y(e[u]);if(Number.isFinite(t)&&Number.isFinite(r)){let e=r-t,i=0!==t?e/t*100:0,o=(0,m.formatSmartDecimal)(r),u=(0,m.formatSmartDecimal)(e),c=`(${e>=0?"+":""}${u})`,d=`Base: ${t}
3
+ Current: ${r}
4
+ Change: ${e>=0?"+":""}${e} (${i>=0?"+":""}${i.toFixed(2)}%)`;return(0,n.jsx)(a.default,{title:d,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},enterDelay:300,placement:"top",children:(0,n.jsxs)(s.default,{gap:"5px",alignItems:"center",lineHeight:"normal",height:"100%",children:[(0,n.jsx)(p,{value:o,colorPalette:"green",grayOut:v}),(0,n.jsx)(l.default,{fontSize:"0.75rem",color:e>=0?"green.600":"red.600",children:c})]})})}}return(0,n.jsxs)(s.default,{sx:{display:"flex",gap:"5px",alignItems:"center",lineHeight:"normal",height:"100%"},children:[c&&(0,n.jsx)(p,{value:h,colorPalette:"red",grayOut:f}),d&&(0,n.jsx)(p,{value:g,colorPalette:"green",grayOut:v})]})};function y(e){if("number"==typeof e)return e;if("string"==typeof e){let t=parseFloat(e);return Number.isNaN(t)?0:t}return 0}var b=e.i(228337),x=e.i(316245);function w(e,t,n){let r="function"==typeof e.colSpan?e.colSpan(n):1;if(Number.isInteger(r)&&r>1&&(!e.frozen||e.idx+r-1<=t))return r}function _(e){e.stopPropagation()}function k(e,t="instant"){e?.scrollIntoView({inline:"nearest",block:"nearest",behavior:t})}function S(e){let t=!1,n={...e,preventGridDefault(){t=!0},isGridDefaultPrevented:()=>t};return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}let C=new Set(["Unidentified","Alt","AltGraph","CapsLock","Control","Fn","FnLock","Meta","NumLock","ScrollLock","Shift","Tab","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp","Insert","ContextMenu","Escape","Pause","Play","PrintScreen","F1","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]);function O(e){return(e.ctrlKey||e.metaKey)&&"Control"!==e.key}function E(e){let t="rtl"===e;return{leftKey:t?"ArrowRight":"ArrowLeft",rightKey:t?"ArrowLeft":"ArrowRight"}}function M(e,t){return null!=e.renderEditCell&&("function"==typeof e.editable?e.editable(t):e.editable)!==!1}let A="rdg-cell cj343x07-0-0-beta-58";function P(e){return{"--rdg-grid-row-start":e}}function T(e,t,n){let r=t+1,i=`calc(${n-1} * var(--rdg-header-row-height))`;return void 0===e.parent?{insetBlockStart:0,gridRowStart:1,gridRowEnd:r,paddingBlockStart:i}:{insetBlockStart:`calc(${t-n} * var(--rdg-header-row-height))`,gridRowStart:r-n,gridRowEnd:r,paddingBlockStart:i}}function R(e,t=1){let n=e.idx+1;return{gridColumnStart:n,gridColumnEnd:n+t,insetInlineStart:e.frozen?`var(--rdg-frozen-left-${e.idx})`:void 0}}function I(...e){let t="";for(let n of e)if(n){if("string"==typeof n)t+=` ${n}`;else if("object"==typeof n)for(let e in n)n[e]&&(t+=` ${e}`)}return t.trimStart()}function D(e,...t){return I(A,{"rdg-cell-frozen csofj7r7-0-0-beta-58":e.frozen},...t)}let{min:L,max:j,floor:N,sign:F,abs:B}=Math;function z(e){if("function"!=typeof e)throw Error("Please specify the rowKeyGetter prop to use selection")}function V(e,{minWidth:t,maxWidth:n}){return(e=j(e,t),"number"==typeof n&&n>=t)?L(e,n):e}function H(e,t){return void 0===e.parent?t:e.level-e.parent.level}function $({onChange:e,indeterminate:t,...r}){return(0,n.jsx)("input",{ref:e=>{e&&(e.indeterminate=!0===t)},type:"checkbox",className:"rdg-checkbox-input c1bn88vv7-0-0-beta-58",onChange:function(t){e(t.target.checked,t.nativeEvent.shiftKey)},...r})}function W(e){try{return e.row[e.column.key]}catch{return null}}let U=(0,c.createContext)(void 0);function q(){return(0,c.useContext)(U)}let Q=(0,c.createContext)(void 0),K=(0,c.createContext)(void 0),G=(0,c.createContext)(void 0),X=(0,c.createContext)(void 0),Y="rdg-select-column";function Z({column:e,sortDirection:t,priority:r}){return e.sortable?(0,n.jsx)(J,{sortDirection:t,priority:r,children:e.name}):e.name}function J({sortDirection:e,priority:t,children:r}){let i=q().renderSortStatus;return(0,n.jsxs)("span",{className:"h44jtk67-0-0-beta-58",children:[(0,n.jsx)("span",{className:"rdg-header-sort-name hcgkhxz7-0-0-beta-58",children:r}),(0,n.jsx)("span",{children:i({sortDirection:e,priority:t})})]})}function ee(e,t){let n=`[data-measuring-cell-key="${CSS.escape(t)}"]`,r=e.current?.querySelector(n);return r?.getBoundingClientRect().width}function et(e){let t=(0,c.useRef)(e);(0,c.useLayoutEffect)(()=>{t.current=e});let n=(0,c.useCallback)((...e)=>{t.current(...e)},[]);return e?n:e}function en(e){let[t,n]=(0,c.useState)(!1);return t&&!e&&n(!1),{tabIndex:e&&!t?0:-1,childTabIndex:e?0:-1,onFocus:e?function(e){if(e.target===e.currentTarget){let t=e.currentTarget.querySelector('[tabindex="0"]');null!==t?(t.focus({preventScroll:!0}),n(!0)):n(!1)}else n(!0)}:void 0}}let er=(0,c.memo)(function({column:e,colSpan:t,isCellSelected:r,isDraggedOver:i,row:o,rowIdx:s,className:a,onMouseDown:l,onCellMouseDown:u,onClick:c,onCellClick:d,onDoubleClick:h,onCellDoubleClick:f,onContextMenu:p,onCellContextMenu:g,onRowChange:m,selectCell:v,style:y,...b}){let{tabIndex:x,childTabIndex:w,onFocus:_}=en(r),{cellClass:k}=e;a=D(e,{"rdg-cell-dragged-over c6ra8a37-0-0-beta-58":i},"function"==typeof k?k(o):k,a);let C=M(e,o);function O(t){v({rowIdx:s,idx:e.idx},{enableEditor:t})}function E(t,n){let r=!1;if(n){let i=S(t);n({rowIdx:s,row:o,column:e,selectCell:O},i),r=i.isGridDefaultPrevented()}return r}return(0,n.jsx)("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":r,"aria-readonly":!C||void 0,tabIndex:x,className:a,style:{...R(e,t),...y},onClick:function(e){c?.(e),E(e,d)},onMouseDown:function(e){l?.(e),E(e,u)||O()},onDoubleClick:function(e){h?.(e),E(e,f)||O(!0)},onContextMenu:function(e){p?.(e),E(e,g)},onFocus:_,...b,children:e.renderCell({column:e,row:o,rowIdx:s,isCellEditable:C,tabIndex:w,onRowChange:function(t){m(e,t)}})})});function ei(e,t){return(0,n.jsx)(er,{...t},e)}let eo="object"==typeof scheduler&&"function"==typeof scheduler.postTask;function es({column:e,colSpan:t,row:r,rowIdx:i,onRowChange:o,closeEditor:s,onKeyDown:a,navigate:l}){let u=(0,c.useRef)(void 0),d=(0,c.useRef)(void 0),h=(0,c.useRef)(void 0),f=e.editorOptions?.commitOnOutsideClick??!0,p=(0,c.useEffectEvent)(()=>{m(!0,!1)});function g(){u.current=void 0,void 0!==d.current&&(d.current.abort(),d.current=void 0),void 0!==h.current&&(cancelAnimationFrame(h.current),h.current=void 0)}function m(e=!1,t=!0){e?o(r,!0,t):s(t)}function v(e,t=!1){o(e,t,t)}(0,c.useLayoutEffect)(()=>{if(f)return addEventListener("mousedown",e,{capture:!0}),addEventListener("mousedown",t),()=>{removeEventListener("mousedown",e,{capture:!0}),removeEventListener("mousedown",t),g()};function e(e){if(u.current=e,eo){let e=new AbortController,{signal:t}=e;d.current=e,scheduler.postTask(p,{priority:"user-blocking",signal:t}).catch(()=>{})}else h.current=requestAnimationFrame(p)}function t(e){u.current===e&&p()}},[f]);let{cellClass:y}=e,b=D(e,"rdg-editor-container",!e.editorOptions?.displayCellContent&&"cis5rrm7-0-0-beta-58","function"==typeof y?y(r):y);return(0,n.jsx)("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":!0,className:b,style:R(e,t),onKeyDown:function(t){if(a){let n=S(t);if(a({mode:"EDIT",row:r,column:e,rowIdx:i,navigate(){l(t)},onClose:m},n),n.isGridDefaultPrevented())return}"Escape"===t.key?m():"Enter"===t.key?m(!0):function({key:e,target:t}){return!!("Tab"===e&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement))&&t.closest(".rdg-editor-container")?.querySelectorAll("input, textarea, select").length===1}(t)&&l(t)},onMouseDownCapture:g,children:null!=e.renderEditCell&&(0,n.jsxs)(n.Fragment,{children:[e.renderEditCell({column:e,row:r,rowIdx:i,onRowChange:v,onClose:m}),e.editorOptions?.displayCellContent&&e.renderCell({column:e,row:r,rowIdx:i,isCellEditable:!0,tabIndex:-1,onRowChange:v})]})})}function ea({column:e,rowIdx:t,isCellSelected:r,selectCell:i}){let{tabIndex:o,onFocus:s}=en(r),{colSpan:a}=e,l=H(e,t),u=e.idx+1;return(0,n.jsx)("div",{role:"columnheader","aria-colindex":u,"aria-colspan":a,"aria-rowspan":l,"aria-selected":r,tabIndex:o,className:I(A,e.headerCellClass),style:{...T(e,t,l),gridColumnStart:u,gridColumnEnd:u+a},onFocus:s,onMouseDown:function(){i({idx:e.idx,rowIdx:t})},children:e.name})}function el({column:e,colSpan:t,rowIdx:r,isCellSelected:i,onColumnResize:o,onColumnResizeEnd:s,onColumnsReorder:a,sortColumns:l,onSortColumnsChange:u,selectCell:d,shouldFocusGrid:h,direction:f,draggedColumnKey:p,setDraggedColumnKey:g}){let m,v,[y,b]=(0,c.useState)(!1),w=(0,c.useRef)(null),_=p===e.key,k=H(e,r),{tabIndex:S,childTabIndex:C,onFocus:M}=en(h||i),A=l?.findIndex(t=>t.columnKey===e.key),P=void 0!==A&&A>-1?l[A]:void 0,I=P?.direction,L=void 0!==P&&l.length>1?A+1:void 0,j=I&&!L?"ASC"===I?"ascending":"descending":void 0,{sortable:N,resizable:F,draggable:B}=e,z=D(e,e.headerCellClass,{"c6l2wv17-0-0-beta-58":N,"rdg-cell-resizable c1kqdw7y7-0-0-beta-58":F,"rdg-cell-draggable":B,"rdg-cell-dragging c1bezg5o7-0-0-beta-58":_,"rdg-cell-drag-over c1vc96037-0-0-beta-58":y});function $(t){if(null==u)return;let{sortDescendingFirst:n}=e;if(void 0===P){let r={columnKey:e.key,direction:n?"DESC":"ASC"};u(l&&t?[...l,r]:[r])}else{let r;if((!0===n&&"DESC"===I||!0!==n&&"ASC"===I)&&(r={columnKey:e.key,direction:"ASC"===I?"DESC":"ASC"}),t){let e=[...l];r?e[A]=r:e.splice(A,1),u(e)}else u(r?[r]:[])}}B&&(m={draggable:!0,onDragStart:function(t){(0,x.flushSync)(()=>{g(e.key)}),t.dataTransfer.setDragImage(w.current,0,0),t.dataTransfer.dropEffect="move"},onDragEnd:function(){g(void 0)}},void 0!==p&&p!==e.key&&(v={onDragOver:function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"},onDragEnter:function(e){ec(e)&&b(!0)},onDragLeave:function(e){ec(e)&&b(!1)},onDrop:function(t){b(!1),t.preventDefault(),a?.(p,e.key)}}));let W={...T(e,r,k),...R(e,t)},U=e.renderHeaderCell({column:e,sortDirection:I,priority:L,tabIndex:C});return(0,n.jsxs)(n.Fragment,{children:[_&&(0,n.jsx)("div",{ref:w,style:W,className:D(e,e.headerCellClass,"d8rwc9w7-0-0-beta-58"),children:U}),(0,n.jsxs)("div",{role:"columnheader","aria-colindex":e.idx+1,"aria-colspan":t,"aria-rowspan":k,"aria-selected":i,"aria-sort":j,tabIndex:S,className:z,style:W,onMouseDown:function(){d({idx:e.idx,rowIdx:r})},onFocus:function(e){M?.(e),h&&d({idx:0,rowIdx:r})},onClick:function(e){N&&$(e.ctrlKey||e.metaKey)},onKeyDown:function(t){let{key:n}=t;if(N&&(" "===n||"Enter"===n))t.preventDefault(),$(t.ctrlKey||t.metaKey);else if(F&&O(t)&&("ArrowLeft"===n||"ArrowRight"===n)){t.stopPropagation();let{width:r}=t.currentTarget.getBoundingClientRect(),{leftKey:i}=E(f),s=V(r+(n===i?-10:10),e);s!==r&&o(e,s)}},...m,...v,children:[U,F&&(0,n.jsx)(eu,{direction:f,column:e,onColumnResize:o,onColumnResizeEnd:s})]})]})}function eu({direction:e,column:t,onColumnResize:r,onColumnResizeEnd:i}){let o=(0,c.useRef)(void 0),s="rtl"===e;return(0,n.jsx)("div",{"aria-hidden":!0,className:"rdg-resize-handle r1y6ywlx7-0-0-beta-58",onClick:_,onPointerDown:function(e){if("mouse"===e.pointerType&&1!==e.buttons)return;e.preventDefault();let{currentTarget:t,pointerId:n}=e;t.setPointerCapture(n);let{right:r,left:i}=t.parentElement.getBoundingClientRect();o.current=s?e.clientX-i:r-e.clientX},onPointerMove:function(e){let n=o.current;if(void 0===n)return;let{width:i,right:a,left:l}=e.currentTarget.parentElement.getBoundingClientRect(),u=s?a+n-e.clientX:e.clientX+n-l;u=V(u,t),i>0&&u!==i&&r(t,u)},onLostPointerCapture:function(){i(),o.current=void 0},onDoubleClick:function(){r(t,"max-content")}})}function ec(e){let t=e.relatedTarget;return!e.currentTarget.contains(t)}let ed="rdg-row r1upfr807-0-0-beta-58",eh="rdg-row-selected",ef="rdg-header-row h10tskcx7-0-0-beta-58";var ep=(0,c.memo)(function({headerRowClass:e,rowIdx:t,columns:r,onColumnResize:i,onColumnResizeEnd:o,onColumnsReorder:s,sortColumns:a,onSortColumnsChange:l,lastFrozenColumnIndex:u,selectedCellIdx:d,selectCell:h,shouldFocusGrid:f,direction:p}){let[g,m]=(0,c.useState)(),v=[];for(let e=0;e<r.length;e++){let c=r[e],y=w(c,u,{type:"HEADER"});void 0!==y&&(e+=y-1),v.push((0,n.jsx)(el,{column:c,colSpan:y,rowIdx:t,isCellSelected:d===c.idx,onColumnResize:i,onColumnResizeEnd:o,onColumnsReorder:s,onSortColumnsChange:l,sortColumns:a,selectCell:h,shouldFocusGrid:f&&0===e,direction:p,draggedColumnKey:g,setDraggedColumnKey:m},c.key))}return(0,n.jsx)("div",{role:"row","aria-rowindex":t,className:I(ef,{[eh]:-1===d},e),children:v})}),eg=(0,c.memo)(function({rowIdx:e,level:t,columns:r,selectedCellIdx:i,selectCell:o}){let s=[],a=new Set;for(let l of r){let{parent:r}=l;if(void 0!==r){for(;r.level>t&&void 0!==r.parent;)r=r.parent;if(r.level===t&&!a.has(r)){a.add(r);let{idx:t}=r;s.push((0,n.jsx)(ea,{column:r,rowIdx:e,isCellSelected:i===t,selectCell:o},t))}}}return(0,n.jsx)("div",{role:"row","aria-rowindex":e,className:ef,children:s})});let em=(0,c.memo)(function({className:e,rowIdx:t,gridRowStart:r,selectedCellIdx:i,isRowSelectionDisabled:o,isRowSelected:s,draggedOverCellIdx:a,lastFrozenColumnIndex:l,row:u,viewportColumns:d,selectedCellEditor:h,onCellMouseDown:f,onCellClick:p,onCellDoubleClick:g,onCellContextMenu:m,rowClass:v,onRowChange:y,selectCell:b,style:x,..._}){let k=q().renderCell,S=et((e,n)=>{y(e,t,n)});e=I(ed,`rdg-row-${t%2==0?"even":"odd"}`,{[eh]:-1===i},v?.(u,t),e);let C=[];for(let e=0;e<d.length;e++){let n=d[e],{idx:r}=n,o=w(n,l,{type:"ROW",row:u});void 0!==o&&(e+=o-1);let s=i===r;s&&h?C.push(h):C.push(k(n.key,{column:n,colSpan:o,row:u,rowIdx:t,isDraggedOver:a===r,isCellSelected:s,onCellMouseDown:f,onCellClick:p,onCellDoubleClick:g,onCellContextMenu:m,onRowChange:S,selectCell:b}))}let O=(0,c.useMemo)(()=>({isRowSelected:s,isRowSelectionDisabled:o}),[o,s]);return(0,n.jsx)(Q,{value:O,children:(0,n.jsx)("div",{role:"row",className:e,style:{...P(r),...x},..._,children:C})})});function ev(e,t){return(0,n.jsx)(em,{...t},e)}function ey({scrollToPosition:{idx:e,rowIdx:t},gridRef:r,setScrollToCellPosition:i}){let o=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{k(o.current,"auto")}),(0,c.useLayoutEffect)(()=>{let e=new IntersectionObserver(function(){i(null)},{root:r.current,threshold:1});return e.observe(o.current),()=>{e.disconnect()}},[r,i]),(0,n.jsx)("div",{ref:o,style:{gridColumn:void 0===e?"1/-1":e+1,gridRow:void 0===t?"1/-1":t+2}})}function eb({sortDirection:e,priority:t}){return(0,n.jsxs)(n.Fragment,{children:[function({sortDirection:e}){return void 0===e?null:(0,n.jsx)("svg",{viewBox:"0 0 12 8",width:"12",height:"8",className:"rdg-sort-arrow a3ejtar7-0-0-beta-58","aria-hidden":!0,children:(0,n.jsx)("path",{d:"ASC"===e?"M0 8 6 0 12 8":"M0 0 6 8 12 0"})})}({sortDirection:e}),function({priority:e}){return e}({priority:t})]})}var ex=(0,c.memo)(function({column:e,colSpan:t,row:r,rowIdx:i,isCellSelected:o,selectCell:s}){let{tabIndex:a,childTabIndex:l,onFocus:u}=en(o),{summaryCellClass:c}=e,d=D(e,"s8wc6fl7-0-0-beta-58","function"==typeof c?c(r):c);return(0,n.jsx)("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":o,tabIndex:a,className:d,style:R(e,t),onMouseDown:function(){s({rowIdx:i,idx:e.idx})},onFocus:u,children:e.renderSummaryCell?.({column:e,row:r,tabIndex:l})})}),ew=(0,c.memo)(function({rowIdx:e,gridRowStart:t,row:r,viewportColumns:i,top:o,bottom:s,lastFrozenColumnIndex:a,selectedCellIdx:l,isTop:u,selectCell:c,"aria-rowindex":d}){let h=[];for(let t=0;t<i.length;t++){let o=i[t],s=w(o,a,{type:"SUMMARY",row:r});void 0!==s&&(t+=s-1);let u=l===o.idx;h.push((0,n.jsx)(ex,{column:o,colSpan:s,row:r,rowIdx:e,isCellSelected:u,selectCell:c},o.key))}return(0,n.jsx)("div",{role:"row","aria-rowindex":d,className:I(ed,`rdg-row-${e%2==0?"even":"odd"}`,"rdg-summary-row skuhp557-0-0-beta-58",{[eh]:-1===l,"rdg-top-summary-row tf8l5ub7-0-0-beta-58":u,"rdg-bottom-summary-row":!u}),style:{...P(t),"--rdg-summary-row-top":void 0!==o?`${o}px`:void 0,"--rdg-summary-row-bottom":void 0!==s?`${s}px`:void 0},children:h})});function e_(e){let{ref:t,columns:r,rows:i,topSummaryRows:o,bottomSummaryRows:s,rowKeyGetter:a,onRowsChange:l,rowHeight:u,headerRowHeight:d,summaryRowHeight:h,columnWidths:f,onColumnWidthsChange:p,selectedRows:g,isRowSelectionDisabled:m,onSelectedRowsChange:v,sortColumns:y,onSortColumnsChange:b,defaultColumnOptions:_,onCellMouseDown:A,onCellClick:P,onCellDoubleClick:T,onCellContextMenu:D,onCellKeyDown:H,onSelectedCellChange:Q,onScroll:J,onColumnResize:en,onColumnsReorder:er,onFill:eo,onCellCopy:ea,onCellPaste:el,enableVirtualization:eu,renderers:ec,className:ed,style:eh,rowClass:ef,headerRowClass:em,direction:ex,role:e_,"aria-label":eC,"aria-labelledby":eO,"aria-description":eE,"aria-describedby":eM,"aria-rowcount":eA,"data-testid":eP,"data-cy":eT}=e,eR=q(),eI=e_??"grid",eD=u??35,eL=d??("number"==typeof eD?eD:35),ej=h??("number"==typeof eD?eD:35),eN=ec?.renderRow??eR?.renderRow??ev,eF=ec?.renderCell??eR?.renderCell??ei,eB=ec?.renderSortStatus??eR?.renderSortStatus??eb,ez=ec?.renderCheckbox??eR?.renderCheckbox??$,eV=ec?.noRowsFallback??eR?.noRowsFallback,eH=eu??!0,e$=ex??"ltr",[eW,eU]=(0,c.useState)(0),[eq,eQ]=(0,c.useState)(0),[eK,eG]=(0,c.useState)(()=>f??new Map),[eX,eY]=(0,c.useState)(!1),[eZ,eJ]=(0,c.useState)(!1),[e0,e1]=(0,c.useState)(void 0),[e2,e5]=(0,c.useState)(null),[e3,e4]=(0,c.useState)(!1),[e8,e6]=(0,c.useState)(-1),e7=null!=f&&null!=p&&!eX,e9=e7?f:eK,te=e7?e=>{eG(e),p(e)}:eG,tt=(0,c.useCallback)(e=>e9.get(e.key)?.width??e.width,[e9]),[tn,tr,ti,to]=function(){let e=(0,c.useRef)(null),[t,n]=(0,c.useState)(1),[r,i]=(0,c.useState)(1),[o,s]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{let{ResizeObserver:t}=window;if(null==t)return;let{clientWidth:r,clientHeight:o,offsetWidth:a,offsetHeight:l}=e.current,{width:u,height:c}=e.current.getBoundingClientRect(),d=l-o;n(u-a+r),i(c-d),s(d);let h=new t(t=>{let r=t[0].contentBoxSize[0],{clientHeight:o,offsetHeight:a}=e.current;(0,x.flushSync)(()=>{n(r.inlineSize),i(r.blockSize),s(a-o)})});return h.observe(e.current),()=>{h.disconnect()}},[]),[e,t,r,o]}(),{columns:ts,colSpanColumns:ta,lastFrozenColumnIndex:tl,headerRowsCount:tu,colOverscanStartIdx:tc,colOverscanEndIdx:td,templateColumns:th,layoutCssVars:tf,totalFrozenColumnWidth:tp}=function({rawColumns:e,defaultColumnOptions:t,getColumnWidth:n,viewportWidth:r,scrollLeft:i,enableVirtualization:o}){let s=t?.width??"auto",a=t?.minWidth??50,l=t?.maxWidth??void 0,u=t?.renderCell??W,d=t?.renderHeaderCell??Z,h=t?.sortable??!1,f=t?.resizable??!1,p=t?.draggable??!1,{columns:g,colSpanColumns:m,lastFrozenColumnIndex:v,headerRowsCount:y}=(0,c.useMemo)(()=>{let t=-1,n=1,r=[];!function e(i,o,c){for(let g of i){if("children"in g){let t={name:g.name,parent:c,idx:-1,colSpan:0,level:0,headerCellClass:g.headerCellClass};e(g.children,o+1,t);continue}let i=g.frozen??!1,m={...g,parent:c,idx:0,level:0,frozen:i,width:g.width??s,minWidth:g.minWidth??a,maxWidth:g.maxWidth??l,sortable:g.sortable??h,resizable:g.resizable??f,draggable:g.draggable??p,renderCell:g.renderCell??u,renderHeaderCell:g.renderHeaderCell??d};r.push(m),i&&t++,o>n&&(n=o)}}(e,1),r.sort(({key:e,frozen:t},{key:n,frozen:r})=>e===Y?-1:n===Y?1:t?r?0:-1:+!!r);let i=[];return r.forEach((e,t)=>{e.idx=t,function e(t,n,r){if(r<t.level&&(t.level=r),void 0!==t.parent){let{parent:i}=t;-1===i.idx&&(i.idx=n),i.colSpan+=1,e(i,n,r-1)}}(e,t,0),null!=e.colSpan&&i.push(e)}),{columns:r,colSpanColumns:i,lastFrozenColumnIndex:t,headerRowsCount:n}},[e,s,a,l,u,d,f,h,p]),{templateColumns:b,layoutCssVars:x,totalFrozenColumnWidth:w,columnMetrics:_}=(0,c.useMemo)(()=>{let e=new Map,t=0,r=0,i=[];for(let r of g){let o=n(r);o="number"==typeof o?V(o,r):r.minWidth,i.push(`${o}px`),e.set(r,{width:o,left:t}),t+=o}if(-1!==v){let t=e.get(g[v]);r=t.left+t.width}let o={};for(let t=0;t<=v;t++){let n=g[t];o[`--rdg-frozen-left-${n.idx}`]=`${e.get(n).left}px`}return{templateColumns:i,layoutCssVars:o,totalFrozenColumnWidth:r,columnMetrics:e}},[n,g,v]),[k,S]=(0,c.useMemo)(()=>{if(!o)return[0,g.length-1];let e=i+w,t=i+r,n=g.length-1,s=L(v+1,n);if(e>=t)return[s,s];let a=s;for(;a<n;){let{left:t,width:n}=_.get(g[a]);if(t+n>e)break;a++}let l=a;for(;l<n;){let{left:e,width:n}=_.get(g[l]);if(e+n>=t)break;l++}return[j(s,a-1),L(n,l+1)]},[_,g,v,i,w,r,o]);return{columns:g,colSpanColumns:m,colOverscanStartIdx:k,colOverscanEndIdx:S,templateColumns:b,layoutCssVars:x,headerRowsCount:y,lastFrozenColumnIndex:v,totalFrozenColumnWidth:w}}({rawColumns:r,defaultColumnOptions:_,getColumnWidth:tt,scrollLeft:eq,viewportWidth:tr,enableVirtualization:eH}),tg=o?.length??0,tm=s?.length??0,tv=tg+tm,ty=tu+tg,tb=tu-1,tx=-ty,tw=tx+tb,t_=i.length+tm-1,[tk,tS]=(0,c.useState)(()=>({idx:-1,rowIdx:tx-1,mode:"SELECT"})),tC=(0,c.useRef)(null),tO="treegrid"===eI,tE=tu*eL,tM=tv*ej,tA=ti-tE-tM,tP=null!=g&&null!=v,{leftKey:tT,rightKey:tR}=E(e$),tI=eA??tu+i.length+tv,tD=(0,c.useMemo)(()=>({renderCheckbox:ez,renderSortStatus:eB,renderCell:eF}),[ez,eB,eF]),tL=(0,c.useMemo)(()=>{let e=!1,t=!1;if(null!=a&&null!=g&&g.size>0){for(let n of i)if(g.has(a(n))?e=!0:t=!0,e&&t)break}return{isRowSelected:e&&!t,isIndeterminate:e&&t}},[i,g,a]),{rowOverscanStartIdx:tj,rowOverscanEndIdx:tN,totalRowHeight:tF,gridTemplateRows:tB,getRowTop:tz,getRowHeight:tV,findRowIdx:tH}=function({rows:e,rowHeight:t,clientHeight:n,scrollTop:r,enableVirtualization:i}){let{totalRowHeight:o,gridTemplateRows:s,getRowTop:a,getRowHeight:l,findRowIdx:u}=(0,c.useMemo)(()=>{if("number"==typeof t)return{totalRowHeight:t*e.length,gridTemplateRows:` repeat(${e.length}, ${t}px)`,getRowTop:e=>e*t,getRowHeight:()=>t,findRowIdx:e=>N(e/t)};let n=0,r="",i=null,o=0,s=e.map((s,a)=>{let l=t(s),u={top:n,height:l};return n+=l,null===i?(i=l,o=1):i===l?o++:(o>1?r+=`repeat(${o}, ${i}px) `:r+=`${i}px `,i=l,o=1),a===e.length-1&&(o>1?r+=`repeat(${o}, ${i}px)`:r+=`${i}px`),u}),a=t=>j(0,L(e.length-1,t));return{totalRowHeight:n,gridTemplateRows:r,getRowTop:e=>s[a(e)].top,getRowHeight:e=>s[a(e)].height,findRowIdx(e){let t=0,n=s.length-1;for(;t<=n;){let r=t+N((n-t)/2),i=s[r].top;if(i===e)return r;if(i<e?t=r+1:i>e&&(n=r-1),t>n)return n}return 0}}},[t,e]),d=0,h=e.length-1;if(i){let t=u(r),i=u(r+n);d=j(0,t-4),h=L(e.length-1,i+4)}return{rowOverscanStartIdx:d,rowOverscanEndIdx:h,totalRowHeight:o,gridTemplateRows:s,getRowTop:a,getRowHeight:l,findRowIdx:u}}({rows:i,rowHeight:eD,clientHeight:tA,scrollTop:eW,enableVirtualization:eH}),t$=function({columns:e,colSpanColumns:t,rows:n,topSummaryRows:r,bottomSummaryRows:i,colOverscanStartIdx:o,colOverscanEndIdx:s,lastFrozenColumnIndex:a,rowOverscanStartIdx:l,rowOverscanEndIdx:u}){let d=(0,c.useMemo)(()=>{if(0===o)return 0;let e=o,s=(t,n)=>void 0!==n&&t+n>o&&(e=t,!0);for(let o of t){let t=o.idx;if(t>=e||s(t,w(o,a,{type:"HEADER"})))break;for(let e=l;e<=u&&!s(t,w(o,a,{type:"ROW",row:n[e]}));e++);if(null!=r){for(let e of r)if(s(t,w(o,a,{type:"SUMMARY",row:e})))break}if(null!=i){for(let e of i)if(s(t,w(o,a,{type:"SUMMARY",row:e})))break}}return e},[l,u,n,r,i,o,a,t]);return(0,c.useMemo)(()=>{let t=[];for(let n=0;n<=s;n++){let r=e[n];(!(n<d)||r.frozen)&&t.push(r)}return t},[d,s,e])}({columns:ts,colSpanColumns:ta,colOverscanStartIdx:tc,colOverscanEndIdx:td,lastFrozenColumnIndex:tl,rowOverscanStartIdx:tj,rowOverscanEndIdx:tN,rows:i,topSummaryRows:o,bottomSummaryRows:s}),{gridTemplateColumns:tW,handleColumnResize:tU}=function(e,t,n,r,i,o,s,a,l){let[u,d]=(0,c.useState)(null),[h,f]=(0,c.useState)(null),[p,g]=(0,c.useState)(i),m=e.length===t.length,v=m&&i!==p,y=[...n],b=[];for(let{key:e,idx:n,width:r}of t){let t=o.get(e);e===u?.key?(y[n]="max-content"===u.width?u.width:`${u.width}px`,b.push(e)):"string"==typeof r&&t?.type!=="resized"&&(v||h?.has(e)===!0||void 0===t)&&(y[n]=r,b.push(e))}let w=y.join(" ");return(0,c.useLayoutEffect)(function(){if(g(i),0===b.length)return;let e=new Map(o),t=!1;for(let n of b){let i=ee(r,n);t||=i!==o.get(n)?.width,void 0===i?e.delete(n):e.set(n,{type:"measured",width:i})}if(null!==u){let n=u.key,i=o.get(n)?.width,s=ee(r,n);void 0!==s&&i!==s&&(t=!0,e.set(n,{type:"resized",width:s})),d(null)}t&&s(e)}),{gridTemplateColumns:w,handleColumnResize:function(e,n){let{key:i}=e;if((0,x.flushSync)(()=>{if(m){let e=new Set;for(let{key:n,width:r}of t)i!==n&&"string"==typeof r&&o.get(n)?.type!=="resized"&&e.add(n);f(e)}d({key:i,width:n}),l("number"==typeof n)}),f(null),a){let t=o.get(i)?.width,s="number"==typeof n?n:ee(r,i);void 0!==s&&s!==t&&a(e,s)}}}}(ts,t$,th,tn,tr,e9,te,en,eY),tq=tO?-1:0,tQ=ts.length-1,tK=nd(tk),tG=nh(tk),tX=eL+tF+tM+to,tY=et(tU),tZ=et(function(){eX&&(p?.(e9),eY(!1))}),tJ=et(er),t0=et(b),t1=et(A),t2=et(P),t5=et(T),t3=et(D),t4=et(function(e){if(!v)return;z(a);let t=new Set(g);for(let n of i){if(m?.(n)===!0)continue;let r=a(n);e.checked?t.add(r):t.delete(r)}v(t)}),t8=et(nt),t6=et(nn),t7=et(np),t9=et(function({idx:e,rowIdx:t}){np({rowIdx:tx+t-1,idx:e})}),ne=(0,c.useCallback)((e=!0)=>{let t=ek(tn.current);null!==t&&(e&&k(t),t.focus({preventScroll:!0}))},[tn]);function nt(e){if(!v)return;z(a);let{row:t,checked:n,isShiftClick:r}=e;if(m?.(t)===!0)return;let o=new Set(g),s=a(t),l=i.indexOf(t);if(e6(l),n?o.add(s):o.delete(s),r&&-1!==e8&&e8!==l&&e8<i.length){let e=F(l-e8);for(let t=e8+e;t!==l;t+=e){let e=i[t];m?.(e)!==!0&&(n?o.add(a(e)):o.delete(a(e)))}}v(o)}function nn(e,t,n){"function"!=typeof l||n===i[t]||l(i.with(t,n),{indexes:[t],column:e})}function nr(){"EDIT"===tk.mode&&nn(ts[tk.idx],tk.rowIdx,tk.row)}function ni(e){e.preventDefault(),("mouse"!==e.pointerType||1===e.buttons)&&(eJ(!0),e.currentTarget.setPointerCapture(e.pointerId))}function no(e){let t=tn.current,n=tH(eW-(tE+tg*ej)+e.clientY-t.getBoundingClientRect().top);e1(n),k(t.querySelector(`:scope > [aria-rowindex="${ty+n+1}"] > [aria-colindex="${tk.idx+1}"]`))}function ns(){if(eJ(!1),void 0===e0)return;let{rowIdx:e}=tk,[t,n]=e<e0?[e+1,e0+1]:[e0,e];nu(t,n),e1(void 0)}function na(){ne(!1)}function nl(e){e.stopPropagation(),nu(tk.rowIdx+1,i.length)}function nu(e,t){if(null==l)return;let{rowIdx:n,idx:r}=tk,o=ts[r],s=i[n],a=[...i],u=[];for(let n=e;n<t;n++)if(nf({rowIdx:n,idx:r})){let e=eo({columnKey:o.key,sourceRow:s,targetRow:i[n]});e!==i[n]&&(a[n]=e,u.push(n))}u.length>0&&l(a,{indexes:u,column:o})}(0,c.useLayoutEffect)(()=>{e3&&(null!==tC.current&&-1===tk.idx?(tC.current.focus({preventScroll:!0}),k(tC.current)):ne(),e4(!1))},[e3,ne,tk.idx]),(0,c.useImperativeHandle)(t,()=>({element:tn.current,scrollToCell({idx:e,rowIdx:t}){let n=void 0!==e&&e>tl&&e<ts.length?e:void 0,r=void 0!==t&&nc(t)?t:void 0;(void 0!==n||void 0!==r)&&e5({idx:n,rowIdx:r})},selectCell:np}));function nc(e){return e>=0&&e<i.length}function nd({idx:e,rowIdx:t}){var n;return t>=tx&&t<=t_&&(n=e)>=tq&&n<=tQ}function nh({idx:e,rowIdx:t}){var n;return nc(t)&&(n=e)>=tq&&n<=tQ}function nf(e){return function({idx:e,rowIdx:t}){return nc(t)&&e>=0&&e<=tQ}(e)&&function({selectedPosition:e,columns:t,rows:n}){return M(t[e.idx],n[e.rowIdx])}({columns:ts,rows:i,selectedPosition:e})}function np(e,t){if(!nd(e))return;nr();let n=eS(tk,e);if(t?.enableEditor&&nf(e)){let t=i[e.rowIdx];tS({...e,mode:"EDIT",row:t,originalRow:t})}else n?k(ek(tn.current)):(e4(t?.shouldFocusCell===!0),tS({...e,mode:"SELECT"}));Q&&!n&&Q({rowIdx:e.rowIdx,row:nc(e.rowIdx)?i[e.rowIdx]:void 0,column:ts[e.idx]})}function ng(e){let{key:t,shiftKey:n}=e,r="NONE";if("Tab"===t){if(function({maxColIdx:e,minRowIdx:t,maxRowIdx:n,selectedPosition:{rowIdx:r,idx:i},shiftKey:o}){return o?0===i&&r===t:i===e&&r===n}({shiftKey:n,maxColIdx:tQ,minRowIdx:tx,maxRowIdx:t_,selectedPosition:tk}))return void nr();r="CHANGE_ROW"}e.preventDefault();let a=function(e,t,n){let{idx:r,rowIdx:o}=tk,s=tK&&-1===r;switch(e){case"ArrowUp":return{idx:r,rowIdx:o-1};case"ArrowDown":return{idx:r,rowIdx:o+1};case tT:return{idx:r-1,rowIdx:o};case tR:return{idx:r+1,rowIdx:o};case"Tab":return{idx:r+(n?-1:1),rowIdx:o};case"Home":if(s)return{idx:r,rowIdx:tx};return{idx:0,rowIdx:t?tx:o};case"End":if(s)return{idx:r,rowIdx:t_};return{idx:tQ,rowIdx:t?t_:o};case"PageUp":{if(tk.rowIdx===tx)return tk;let e=tz(o)+tV(o)-tA;return{idx:r,rowIdx:e>0?tH(e):0}}case"PageDown":{if(tk.rowIdx>=i.length)return tk;let e=tz(o)+tA;return{idx:r,rowIdx:e<tF?tH(e):i.length-1}}default:return tk}}(t,O(e),n);if(eS(tk,a))return;let l=function({moveUp:e,moveNext:t,cellNavigationMode:n,columns:r,colSpanColumns:i,rows:o,topSummaryRows:s,bottomSummaryRows:a,minRowIdx:l,mainHeaderRowIdx:u,maxRowIdx:c,currentPosition:{idx:d,rowIdx:h},nextPosition:f,lastFrozenColumnIndex:p,isCellWithinBounds:g}){let{idx:m,rowIdx:v}=f,y=r.length,b=e=>{for(let t of i){let n=t.idx;if(n>m)break;let r=function({rows:e,topSummaryRows:t,bottomSummaryRows:n,rowIdx:r,mainHeaderRowIdx:i,lastFrozenColumnIndex:o,column:s}){let a=t?.length??0;return r===i?w(s,o,{type:"HEADER"}):t&&r>i&&r<=a+i?w(s,o,{type:"SUMMARY",row:t[r+a]}):r>=0&&r<e.length?w(s,o,{type:"ROW",row:e[r]}):n?w(s,o,{type:"SUMMARY",row:n[r-e.length]}):void 0}({rows:o,topSummaryRows:s,bottomSummaryRows:a,rowIdx:v,mainHeaderRowIdx:u,lastFrozenColumnIndex:p,column:t});if(r&&m>n&&m<r+n){m=n+(e?r:0);break}}},x=e=>e.level+u;if(g(f)&&(b(t),v<u&&(()=>{if(t){let e=r[m].parent;for(;void 0!==e;){let t=x(e);if(v===t){m=e.idx+e.colSpan;break}e=e.parent}}else if(e){let e=r[m].parent,t=!1;for(;void 0!==e;){let n=x(e);if(v>=n){m=e.idx,v=n,t=!0;break}e=e.parent}t||(m=d,v=h)}})()),"CHANGE_ROW"===n){let e=m===y,t=-1===m;e?v!==c&&(m=0,v+=1):t&&(v!==l&&(v-=1,m=y-1),b(!1))}if(v<u&&m>-1&&m<y){let e=r[m].parent,t=v;for(v=u;void 0!==e;){let n=x(e);n>=t&&(v=n,m=e.idx),e=e.parent}}return{idx:m,rowIdx:v}}({moveUp:"ArrowUp"===t,moveNext:t===tR||"Tab"===t&&!n,columns:ts,colSpanColumns:ta,rows:i,topSummaryRows:o,bottomSummaryRows:s,minRowIdx:tx,mainHeaderRowIdx:tw,maxRowIdx:t_,lastFrozenColumnIndex:tl,cellNavigationMode:r,currentPosition:tk,nextPosition:a,isCellWithinBounds:nd});np(l,{shouldFocusCell:!0})}function nm(e){let t=-1===tk.idx?void 0:ts[tk.idx];return void 0===t||tk.rowIdx!==e||t$.includes(t)?t$:tk.idx>td?[...t$,t]:[...t$.slice(0,tl+1),t,...t$.slice(tl+1)]}(tk.idx>tQ||tk.rowIdx>t_)&&(tS({idx:-1,rowIdx:tx-1,mode:"SELECT"}),e1(void 0)),e7&&eK!==f&&eG(f);let nv=`repeat(${tu}, ${eL}px)`;tg>0&&(nv+=` repeat(${tg}, ${ej}px)`),i.length>0&&(nv+=tB),tm>0&&(nv+=` repeat(${tm}, ${ej}px)`);let ny=-1===tk.idx&&tk.rowIdx!==tx-1;return(0,n.jsxs)("div",{role:eI,"aria-label":eC,"aria-labelledby":eO,"aria-description":eE,"aria-describedby":eM,"aria-multiselectable":!!tP||void 0,"aria-colcount":ts.length,"aria-rowcount":tI,tabIndex:-1,className:I("rdg rnvodz57-0-0-beta-58",{"rdg-viewport-dragging vlqv91k7-0-0-beta-58":eZ},ed),style:{...eh,scrollPaddingInlineStart:tk.idx>tl||e2?.idx!==void 0?`${tp}px`:void 0,scrollPaddingBlock:nc(tk.rowIdx)||e2?.rowIdx!==void 0?`${tE+tg*ej}px ${tm*ej}px`:void 0,gridTemplateColumns:tW,gridTemplateRows:nv,"--rdg-header-row-height":`${eL}px`,"--rdg-scroll-height":`${tX}px`,...tf},dir:e$,ref:tn,onScroll:function(e){let{scrollTop:t,scrollLeft:n}=e.currentTarget;(0,x.flushSync)(()=>{eU(t),eQ(B(n))}),J?.(e)},onKeyDown:function(e){let{idx:t,rowIdx:n,mode:r}=tk;if("EDIT"===r)return;if(H&&nc(n)){let r=i[n],o=S(e);if(H({mode:"SELECT",row:r,column:ts[t],rowIdx:n,selectCell:np},o),o.isGridDefaultPrevented())return}if(!(e.target instanceof Element))return;let o=null!==e.target.closest(".rdg-cell"),s=tO&&e.target===tC.current;if(o||s)switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Tab":case"Home":case"End":case"PageUp":case"PageDown":ng(e);break;default:!function(e){var t;if(!tG)return;let n=i[tk.rowIdx],{key:r,shiftKey:o}=e;if(tP&&o&&" "===r){z(a);let t=a(n);nt({row:n,checked:!g.has(t),isShiftClick:!1}),e.preventDefault();return}!nf(tk)||(t=null!=el,O(e)&&(86!==e.keyCode||t)||C.has(e.key))||tS(({idx:e,rowIdx:t})=>({idx:e,rowIdx:t,mode:"EDIT",row:n,originalRow:n}))}(e)}},onCopy:function(e){if(!tG)return;let{idx:t,rowIdx:n}=tk;ea?.({row:i[n],column:ts[t]},e)},onPaste:function(e){if(!el||!l||!nf(tk))return;let{idx:t,rowIdx:n}=tk,r=ts[t],o=el({row:i[n],column:r},e);nn(r,n,o)},"data-testid":eP,"data-cy":eT,children:[(0,n.jsxs)(U,{value:tD,children:[(0,n.jsx)(X,{value:t4,children:(0,n.jsxs)(G,{value:tL,children:[Array.from({length:tb},(e,t)=>(0,n.jsx)(eg,{rowIdx:t+1,level:-tb+t,columns:nm(tx+t),selectedCellIdx:tk.rowIdx===tx+t?tk.idx:void 0,selectCell:t9},t)),(0,n.jsx)(ep,{headerRowClass:em,rowIdx:tu,columns:nm(tw),onColumnResize:tY,onColumnResizeEnd:tZ,onColumnsReorder:tJ,sortColumns:y,onSortColumnsChange:t0,lastFrozenColumnIndex:tl,selectedCellIdx:tk.rowIdx===tw?tk.idx:void 0,selectCell:t9,shouldFocusGrid:!tK,direction:e$})]})}),0===i.length&&eV?eV:(0,n.jsxs)(n.Fragment,{children:[o?.map((e,t)=>{let r=tu+1+t,i=tw+1+t,o=tk.rowIdx===i;return(0,n.jsx)(ew,{"aria-rowindex":r,rowIdx:i,gridRowStart:r,row:e,top:tE+ej*t,bottom:void 0,viewportColumns:nm(i),lastFrozenColumnIndex:tl,selectedCellIdx:o?tk.idx:void 0,isTop:!0,selectCell:t7},t)}),(0,n.jsx)(K,{value:t8,children:function(){let e=[],{idx:t,rowIdx:r}=tk,o=tG&&r<tj?tj-1:tj,s=tG&&r>tN?tN+1:tN;for(let l=o;l<=s;l++){let o=l===tj-1||l===tN+1,s=o?r:l,u=t$,c=-1===t?void 0:ts[t];void 0!==c&&(u=o?[c]:nm(s));let d=i[s],h=ty+s+1,f=s,p=!1;"function"==typeof a&&(f=a(d),p=g?.has(f)??!1),e.push(eN(f,{"aria-rowindex":ty+s+1,"aria-selected":tP?p:void 0,rowIdx:s,row:d,viewportColumns:u,isRowSelectionDisabled:m?.(d)??!1,isRowSelected:p,onCellMouseDown:t1,onCellClick:t2,onCellDoubleClick:t5,onCellContextMenu:t3,rowClass:ef,gridRowStart:h,selectedCellIdx:r===s?t:void 0,draggedOverCellIdx:function(e){if(void 0===e0)return;let{rowIdx:t}=tk;return(t<e0?t<e&&e<=e0:t>e&&e>=e0)?tk.idx:void 0}(s),lastFrozenColumnIndex:tl,onRowChange:t6,selectCell:t7,selectedCellEditor:function(e){if(!nh(tk)||tk.rowIdx!==e||"SELECT"===tk.mode)return;let{idx:t,row:r}=tk,o=ts[t],s=w(o,tl,{type:"ROW",row:r}),a=o.editorOptions?.closeOnExternalRowChange??!0,l=e=>{e4(e),tS(({idx:e,rowIdx:t})=>({idx:e,rowIdx:t,mode:"SELECT"}))};return a&&i[tk.rowIdx]!==tk.originalRow&&l(!1),(0,n.jsx)(es,{column:o,colSpan:s,row:r,rowIdx:e,onRowChange:(e,t,n)=>{t?(0,x.flushSync)(()=>{nn(o,tk.rowIdx,e),l(n)}):tS(t=>({...t,row:e}))},closeEditor:l,onKeyDown:H,navigate:ng},o.key)}(s)}))}return e}()}),s?.map((e,t)=>{let r=ty+i.length+t+1,o=i.length+t,a=tk.rowIdx===o,l=tA>tF?ti-ej*(s.length-t):void 0,u=void 0===l?ej*(s.length-1-t):void 0;return(0,n.jsx)(ew,{"aria-rowindex":tI-tm+t+1,rowIdx:o,gridRowStart:r,row:e,top:l,bottom:u,viewportColumns:nm(o),lastFrozenColumnIndex:tl,selectedCellIdx:a?tk.idx:void 0,isTop:!1,selectCell:t7},t)})]})]}),function(){if(null==eo||"EDIT"===tk.mode||!nh(tk))return;let{idx:e,rowIdx:t}=tk,r=ts[e];if(null==r.renderEditCell||!1===r.editable)return;let o=t===t_,s=tt(r),a=r.colSpan?.({type:"ROW",row:i[t]})??1,{insetInlineStart:l,...u}=R(r,a),c="calc(var(--rdg-drag-handle-size) * -0.5 + 1px)",d=r.idx+a-1===tQ,h={...u,gridRowStart:ty+t+1,marginInlineEnd:d?void 0:c,marginBlockEnd:o?void 0:c,insetInlineStart:l?`calc(${l} + ${s}px + var(--rdg-drag-handle-size) * -0.5 - 1px)`:void 0};return(0,n.jsx)("div",{style:h,className:I("rdg-cell-drag-handle ch2wcw87-0-0-beta-58",r.frozen&&"c1wvphzh7-0-0-beta-58"),onPointerDown:ni,onPointerMove:eZ?no:void 0,onLostPointerCapture:eZ?ns:void 0,onClick:na,onDoubleClick:nl})}(),t$.map(({key:e,idx:t,minWidth:r,maxWidth:i})=>(0,n.jsx)("div",{className:"mlln6zg7-0-0-beta-58",style:{gridColumnStart:t+1,minWidth:r,maxWidth:i},"data-measuring-cell-key":e},e)),tO&&(0,n.jsx)("div",{ref:tC,tabIndex:ny?0:-1,className:I("f1lsfrzw7-0-0-beta-58",{"f1cte0lg7-0-0-beta-58":!nc(tk.rowIdx),"r190mhd37-0-0-beta-58":ny,"r139qu9m7-0-0-beta-58":ny&&-1!==tl}),style:{gridRowStart:tk.rowIdx+ty+1}}),null!==e2&&(0,n.jsx)(ey,{scrollToPosition:e2,setScrollToCellPosition:e5,gridRef:tn})]})}function ek(e){return e.querySelector(':scope > [role="row"] > [tabindex="0"]')}function eS(e,t){return e.idx===t.idx&&e.rowIdx===t.rowIdx}var eC=(0,c.memo)(function({id:e,groupKey:t,childRows:r,isExpanded:i,isCellSelected:o,column:s,row:a,groupColumnIndex:l,isGroupByColumn:u,toggleGroup:c}){let{tabIndex:d,childTabIndex:h,onFocus:f}=en(o);function p(){c(e)}let g=u&&l===s.idx;return(0,n.jsx)("div",{role:"gridcell","aria-colindex":s.idx+1,"aria-selected":o,tabIndex:d,className:D(s),style:{...R(s),cursor:g?"pointer":"default"},onMouseDown:e=>{e.preventDefault()},onClick:g?p:void 0,onFocus:f,children:(!u||g)&&s.renderGroupCell?.({groupKey:t,childRows:r,column:s,row:a,isExpanded:i,tabIndex:h,toggleGroup:p})},s.key)});(0,c.memo)(function({className:e,row:t,rowIdx:r,viewportColumns:i,selectedCellIdx:o,isRowSelected:s,selectCell:a,gridRowStart:l,groupBy:u,toggleGroup:d,isRowSelectionDisabled:h,...f}){let p=i[0].key===Y?t.level+1:t.level,g=(0,c.useMemo)(()=>({isRowSelectionDisabled:!1,isRowSelected:s}),[s]);return(0,n.jsx)(Q,{value:g,children:(0,n.jsx)("div",{role:"row","aria-level":t.level+1,"aria-setsize":t.setSize,"aria-posinset":t.posInSet+1,"aria-expanded":t.isExpanded,className:I(ed,"rdg-group-row g1yxluv37-0-0-beta-58",`rdg-row-${r%2==0?"even":"odd"}`,-1===o&&eh,e),onMouseDown:function(){a({rowIdx:r,idx:-1},{shouldFocusCell:!0})},style:P(l),...f,children:i.map(e=>(0,n.jsx)(eC,{id:t.id,groupKey:t.groupKey,childRows:t.childRows,isExpanded:t.isExpanded,isCellSelected:o===e.idx,column:e,row:t,groupColumnIndex:p,toggleGroup:d,isGroupByColumn:u.includes(e.key)},e.key))})})});function eO(e){e?.focus(),e?.select()}function eE({row:e,column:t,onRowChange:r,onClose:i}){return(0,n.jsx)("input",{className:"rdg-text-editor t7vyx3i7-0-0-beta-58",ref:eO,value:e[t.key],onChange:n=>r({...e,[t.key]:n.target.value}),onBlur:()=>i(!0,!1)})}function eM(e){let{columns:t,displayMode:i,headerProps:s,baseTitle:a,currentTitle:l,allowIndexFallback:u=!1}=e,c=[],d=!1;return!t.some(e=>e.isPrimaryKey)&&u&&(c.push({key:"_index",name:"",width:50,maxWidth:100,cellClass:"index-column"}),d=!0),t.forEach(e=>{e.isPrimaryKey?c.push(function(e,t){let{key:i,name:s,columnType:a,columnStatus:l,columnRenderMode:u}=e;return{key:i,name:(0,n.jsx)(r.DataFrameColumnGroupHeader,{name:s,columnStatus:l??"",columnType:a,...t}),frozen:!0,cellClass:e=>{if(e.__status)return`diff-header-${e.__status}`},renderCell:o.defaultRenderCell,columnType:a,columnRenderMode:u}}(e,s)):c.push(function(e,t,i,s,a){let{name:l,columnType:u,columnStatus:c,columnRenderMode:d}=e;return function(e){let{name:t,columnStatus:i,columnType:s,columnRenderMode:a,displayMode:l,baseTitle:u="Base",currentTitle:c="Current",headerProps:d={}}=e,h=(0,m.getHeaderCellClass)(i),f=(0,n.jsx)(r.DataFrameColumnGroupHeader,{name:t,columnStatus:i,columnType:s,...d});if("inline"===l)return{headerCellClass:h,name:f,key:t,renderCell:v,columnType:s,columnRenderMode:a};let p=e=>{let n=e.__status;if("removed"===n)return"diff-cell-removed";if("added"===n)return"diff-cell-added";if("added"===i||"removed"===i)return;let r=`base__${t}`.toLowerCase(),o=`current__${t}`.toLowerCase();if(!b.default.isEqual(e[r],e[o]))return"diff-cell-removed"},g=e=>{let n=e.__status;if("removed"===n)return"diff-cell-removed";if("added"===n)return"diff-cell-added";if("added"===i||"removed"===i)return;let r=`base__${t}`.toLowerCase(),o=`current__${t}`.toLowerCase();if(!b.default.isEqual(e[r],e[o]))return"diff-cell-added"};return{headerCellClass:h,name:f,children:[{key:`base__${t}`,name:u,renderEditCell:eE,headerCellClass:h,cellClass:p,renderCell:o.defaultRenderCell,columnType:s,columnRenderMode:a},{key:`current__${t}`,name:c,renderEditCell:eE,headerCellClass:h,cellClass:g,renderCell:o.defaultRenderCell,columnType:s,columnRenderMode:a}]}}({name:l,columnStatus:c??"",columnType:u,columnRenderMode:d,displayMode:t,baseTitle:s,currentTitle:a,headerProps:i})}(e,i,s,a,l))}),{columns:c,usedIndexFallback:d}}e.s(["DataGrid",()=>e_,"textEditor",()=>eE],359761),e.s(["buildDiffColumnDefinitions",()=>eM],840908);var eA=e.i(675155),eP=e.i(196137);function eT(e,t,n,r,i){n.forEach(n=>{let o=n.key;i.includes(o)?e[String(o).toLowerCase()]=t[o]:e[`${r}${o}`.toLowerCase()]=t[o]})}function eR(e){let{baseMap:t,currentMap:n,baseColumns:r,currentColumns:i,columnMap:o,primaryKeys:s,changedOnly:a=!1}=e,l=(0,eA.mergeKeysWithStatus)(Object.keys(t),Object.keys(n)),u={added:0,removed:0,modified:0},c=Object.entries(l).map(([e])=>{let a=t[e],l=n[e],c={_index:(0,eP.keyToNumber)(e),__status:void 0};return a&&eT(c,a,r,"base__",s),l&&eT(c,l,i,"current__",s),a?l?function(e,t,n,r){let i=!1;for(let[o,s]of Object.entries(n)){if("index"===o||r.includes(o))continue;let{baseKey:n,currentKey:a}=function(e){return"baseColumnKey"in e&&"currentColumnKey"in e?{baseKey:e.baseColumnKey,currentKey:e.currentColumnKey}:{baseKey:e.key,currentKey:e.key}}(s);if("unknown"===n||"unknown"===a)continue;let l=e[n],u=t[a];b.default.isEqual(l,u)||(i=!0,s.status="modified")}return i}(a,l,o,s)&&(c.__status="modified",u.modified++):(c.__status="removed",u.removed++):(c.__status="added",u.added++),c});return a&&(c=c.filter(e=>"added"===e.__status||"removed"===e.__status||"modified"===e.__status)),{rows:c,rowStats:u}}e.s(["buildDiffRows",()=>eR],72039);class eI extends Error{context;details;constructor(e,t,n){super(t?`[${t}] ${e}`:e),this.context=t,this.details=n,this.name="DataGridValidationError"}}function eD(e,t="DataFrame"){if(null!=e){if("object"!=typeof e)throw new eI(`Expected an object, got ${typeof e}`,t);if(!("columns"in e))throw new eI("Missing 'columns' property",t,{receivedKeys:Object.keys(e)});if(!Array.isArray(e.columns))throw new eI(`'columns' must be an array, got ${typeof e.columns}`,t);if(!("data"in e))throw new eI("Missing 'data' property",t,{receivedKeys:Object.keys(e)});if(!Array.isArray(e.data))throw new eI(`'data' must be an array, got ${typeof e.data}`,t);(function(e,t="DataFrame"){e.forEach((e,n)=>{if(!e||"object"!=typeof e)throw new eI(`Column at index ${n} is not an object`,t,{column:e});if("string"!=typeof e.key||""===e.key)throw new eI(`Column at index ${n} has invalid 'key': expected non-empty string, got ${JSON.stringify(e.key)}`,t,{column:e});if("string"!=typeof e.name)throw new eI(`Column '${e.key}' has invalid 'name': expected string, got ${typeof e.name}`,t,{column:e});if("string"!=typeof e.type)throw new eI(`Column '${e.key}' has invalid 'type': expected string, got ${typeof e.type}`,t,{column:e})})})(e.columns,t),e.data.length>0&&function(e,t="DataFrame"){let n=e.columns.length;for(let r=0;r<e.data.length;r++){let i=e.data[r];if(!Array.isArray(i))throw new eI(`Row at index ${r} is not an array`,t,{row:i,rowType:typeof i});if(i.length!==n)throw new eI(`Row ${r} has ${i.length} values but expected ${n} (column count)`,t,{rowIndex:r,rowLength:i.length,columnCount:n,columns:e.columns.map(e=>e.key)})}}(e,t)}}function eL(e,t,n={}){let{required:r=!1,caseInsensitive:i=!1,context:o="primaryKeys"}=n;if(r&&(!e||0===e.length))throw new eI("Primary keys are required but none were provided",o);if(!e||0===e.length)return;let s=t.map(e=>e.key),a=i?s.map(e=>e.toLowerCase()):s;for(let t of e){let e=i?t.toLowerCase():t;if(!(i?a.includes(e):s.includes(t)))throw new eI(`Primary key column '${t}' not found in columns`,o,{requestedKey:t,availableColumns:s,caseInsensitive:i})}let l=new Set;for(let t of e){let n=i?t.toLowerCase():t;if(l.has(n))throw new eI(`Duplicate primary key: '${t}'`,o,{primaryKeys:e});l.add(n)}}function ej(e,t){eD(e,"dataframe"),e&&t?.primaryKeys&&eL(t.primaryKeys,e.columns,{context:"toDataGrid"})}function eN(e,t,n){if(eD(e,"base"),eD(t,"current"),n?.primaryKeys&&n.primaryKeys.length>0){let r=e?.columns??[],i=t?.columns??[],o=new Set([...r.map(e=>e.key),...i.map(e=>e.key)]);for(let e of n.primaryKeys)if(!o.has(e))throw new eI(`Primary key column '${e}' not found in either base or current DataFrame`,"toDataDiffGrid",{requestedKey:e,baseColumns:r.map(e=>e.key),currentColumns:i.map(e=>e.key)})}}function eF(e,t){if(!e)throw new eI("DataFrame is required for value diff");if(eD(e),!t||0===t.length)throw new eI("Primary keys are required for value diff");eL(t,e.columns,{required:!0,context:"toValueDiffGrid"});let n=e.columns.map(e=>e.key);if(!n.includes("in_a"))throw new eI("Value diff DataFrame must include lowercase 'in_a' column");if(!n.includes("in_b"))throw new eI("Value diff DataFrame must include lowercase 'in_b' column")}function eB(e,n,r){eN(e,n,r);let i=e??{columns:[],data:[]},o=n??{columns:[],data:[]},s=r?.primaryKeys??[],a=r?.pinnedColumns??[],l=r?.changedOnly??!1,u=r?.displayMode??"side_by_side",c=r?.columnsRenderMode??{},d=(0,eP.dataFrameToRowObjects)(i),h=(0,eP.dataFrameToRowObjects)(o),f=(0,m.buildMergedColumnMap)(i,o),p={},g={},v=!1,y=!1;if(0===s.length)d.forEach(e=>{p[String(e._index)]=e}),h.forEach(e=>{g[String(e._index)]=e});else{let e=(0,m.validatePrimaryKeys)(i.columns,s);d.forEach(t=>{let n=(0,m.getPrimaryKeyValue)(i.columns,e,t);n in p&&(v=!0),p[n]=t});let t=(0,m.validatePrimaryKeys)(o.columns,s);h.forEach(e=>{let n=(0,m.getPrimaryKeyValue)(o.columns,t,e);n in g&&(y=!0),g[n]=e})}let{rows:b,rowStats:x}=eR({baseMap:p,currentMap:g,baseColumns:i.columns,currentColumns:o.columns,columnMap:f,primaryKeys:s,changedOnly:l}),{columns:w}=eM({columns:(0,t.getDisplayColumns)({columnMap:f,primaryKeys:s,pinnedColumns:a,columnsRenderMode:c,changedOnly:l,rowStats:x,excludeColumns:["index"],strictMode:!1}),displayMode:u,allowIndexFallback:!0,baseTitle:r?.baseTitle,currentTitle:r?.currentTitle,headerProps:{primaryKeys:s,pinnedColumns:a,onPrimaryKeyChange:r?.onPrimaryKeyChange,onPinnedColumnsChange:r?.onPinnedColumnsChange,onColumnsRenderModeChanged:r?.onColumnsRenderModeChanged}});return{columns:w,rows:b,invalidPKeyBase:v,invalidPKeyCurrent:y}}function ez(e,s){ej(e,s);let a=s.primaryKeys??[],l=s.pinnedColumns??[],u=s.columnsRenderMode??{},c=(0,m.buildColumnMap)(e),{columns:d}=function(e){let{columns:t,headerProps:s,allowIndexFallback:a=!0}=e,l=[],u=!1;return!t.some(e=>e.isPrimaryKey)&&a&&(l.push({key:"_index",name:"",width:50,cellClass:"index-column"}),u=!0),t.forEach(e=>{e.isPrimaryKey?l.push(function(e,t){let{key:i,name:s,columnType:a,columnRenderMode:l}=e;return{key:i,name:(0,n.jsx)(r.DataFrameColumnGroupHeader,{name:s,columnStatus:"",columnType:a,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged}),width:"auto",frozen:!0,renderCell:o.defaultRenderCell,columnType:a,columnRenderMode:l}}(e,s)):l.push(function(e,t){let{key:r,name:s,columnType:a,columnRenderMode:l}=e;return{key:r,name:(0,n.jsx)(i.DataFrameColumnHeader,{name:s,columnType:a,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged}),width:"auto",renderCell:o.defaultRenderCell,columnType:a,columnRenderMode:l}}(e,s))}),{columns:l,usedIndexFallback:u}}({columns:(0,t.getSimpleDisplayColumns)({columnMap:c,primaryKeys:a,pinnedColumns:l,columnsRenderMode:u}),headerProps:{pinnedColumns:l,onPinnedColumnsChange:s.onPinnedColumnsChange,onColumnsRenderModeChanged:s.onColumnsRenderModeChanged},allowIndexFallback:!0});return{columns:d,rows:(0,eP.dataFrameToRowObjects)(e)}}function eV(e,t){if(e<t){let n=(t-e)/e*100;return`+${n>=.1?n.toFixed(1):" <0.1 "}%`}if(!(e>t))return"0 %";{let n=(e-t)/e*100;return`-${n>=.1?n.toFixed(1):" <0.1 "}%`}}function eH(e){return{columns:[{key:"name",name:"Name",type:"text"},{key:"base",name:"Base Rows",type:"number"},{key:"current",name:"Current Rows",type:"number"},{key:"delta",name:"Delta",type:"text"}],data:Object.entries(e).map(([e,t])=>{let n="number"==typeof t.base?t.base:null,r="number"==typeof t.curr?t.curr:null,i=null!==n&&null!==r?n!==r?eV(n,r):"=":n===r?"N/A":null===n?"Added":null===r?"Removed":"N/A";return[e,n,r,i]})}}function e$(e){return{columns:[{key:"name",name:"Name",type:"text"},{key:"current",name:"Row Count",type:"number"}],data:Object.entries(e).map(([e,t])=>[e,"number"==typeof t.curr?t.curr:null])}}function eW(e,t){return null===e&&null!==t?"added":null!==e&&null===t?"removed":null!==e&&null!==t&&e!==t?"modified":void 0}function eU(e){let t=e$(e);return{columns:[{key:"name",name:"Name",resizable:!0},{key:"current",name:"Row Count",resizable:!0}],rows:(0,eP.dataFrameToRowObjects)(t).map(e=>({...e,current:e.current??"N/A",__status:void 0}))}}function eq(e){let t=eH(e),n=(0,eP.dataFrameToRowObjects)(t).map(e=>{let t=e.base,n=e.current;return{...e,base:t??"N/A",current:n??"N/A",__status:eW("number"==typeof t?t:null,"number"==typeof n?n:null)}}),r=e=>{let t=e.base,n=e.current,r="N/A"===t?null:t,i="N/A"===n?null:n;if(r!==i){if(null===r||"number"==typeof r&&"number"==typeof i&&r<i)return"diff-cell-added";if(null===i||"number"==typeof r&&"number"==typeof i&&r>i)return"diff-cell-removed"}};return{columns:[{key:"name",name:"Name",resizable:!0,cellClass:r},{key:"base",name:"Base Rows",resizable:!0,cellClass:r},{key:"current",name:"Current Rows",resizable:!0,cellClass:r},{key:"delta",name:"Delta",resizable:!0,cellClass:r}],rows:n}}e.s(["validateToDataDiffGridInputs",()=>eN,"validateToDataGridInputs",()=>ej,"validateToValueDiffGridInputs",()=>eF],622670),e.s([],848148),e.s(["toDataDiffGrid",()=>eB],605740),e.s(["toDataGrid",()=>ez],146459),e.s(["deltaPercentageString",()=>eV],652058),e.s(["getRowCountDiffStatus",()=>eW,"rowCountDiffResultToDataFrame",()=>eH,"rowCountResultToDataFrame",()=>e$],830055),e.s(["toRowCountDataGrid",()=>eU],490395),e.s(["toRowCountDiffDataGrid",()=>eq],603634),e.i(316575);var eQ=e.i(7284),eK=e.i(778024),eG=e.i(446547),eX=e.i(73205),eY=e.i(519273),eZ=e.i(578509),eJ=e.i(435983),e0=e.i(446519);function e1(e){return(0,e0.default)("MuiListSubheader",e)}(0,eJ.default)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);let e2=(0,eG.styled)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,eZ.default)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((0,eX.default)(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),e5=c.forwardRef(function(e,t){let r=(0,eY.useDefaultProps)({props:e,name:"MuiListSubheader"}),{className:i,color:o="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1,...c}=r,d={...r,color:o,component:s,disableGutters:a,disableSticky:l,inset:u},h=(e=>{let{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,s={root:["root","default"!==n&&`color${(0,eZ.default)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,eK.default)(s,e1,t)})(d);return(0,n.jsx)(e2,{as:s,className:(0,eQ.default)(h.root,i),ref:t,ownerState:d,...c})});e5&&(e5.muiSkipListHighlight=!0),e.s(["default",0,e5],130115)},757980,187726,913599,716396,162234,543482,412103,51297,64485,862031,522430,940159,e=>{"use strict";e.s(["ProfileDiffResultView",()=>em,"ProfileResultView",()=>ev],757980);var t=e.i(19483),n=e.i(324066),r=e.i(187725),i=e.i(862754);e.s(["createDataGrid",()=>$,"createDataGridFromData",()=>W],716396);var o=e.i(605740),s=e.i(146459),a=e.i(490395),l=e.i(603634),u=e.i(924011),c=e.i(73371),d=e.i(130115),h=e.i(135301),f=e.i(263712),p=e.i(197068),g=e.i(224378),m=e.i(203158),v=e.i(29134),y=e.i(912007),b=e.i(645364);let x=(0,r.createContext)(void 0),w=()=>(0,r.useContext)(x);function _({model:e,row:i,singleEnv:o,cllRunning:s,showMenu:a=!0}){let l=w(),{runAction:x}=(0,v.useRecceActionContext)(),{featureToggles:_}=(0,y.useRecceInstanceContext)(),{name:k,baseType:S,currentType:C,baseIndex:O,currentIndex:E}=i,M=C??S,[A,P]=(0,r.useState)(null),T=()=>{P(null)},R=!S||!C;return(0,t.jsx)(p.default,{title:"View column lineage",placement:"top",disableHoverListener:void 0===l||void 0!==O&&void 0===E,children:(0,t.jsxs)(n.default,{sx:{display:"flex",alignItems:"center",gap:"3px"},children:[(0,t.jsx)(n.default,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k}),(0,t.jsx)(n.default,{sx:{flex:1}}),s&&(0,t.jsx)(u.default,{size:12,color:"inherit"}),a&&!o&&"source"!==e.resource_type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.default,{"aria-label":"Column options",className:"row-context-menu",size:"small",disabled:_.disableDatabaseQuery,onClick:e=>{e.stopPropagation(),P(e.currentTarget)},children:(0,t.jsx)(g.VscKebabVertical,{})}),(0,t.jsxs)(h.default,{anchorEl:A,open:!!A,onClose:T,slotProps:{list:{sx:{lineHeight:"20px"}}},children:[(0,t.jsx)(d.default,{sx:{m:0,p:"4px 12px",lineHeight:"20px"},children:"Diff"}),(0,t.jsx)(f.default,{onClick:()=>{(0,m.trackExploreAction)({action:m.EXPLORE_ACTION.PROFILE_DIFF,source:m.EXPLORE_SOURCE.SCHEMA_COLUMN_MENU,node_count:1}),x("profile_diff",{model:e.name,columns:[k]},{showForm:!1}),T()},disabled:R,sx:{fontSize:"0.85rem"},children:"Profile Diff"}),(0,t.jsx)(f.default,{onClick:()=>{(0,m.trackExploreAction)({action:m.EXPLORE_ACTION.HISTOGRAM_DIFF,source:m.EXPLORE_SOURCE.SCHEMA_COLUMN_MENU,node_count:1}),x("histogram_diff",{model:e.name,column_name:k,column_type:M},{showForm:!1}),T()},disabled:R||!M||!(0,b.supportsHistogramDiff)(M),sx:{fontSize:"0.85rem"},children:"Histogram Diff"}),(0,t.jsx)(f.default,{onClick:()=>{(0,m.trackExploreAction)({action:m.EXPLORE_ACTION.TOP_K_DIFF,source:m.EXPLORE_SOURCE.SCHEMA_COLUMN_MENU,node_count:1}),x("top_k_diff",{model:e.name,column_name:k,k:50},{showForm:!1}),T()},disabled:R,sx:{fontSize:"0.85rem"},children:"Top-k Diff"}),(0,t.jsx)(f.default,{onClick:()=>{(0,m.trackExploreAction)({action:m.EXPLORE_ACTION.VALUE_DIFF,source:m.EXPLORE_SOURCE.SCHEMA_COLUMN_MENU,node_count:1}),x("value_diff",{model:e.name,columns:[k]},{showForm:!0}),T()},disabled:R,sx:{fontSize:"0.85rem"},children:"Value Diff"})]})]})]})})}e.s(["LineageViewContext",0,x,"useLineageViewContext",0,w,"useLineageViewContextSafe",0,()=>{let e=(0,r.useContext)(x);if(!e)throw Error("useLineageViewContext must be used within a LineageViewProvider");return e}],187726);var k=e.i(675155);function S(e){return void 0!==e.baseIndex&&void 0!==e.currentIndex&&!0===e.reordered?"column-index-reordered schema-column schema-column-index":"schema-column schema-column-index"}function C(){return"schema-column"}function O(e){return void 0!==e.baseIndex&&void 0!==e.currentIndex&&e.baseType!==e.currentType?"column-body-type-changed schema-column":"schema-column"}e.s(["toValueDataGrid",()=>L],913599);var E=e.i(388797);function M({columnName:e,primaryKeys:r}){let i=r.includes(e);return(0,t.jsx)(n.default,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:i&&(0,t.jsx)(g.VscKey,{})})}function A({params:e,column:i}){let{runAction:o}=(0,v.useRecceActionContext)(),{featureToggles:s}=(0,y.useRecceInstanceContext)(),[a,l]=(0,r.useState)(null),u=()=>{l(null)},p=(t,n)=>{o("value_diff_detail",{...e,...t},n)};return(0,t.jsxs)(n.default,{sx:{display:"flex"},children:[(0,t.jsx)(n.default,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),(0,t.jsx)(n.default,{sx:{flex:1}}),(0,t.jsx)(c.default,{"aria-label":"Column options",className:"row-context-menu",size:"small",disabled:s.disableDatabaseQuery,onClick:e=>{l(e.currentTarget)},children:(0,t.jsx)(E.PiDotsThreeVertical,{})}),(0,t.jsxs)(h.default,{anchorEl:a,open:!!a,onClose:u,slotProps:{list:{sx:{lineHeight:"20px"}}},children:[(0,t.jsx)(d.default,{sx:{fontSize:"8pt",lineHeight:"20px"},children:"Action"}),(0,t.jsx)(f.default,{onClick:()=>{p({},{showForm:!0}),u()},sx:{fontSize:"10pt"},children:"Show mismatched values..."}),(0,t.jsxs)(f.default,{onClick:()=>{p({columns:[i]},{showForm:!1}),u()},sx:{fontSize:"10pt"},children:["Show mismatched values for '",i,"'"]})]})]})}function P({value:e}){let r="N/A";return null!=e&&(r=e>.9999&&e<1?"~99.99 %":e<1e-4&&e>0?"~0.01 %":`${(100*e).toFixed(2)} %`),(0,t.jsx)(n.default,{sx:{textAlign:"right"},children:r})}function T({row:e,column:n}){return(0,t.jsx)(P,{value:e[n.key]})}var R=e.i(196137);let I=[{key:"0",name:"Column",type:"text"},{key:"1",name:"Matched",type:"number"},{key:"2",name:"Matched %",type:"number"}];function D(e){let t=e["2"];return null!=t&&t<1?"diff-cell-modified":void 0}function L(e,n){let{params:r}=n,i=Array.isArray(r.primary_key)?r.primary_key:[r.primary_key],o={...e.data,columns:I};return{columns:[{key:"__is_pk__",name:"",width:30,maxWidth:30,renderCell:({row:e})=>(0,t.jsx)(M,{columnName:String(e["0"]),primaryKeys:i})},{key:"0",name:"Column",resizable:!0,renderCell:({row:e,column:n})=>(0,t.jsx)(A,{column:String(e[n.key]),params:r}),cellClass:"cell-show-context-menu"},{key:"1",name:"Matched",resizable:!0,cellClass:D},{key:"2",name:"Matched %",resizable:!0,renderCell:T,cellClass:D}],rows:(0,R.dataFrameToRowObjects)(o)}}e.i(848148);var j=e.i(840908),N=e.i(72039),F=e.i(882244),B=e.i(231076),z=e.i(622670);function V(e,t,n){(0,z.validateToValueDiffGridInputs)(e,t);let r=n?.pinnedColumns??[],i=n?.changedOnly??!1,o=n?.displayMode??"inline",s=n?.columnsRenderMode??{},a=(0,R.dataFrameToRowObjects)(e),l=(0,F.buildJoinedColumnMap)(e),u={},c={},d=(0,F.validatePrimaryKeys)(e.columns,t),h=l.in_a.key,f=l.in_b.key;a.forEach(t=>{let n=(0,F.getPrimaryKeyValue)(e.columns,d,t);t[h]&&(u[n.toLowerCase()]=t),t[f]&&(c[n.toLowerCase()]=t)});let{rows:p,rowStats:g}=(0,N.buildDiffRows)({baseMap:u,currentMap:c,baseColumns:e.columns,currentColumns:e.columns,columnMap:l,primaryKeys:t,changedOnly:i}),m=(0,B.getDisplayColumns)({columnMap:l,primaryKeys:t,pinnedColumns:r,columnsRenderMode:s,changedOnly:i,rowStats:g,excludeColumns:["in_a","in_b"],strictMode:!0}),{columns:v}=(0,j.buildDiffColumnDefinitions)({columns:m,displayMode:o,allowIndexFallback:!1,baseTitle:n?.baseTitle,currentTitle:n?.currentTitle,headerProps:{primaryKeys:t,pinnedColumns:r,onPinnedColumnsChange:n?.onPinnedColumnsChange,onColumnsRenderModeChanged:n?.onColumnsRenderModeChanged}});return{columns:v,rows:p}}function H(e){let t=e.current?.columns.find(e=>"column_name"===e.name.toLowerCase());return t?.name??"column_name"}function $(e,t={}){let n=function(e){if((0,i.isQueryRun)(e)||(0,i.isQueryBaseRun)(e))return e.result?{kind:"query",result:e.result}:null;if((0,i.isQueryDiffRun)(e))return e.result?e.result.diff&&e.params?.primary_keys?{kind:"query_diff_joined",result:e.result,primaryKeys:e.params.primary_keys}:{kind:"query_diff_separate",result:e.result}:null;if((0,i.isValueDiffRun)(e))return e.result&&e.params?{kind:"value_diff",result:e.result,params:e.params}:null;if((0,i.isValueDiffDetailRun)(e)){if(!e.result||!e.params?.primary_key)return null;let t=e.params.primary_key,n=Array.isArray(t)?t:[t];return{kind:"value_diff_detail",result:e.result,primaryKeys:n}}return(0,i.isProfileRun)(e)?e.result?.current?{kind:"profile",result:e.result}:null:(0,i.isProfileDiffRun)(e)?e.result?{kind:"profile_diff",result:e.result}:null:(0,i.isRowCountRun)(e)?e.result?{kind:"row_count",result:e.result}:null:(0,i.isRowCountDiffRun)(e)?e.result?{kind:"row_count_diff",result:e.result}:null:null}(e);if(!n)return null;switch(n.kind){case"query":return(0,s.toDataGrid)(n.result,{primaryKeys:t.primaryKeys,pinnedColumns:t.pinnedColumns,columnsRenderMode:t.columnsRenderMode,onPrimaryKeyChange:t.onPrimaryKeyChange,onPinnedColumnsChange:t.onPinnedColumnsChange,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged});case"query_diff_separate":return(0,o.toDataDiffGrid)(n.result.base,n.result.current,t);case"query_diff_joined":if(!n.result.diff)return null;return V(n.result.diff,n.primaryKeys,{changedOnly:t.changedOnly,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,baseTitle:t.baseTitle,currentTitle:t.currentTitle,displayMode:t.displayMode,columnsRenderMode:t.columnsRenderMode,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged});case"value_diff":return L(n.result,{params:n.params});case"value_diff_detail":return V(n.result,n.primaryKeys,{changedOnly:t.changedOnly,pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,displayMode:t.displayMode,columnsRenderMode:t.columnsRenderMode,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged});case"profile":{if(!n.result.current)return null;let e=H(n.result);return(0,s.toDataGrid)(n.result.current,{primaryKeys:[e],pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,columnsRenderMode:t.columnsRenderMode,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged})}case"profile_diff":{let e=H(n.result);return(0,o.toDataDiffGrid)(n.result.base,n.result.current,{primaryKeys:[e],pinnedColumns:t.pinnedColumns,onPinnedColumnsChange:t.onPinnedColumnsChange,displayMode:t.displayMode,columnsRenderMode:t.columnsRenderMode,onColumnsRenderModeChanged:t.onColumnsRenderModeChanged})}case"row_count":return(0,a.toRowCountDataGrid)(n.result);case"row_count_diff":return(0,l.toRowCountDiffDataGrid)(n.result);default:return null}}function W(e,n){switch(e.type){case"single":return(0,s.toDataGrid)(e.dataframe,n??{});case"dual":return(0,o.toDataDiffGrid)(e.base,e.current,n??{});case"joined":return V(e.dataframe,e.primaryKeys,n??{});case"schema_diff":return function(e,n={}){let{node:r,cllRunningMap:i,showMenu:o}=n;return{columns:[{key:"baseIndex",name:"",resizable:!0,minWidth:35,width:35,cellClass:S},{key:"currentIndex",name:"",resizable:!0,minWidth:35,width:35,cellClass:S},{key:"name",name:"Name",resizable:!0,renderCell:r?({row:e})=>(0,t.jsx)(_,{model:r,row:e,cllRunning:i?.get(e.name)??!1,showMenu:o}):void 0,cellClass:C},{key:"baseType",name:"Base Type",resizable:!0,cellClass:O},{key:"currentType",name:"Current Type",resizable:!0,cellClass:O}],rows:Object.values(e)}}(function(e={},t={}){let n={};Object.entries((0,k.mergeKeysWithStatus)(Object.keys(e),Object.keys(t))).forEach(([e,t])=>{n[e]={name:e,reordered:"reordered"===t,__status:void 0}});let r=0;return Object.entries(e).forEach(([e,t])=>{null!=t&&(n[e].baseIndex=r+=1,n[e].baseType=t.type)}),r=0,Object.entries(t).forEach(([e,t])=>{null!=t&&(n[e].currentIndex=r+=1,n[e].currentType=t.type)}),n}(e.base,e.current),n??{});case"schema_single":return function(e={},n={}){let{node:r,cllRunningMap:i,showMenu:o}=n;return{columns:[{key:"index",name:"",resizable:!0,minWidth:35,width:35,cellClass:"schema-column schema-column-index"},{key:"name",name:"Name",resizable:!0,renderCell:r?({row:e})=>(0,t.jsx)(_,{model:r,row:e,cllRunning:i?.get(e.name)??!1,singleEnv:!0,showMenu:o}):void 0,cellClass:"schema-column"},{key:"type",name:"Type",resizable:!0,cellClass:"schema-column"}],rows:Object.entries(e).filter(([e,t])=>null!=t).map(([e,t],n)=>({name:e,index:n+1,type:t.type,__status:void 0}))}}(e.columns,n??{})}}var U=e.i(427938),q=e.i(359761);let Q=(0,r.forwardRef)(({...e},n)=>(0,t.jsx)(q.DataGrid,{ref:n,className:e.className?e.className+" no-track-pii-safe":"no-track-pii-safe",rowClass:()=>"no-track-pii-safe",...e}));function K({emptyMessage:e}){return(0,t.jsx)(n.default,{sx:{display:"flex",height:"35px",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",textAlign:"center",gridColumn:"1/-1"},children:(0,t.jsx)(U.default,{sx:{fontWeight:600},children:e??"No rows"})})}e.s(["EmptyRowsRenderer",()=>K,"ScreenshotDataGrid",0,Q],162234);var G=e.i(76130);e.i(316575);var X=e.i(7284),Y=e.i(778024),Z=e.i(578509),J=e.i(446547),ee=e.i(73205),et=e.i(860223),en=e.i(519273),er=e.i(435983),ei=e.i(446519);function eo(e){return(0,ei.default)("MuiButtonGroup",e)}let es=(0,er.default)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]);var ea=e.i(464870),el=e.i(188556);let eu=(0,J.styled)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${es.grouped}`]:t.grouped},{[`& .${es.grouped}`]:t[`grouped${(0,Z.default)(n.orientation)}`]},{[`& .${es.grouped}`]:t[`grouped${(0,Z.default)(n.variant)}`]},{[`& .${es.grouped}`]:t[`grouped${(0,Z.default)(n.variant)}${(0,Z.default)(n.orientation)}`]},{[`& .${es.grouped}`]:t[`grouped${(0,Z.default)(n.variant)}${(0,Z.default)(n.color)}`]},{[`& .${es.firstButton}`]:t.firstButton},{[`& .${es.lastButton}`]:t.lastButton},{[`& .${es.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,ee.default)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${es.lastButton},& .${es.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${es.firstButton},& .${es.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${es.lastButton},& .${es.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderRight:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${es.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderBottom:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${es.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,et.default)()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderColor:e.alpha((e.vars||e).palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${es.lastButton},& .${es.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${es.lastButton},& .${es.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${es.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${es.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,et.default)(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${es.firstButton},& .${es.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${es.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),ec=r.forwardRef(function(e,n){let i=(0,en.useDefaultProps)({props:e,name:"MuiButtonGroup"}),{children:o,className:s,color:a="primary",component:l="div",disabled:u=!1,disableElevation:c=!1,disableFocusRipple:d=!1,disableRipple:h=!1,fullWidth:f=!1,orientation:p="horizontal",size:g="medium",variant:m="outlined",...v}=i,y={...i,color:a,component:l,disabled:u,disableElevation:c,disableFocusRipple:d,disableRipple:h,fullWidth:f,orientation:p,size:g,variant:m},b=(e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:o,orientation:s,variant:a}=e,l={root:["root",a,s,o&&"fullWidth",i&&"disableElevation",`color${(0,Z.default)(n)}`],grouped:["grouped",`grouped${(0,Z.default)(s)}`,`grouped${(0,Z.default)(a)}`,`grouped${(0,Z.default)(a)}${(0,Z.default)(s)}`,`grouped${(0,Z.default)(a)}${(0,Z.default)(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,Y.default)(l,eo,t)})(y),x=r.useMemo(()=>({className:b.grouped,color:a,disabled:u,disableElevation:c,disableFocusRipple:d,disableRipple:h,fullWidth:f,size:g,variant:m}),[a,u,c,d,h,f,g,m,b.grouped]),w=r.Children.toArray(o).filter(e=>r.isValidElement(e)),_=w.length;return(0,t.jsx)(eu,{as:l,role:"group",className:(0,X.default)(b.root,s),ref:n,ownerState:y,...v,children:(0,t.jsx)(ea.default.Provider,{value:x,children:w.map((e,n)=>{let r,i;return(0,t.jsx)(el.default.Provider,{value:(r=0===n,i=n===_-1,r&&i?"":r?b.firstButton:i?b.lastButton:b.middleButton),children:e},n)})})})});var ed=e.i(285297);let eh=({value:e,onChange:n,textOn:r,textOff:i})=>(0,t.jsxs)(ec,{variant:"outlined",size:"xsmall",sx:{borderRadius:1},children:[(0,t.jsx)(G.default,{onClick:()=>{n(!1)},sx:{color:e?"grey.400":"black",bgcolor:e?"grey.50":"white"},children:i??"Off"}),(0,t.jsx)(G.default,{onClick:()=>{n(!0)},sx:{color:e?"black":"grey.400",bgcolor:e?"white":"grey.50"},children:r??"On"})]}),ef=({displayMode:e,onDisplayModeChanged:n})=>(0,t.jsxs)(t.Fragment,{children:["inline"===e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ed.DiffText,{value:"Base",colorPalette:"red",grayOut:!1,fontSize:"10pt",noCopy:!0}),(0,t.jsx)(ed.DiffText,{value:"Current",colorPalette:"green",grayOut:!1,fontSize:"10pt",noCopy:!0})]}),(0,t.jsx)(eh,{value:"side_by_side"===e,onChange:e=>{n(e?"side_by_side":"inline")},textOff:"Inline",textOn:"Side by side"})]});e.s(["DiffDisplayModeSwitch",0,ef],543482);var ep=e.i(228337);let eg=({warnings:e,children:r})=>(0,t.jsxs)(n.default,{sx:{display:"flex",borderBottom:"1px solid lightgray",justifyContent:"flex-end",gap:"5px",alignItems:"center",px:"10px",bgcolor:e&&e.length>0?"amber.100":"inherit"},children:[(0,t.jsx)(n.default,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:0},children:e?.map(e=>(0,t.jsxs)(n.default,{children:[(0,t.jsx)(E.PiWarning,{color:"amber.600"})," ",e]},ep.default.uniqueId(`-${e}`)))}),(0,t.jsx)(n.default,{sx:{flex:1,minHeight:"32px"}}),r]});e.s(["RunToolbar",0,eg],412103);let em=(0,r.forwardRef)(({run:e,viewOptions:o,onViewOptionsChanged:s},a)=>{if(!(0,i.isProfileDiffRun)(e))throw Error("Only run type profile_diff is supported");let l=(0,r.useMemo)(()=>o?.pinned_columns??[],[o]),u=(0,r.useMemo)(()=>o?.display_mode??"inline",[o]),c=(0,r.useMemo)(()=>({distinct_proportion:"percent",not_null_proportion:"percent",...o?.columnsRenderMode}),[o]),d=(0,r.useMemo)(()=>$(e,{pinnedColumns:l,onPinnedColumnsChange:e=>{s&&s({...o,pinned_columns:e})},displayMode:u,columnsRenderMode:c,onColumnsRenderModeChanged:e=>{let t={...o?.columnsRenderMode??{},...e};s&&s({...o,columnsRenderMode:t})}})??{columns:[],rows:[]},[e,l,u,o,s,c]);return 0===d.columns.length?(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No data"}):(0,t.jsxs)(n.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,t.jsx)(eg,{run:e,children:(0,t.jsx)(ef,{displayMode:u,onDisplayModeChanged:e=>{s&&s({...o,display_mode:e})}})}),(0,t.jsx)(Q,{ref:a,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:d.columns,rows:d.rows,defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})]})}),ev=(0,r.forwardRef)(({run:e,viewOptions:o,onViewOptionsChanged:s},a)=>{if(!(0,i.isProfileRun)(e))throw Error("Only run type profile_diff is supported");let l=(0,r.useMemo)(()=>o?.pinned_columns??[],[o]),u=(0,r.useMemo)(()=>({distinct_proportion:"percent",not_null_proportion:"percent",...o?.columnsRenderMode}),[o]),c=(0,r.useMemo)(()=>$(e,{pinnedColumns:l,onPinnedColumnsChange:e=>{s&&s({...o,pinned_columns:e})},columnsRenderMode:u,onColumnsRenderModeChanged:e=>{let t={...o?.columnsRenderMode??{},...e};s&&s({...o,columnsRenderMode:t})}})??{columns:[],rows:[]},[e,l,o,s,u]);return 0===c.columns.length?(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No data"}):(0,t.jsx)(n.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:(0,t.jsx)(Q,{ref:a,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:c.columns,rows:c.rows,defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})})});e.s(["QueryDiffResultView",()=>ek],64485);var ey=e.i(562903),eb=e.i(233799);let ex=({changedOnly:e,onChange:n})=>(0,t.jsx)(eb.default,{control:(0,t.jsx)(ey.default,{checked:e??!1,onChange:()=>{n()},size:"small"}),label:"Changed only",slotProps:{typography:{variant:"body2"}}});e.s(["ChangedOnlyCheckbox",0,ex],51297);let ew=(0,r.forwardRef)(({run:e,onAddToChecklist:i,viewOptions:o,onViewOptionsChanged:s,baseTitle:a,currentTitle:l},u)=>{let c=(0,r.useMemo)(()=>o?.primary_keys??[],[o]),d=(0,r.useMemo)(()=>o?.changed_only??!1,[o]),h=(0,r.useMemo)(()=>o?.pinned_columns??[],[o]),f=(0,r.useMemo)(()=>o?.display_mode??"inline",[o]),p=(0,r.useMemo)(()=>o?.columnsRenderMode??{},[o]);if("query_diff"!==e.type)throw Error("QueryDiffResult view should be rendered as query_diff");let g=(0,r.useMemo)(()=>$(e,{changedOnly:d,onPrimaryKeyChange:e=>{s&&s({...o,primary_keys:e})},pinnedColumns:h,onPinnedColumnsChange:e=>{s&&s({...o,pinned_columns:e})},columnsRenderMode:p,onColumnsRenderModeChanged:e=>{let t={...o?.columnsRenderMode??{},...e};s&&s({...o,columnsRenderMode:t})},baseTitle:a,currentTitle:l,displayMode:f})??{columns:[],rows:[]},[e,o,d,h,f,s,a,l,p]),m=(0,r.useMemo)(()=>{let e=c.join(", ");return g.invalidPKeyBase&&g.invalidPKeyCurrent?`Warning: The primary key '${e}' is not unique in the base and current environments`:g.invalidPKeyBase?`Warning: The primary key '${e}' is not unique in the base environment`:g.invalidPKeyCurrent?`Warning: The primary key '${e}' is not unique in the current environment`:void 0},[g.invalidPKeyBase,g.invalidPKeyCurrent,c]),v=e.result?.current?.limit??0,y=v>0&&(e.result?.current?.more||e.result?.base?.more)?`Warning: Displayed results are limited to ${v.toLocaleString()} records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set.`:null,b=[];return(m&&b.push(m),y&&b.push(y),0===g.columns.length)?(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No data"}):(0,t.jsxs)(n.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,t.jsxs)(eg,{run:e,viewOptions:o,onViewOptionsChanged:s,warnings:b,children:[(0,t.jsx)(ef,{displayMode:f,onDisplayModeChanged:e=>{s&&s({...o,display_mode:e})}}),(0,t.jsx)(ex,{changedOnly:o?.changed_only,onChange:()=>{let e=!o?.changed_only;s&&s({...o,changed_only:e})}})]}),(0,t.jsx)(Q,{ref:u,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:g.columns,rows:g.rows,renderers:{noRowsFallback:(0,t.jsx)(K,{emptyMessage:"No mismatched rows"})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})]})}),e_=(0,r.forwardRef)(({run:e,viewOptions:i,onViewOptionsChanged:o,baseTitle:s,currentTitle:a},l)=>{if("query_diff"!==e.type)throw Error("QueryDiffResult view should be rendered as query_diff");let u=(0,r.useMemo)(()=>i?.changed_only??!1,[i]),c=(0,r.useMemo)(()=>i?.pinned_columns??[],[i]),d=(0,r.useMemo)(()=>i?.display_mode??"inline",[i]),h=(0,r.useMemo)(()=>i?.columnsRenderMode??{},[i]),f=(0,r.useMemo)(()=>$(e,{changedOnly:u,pinnedColumns:c,onPinnedColumnsChange:e=>{o&&o({...i,pinned_columns:e})},baseTitle:s,currentTitle:a,displayMode:d,columnsRenderMode:h,onColumnsRenderModeChanged:e=>{let t={...i?.columnsRenderMode??{},...e};o&&o({...i,columnsRenderMode:t})}})??{columns:[],rows:[]},[e,i,u,c,d,o,s,a,h]),p=e.result?.diff?.limit??0,g=p>0&&e.result?.diff?.more?`Warning: Displayed results are limited to ${p.toLocaleString()} records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set.`:null,m=[];return(g&&m.push(g),0===f.columns.length)?(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No data"}):u&&0===f.rows.length?(0,t.jsxs)(n.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,t.jsx)(eg,{run:e,viewOptions:i,onViewOptionsChanged:o,warnings:m}),(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No change"})]}):(0,t.jsxs)(n.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,t.jsxs)(eg,{run:e,viewOptions:i,onViewOptionsChanged:o,warnings:m,children:[(0,t.jsx)(ef,{displayMode:d,onDisplayModeChanged:e=>{o&&o({...i,display_mode:e})}}),(0,t.jsx)(ex,{changedOnly:i?.changed_only,onChange:()=>{let e=!i?.changed_only;o&&o({...i,changed_only:e})}})]}),(0,t.jsx)(Q,{ref:l,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:f.columns,rows:f.rows,renderers:{noRowsFallback:(0,t.jsx)(K,{emptyMessage:"No mismatched rows"})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})]})}),ek=(0,r.forwardRef)((e,n)=>{let r,i;return(e.run.params&&e.run.params.current_model&&(r="Original",i="Editor"),e.run.result&&"diff"in e.run.result&&null!=e.run.result.diff)?(0,t.jsx)(e_,{...e,ref:n,baseTitle:r,currentTitle:i}):(0,t.jsx)(ew,{...e,ref:n,baseTitle:r,currentTitle:i})});e.s(["QueryResultView",()=>eC],862031);var eS=e.i(336277);let eC=(0,r.forwardRef)(({run:e,viewOptions:o,onViewOptionsChanged:s,onAddToChecklist:a},l)=>{if(!((0,i.isQueryRun)(e)||(0,i.isQueryBaseRun)(e)))throw Error("run type must be query");let u=(0,r.useMemo)(()=>o?.pinned_columns??[],[o]),c=(0,r.useMemo)(()=>o?.columnsRenderMode??{},[o]),d=e.result,h=(0,r.useMemo)(()=>$(e,{pinnedColumns:u,onPinnedColumnsChange:e=>{s&&s({...o,pinned_columns:e})},columnsRenderMode:c,onColumnsRenderModeChanged:e=>{let t={...o?.columnsRenderMode??{},...e};s&&s({...o,columnsRenderMode:t})}})??{columns:[],rows:[]},[e,u,o,s,c]);if(0===h.columns.length)return(0,t.jsx)(n.default,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:"No data"});let f=d?d.limit??0:0,p=f>0&&d?.more?`Warning: Displayed results are limited to ${f.toLocaleString()} records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set.`:null,g=a??p;return(0,t.jsxs)(eS.default,{sx:{bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[g&&(0,t.jsxs)(eS.default,{direction:"row",sx:{borderBottom:"1px solid lightgray",alignItems:"center",gap:"5px",px:"10px",bgcolor:p?"amber.100":"inherit"},children:[p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{component:E.PiWarning,sx:{color:"amber.600",alignSelf:"center"}})," ",(0,t.jsx)(n.default,{children:p})]}),(0,t.jsx)(n.default,{sx:{flexGrow:1,minHeight:"32px"}}),a&&(0,t.jsx)(G.default,{sx:{my:"5px"},size:"small",color:"iochmara",variant:"contained",onClick:()=>{a(e)},children:"Add to Checklist"})]}),(0,t.jsx)(Q,{ref:l,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:h.columns,rows:h.rows,renderers:{noRowsFallback:(0,t.jsx)(K,{})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})]})});e.s(["RowCountDiffResultView",()=>eE,"RowCountResultView",()=>eM],522430);let eO=(0,r.forwardRef)(function({run:e,typeGuard:i,expectedType:o},s){if(!i(e))throw Error(`Run type must be ${o}`);let a=(0,r.useMemo)(()=>$(e)??{columns:[],rows:[]},[e]);return 0===a.rows.length?(0,t.jsx)(n.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"rgb(249,249,249)",height:"100%"},children:"No nodes matched"}):(0,t.jsx)(n.default,{sx:{display:"flex",flexDirection:"column"},children:(0,t.jsx)(Q,{ref:s,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",fontSize:"0.875rem",borderWidth:1},columns:a.columns,rows:a.rows,renderers:{noRowsFallback:(0,t.jsx)(K,{})},className:"rdg-light"})})}),eE=(0,r.forwardRef)(function({run:e},n){return(0,t.jsx)(eO,{ref:n,run:e,typeGuard:i.isRowCountDiffRun,expectedType:"row_count_diff"})}),eM=(0,r.forwardRef)(function({run:e},n){return(0,t.jsx)(eO,{ref:n,run:e,typeGuard:i.isRowCountRun,expectedType:"row_count"})});var eA=e.i(992089),eP=e.i(384339),eT=e.i(320182),eR=e.i(400905);function eI({params:e,onParamsChanged:i,setIsReadyToExecute:o}){let{columns:s,isLoading:a,error:l}=(0,eR.default)(e.model),u=s.map(e=>e.name);return((0,r.useEffect)(()=>{o(!!e.column_name)},[e,o]),a)?(0,t.jsx)(n.default,{children:"Loading..."}):0===u.length||l?(0,t.jsx)(n.default,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,t.jsx)(n.default,{sx:{m:"16px"},children:(0,t.jsxs)(eA.default,{fullWidth:!0,children:[(0,t.jsx)(eP.default,{sx:{mb:1},children:"Pick a column to show top-k"}),(0,t.jsxs)(eT.default,{value:e.column_name,onChange:t=>{let n=t.target.value;i({...e,column_name:n})},children:[(0,t.jsx)("option",{value:"",children:"Select column"}),u.map(e=>(0,t.jsx)("option",{value:e,className:"no-track-pii-safe",children:e},e))]})]})})}e.s(["TopKDiffForm",()=>eI],940159)},610985,e=>{"use strict";var t=e.i(187725),n=e.i(7284),r=e.i(778024),i=e.i(446547),o=e.i(73205),s=e.i(519273),a=e.i(332397),l=e.i(19483);let u=(0,i.styled)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((0,o.default)(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.alpha((e.vars||e).palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&"vertical"!==e.orientation,style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>"vertical"===e.orientation&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>"right"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>"left"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),c=(0,i.styled)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((0,o.default)(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),d=t.forwardRef(function(e,t){let i=(0,s.useDefaultProps)({props:e,name:"MuiDivider"}),{absolute:o=!1,children:d,className:h,orientation:f="horizontal",component:p=d||"vertical"===f?"div":"hr",flexItem:g=!1,light:m=!1,role:v="hr"!==p?"separator":void 0,textAlign:y="center",variant:b="fullWidth",...x}=i,w={...i,absolute:o,component:p,flexItem:g,light:m,orientation:f,role:v,textAlign:y,variant:b},_=(e=>{let{absolute:t,children:n,classes:i,flexItem:o,light:s,orientation:l,textAlign:u,variant:c}=e;return(0,r.default)({root:["root",t&&"absolute",c,s&&"light","vertical"===l&&"vertical",o&&"flexItem",n&&"withChildren",n&&"vertical"===l&&"withChildrenVertical","right"===u&&"vertical"!==l&&"textAlignRight","left"===u&&"vertical"!==l&&"textAlignLeft"],wrapper:["wrapper","vertical"===l&&"wrapperVertical"]},a.getDividerUtilityClass,i)})(w);return(0,l.jsx)(u,{as:p,className:(0,n.default)(_.root,h),role:v,ref:t,ownerState:w,"aria-orientation":"separator"===v&&("hr"!==p||"vertical"===f)?f:void 0,...x,children:d?(0,l.jsx)(c,{className:_.wrapper,ownerState:w,children:d}):null})});d&&(d.muiSkipListHighlight=!0),e.s(["default",0,d])},372230,49931,e=>{"use strict";e.s(["findByRunType",()=>Q,"runTypeHasRef",()=>U],372230);var t=e.i(901407),n=e.i(897716),r=e.i(21292),i=e.i(645364),o=e.i(353406),s=e.i(909411),a=e.i(757980),l=e.i(64485),u=e.i(862031),c=e.i(522430),d=e.i(940159),h=e.i(19483),f=e.i(324066),p=e.i(939338),g=e.i(336277),m=e.i(427938),v=e.i(187725),y=e.i(610985),b=e.i(197068),x=e.i(573478),w=e.i(520584),_=e.i(122429),k=e.i(665521);let S="#63B3ED";function C(e,t){let n=t?10:e.counts.length,r=e.counts.slice(0,n),i=e.valids-r.reduce((e,t)=>e+t,0);return e.values.slice(0,n).concat([i]).map((t,n)=>{let o,s=n===r.length,a=s?i:r[n],l=!1;return s?(o="(others)",l=!0):null==t?(o="(null)",l=!0):"string"==typeof t&&0===t.length?(o="(empty)",l=!0):o=String(t),{isLastItemOthers:s,isSpecialLabel:l,label:o,count:a,displayCount:(0,_.formatAsAbbreviatedNumber)(a),displayRatio:(0,_.formatIntervalMinMax)(a/e.valids)??"N/A"}})}function O({base:e,current:t,children:n}){return(0,h.jsx)(b.default,{title:(0,h.jsxs)(f.default,{children:[(0,h.jsxs)(m.default,{children:[(0,h.jsx)(k.SquareIcon,{color:k.CURRENT_BAR_COLOR}),"Current: ",t.count," (",t.displayRatio,")"]}),(0,h.jsxs)(m.default,{children:[(0,h.jsx)(k.SquareIcon,{color:k.BASE_BAR_COLOR}),"Base: ",e.count," (",e.displayRatio,")"]})]}),arrow:!0,children:(0,h.jsx)("span",{children:n})})}function E({topKDiff:e,isDisplayTopTen:t}){let n=C(e.current,t),r=C(e.base,t);return(0,h.jsxs)(f.default,{sx:{width:"100%",px:20,py:2},children:[(0,h.jsxs)(f.default,{sx:{display:"flex",alignItems:"center",flexDirection:"row"},children:[(0,h.jsx)(f.default,{sx:{flex:1}}),(0,h.jsxs)(m.default,{component:"h3",sx:{fontSize:"0.875rem",p:1,color:"gray"},children:[(0,h.jsx)(k.SquareIcon,{color:k.BASE_BAR_COLOR})," Base"]}),(0,h.jsxs)(m.default,{component:"h3",sx:{fontSize:"0.875rem",p:1,color:"gray"},children:[(0,h.jsx)(k.SquareIcon,{color:k.CURRENT_BAR_COLOR})," Current"]}),(0,h.jsx)(f.default,{sx:{flex:1}})]}),n.map((t,n)=>{let i=r[n];return t.isLastItemOthers&&0===t.count&&0===i.count?(0,h.jsx)(h.Fragment,{}):(0,h.jsxs)(v.Fragment,{children:[(0,h.jsx)(O,{base:i,current:t,children:(0,h.jsxs)(f.default,{sx:{display:"flex",alignItems:"center",width:"100%","&:hover":{bgcolor:"action.hover"},px:2},children:[(0,h.jsx)(m.default,{sx:{width:"10em",fontSize:"0.875rem",color:t.isSpecialLabel?"grey.400":"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),(0,h.jsxs)(f.default,{sx:{display:"flex",width:"70%",flexDirection:"column"},children:[(0,h.jsxs)(f.default,{sx:{display:"flex",height:"1em"},children:[(0,h.jsx)(M,{topkCount:t.count,topkLabel:t.label,valids:e.current.valids,color:k.CURRENT_BAR_COLOR}),(0,h.jsx)(m.default,{sx:{ml:2.5,mr:1,fontSize:"0.875rem",width:"6em"},children:t.displayCount}),(0,h.jsx)(m.default,{sx:{color:"grey.400",fontSize:"0.875rem",width:"4em"},children:t.displayRatio})]}),(0,h.jsxs)(f.default,{sx:{display:"flex",height:"1em"},children:[(0,h.jsx)(M,{topkCount:i.count,topkLabel:i.label,valids:e.base.valids,color:k.BASE_BAR_COLOR}),(0,h.jsx)(m.default,{sx:{ml:2.5,mr:1,fontSize:"0.875rem",width:"6em"},children:i.displayCount}),(0,h.jsx)(m.default,{sx:{color:"grey.400",fontSize:"0.875rem",width:"4em"},children:i.displayRatio})]})]})]})}),(0,h.jsx)(y.default,{})]},t.label)})]})}function M({topkCount:e,topkLabel:t,valids:n,animation:r=!1,color:i=S}){x.Chart.register(x.CategoryScale,x.BarElement,x.LinearScale);let o=function(e,t,{...n}={}){return{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",scales:{x:{display:!1,max:t,grid:{display:!1}},y:{display:!1}},plugins:{tooltip:{enabled:!1}},...n}}(0,n,{animation:r}),s=function({topkLabel:e,topkCount:t,color:n=S}){return{labels:[e],datasets:[{indexAxis:"y",data:[t],backgroundColor:n,hoverBackgroundColor:n,borderWidth:0,borderColor:n,barPercentage:1,categoryPercentage:.6}]}}({topkCount:e,topkLabel:t,color:i});return(0,h.jsx)(w.Bar,{data:s,options:o,plugins:[]})}var A=e.i(660844);let P=(0,v.forwardRef)(({run:e},t)=>{let[n,r]=(0,v.useState)(!0),i=e.result,o=e.params,s=i.base,a=i.current;return(0,h.jsxs)(f.default,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,h.jsxs)(A.ScreenshotBox,{ref:t,blockSize:"auto",children:[(0,h.jsxs)(m.default,{variant:"h5",sx:{pt:4,textAlign:"center",color:"grey.600"},children:["Model ",o.model,".",o.column_name]}),(0,h.jsxs)(g.default,{direction:"row",alignItems:"center",children:[(0,h.jsx)(f.default,{sx:{flex:1}}),(0,h.jsx)(E,{topKDiff:i,valids:a.valids||0,isDisplayTopTen:n}),(0,h.jsx)(f.default,{sx:{flex:1}})]})]}),(0,h.jsx)(f.default,{sx:{flex:1}}),(s.values.length>10||a.values.length>10)&&(0,h.jsx)(f.default,{sx:{display:"flex",p:5,justifyContent:"start"},children:(0,h.jsx)(p.default,{component:"button",onClick:()=>{r(e=>!e)},sx:{color:"iochmara.main",cursor:"pointer"},children:n?"View More Items":"View Only Top-10"})})]})});var T=e.i(862754),R=e.i(716396),I=e.i(162234),D=e.i(51297),L=e.i(543482),j=e.i(412103);let N=(0,v.forwardRef)(({run:e,onAddToChecklist:t,viewOptions:n,onViewOptionsChanged:r},i)=>{if(!(0,T.isValueDiffDetailRun)(e))throw Error("run type must be value_diff_detail");let o=(0,v.useMemo)(()=>n?.changed_only??!1,[n]),s=(0,v.useMemo)(()=>n?.pinned_columns??[],[n]),a=(0,v.useMemo)(()=>n?.display_mode??"inline",[n]),l=(0,v.useMemo)(()=>n?.columnsRenderMode??{},[n]),u=(0,v.useMemo)(()=>(0,R.createDataGrid)(e,{changedOnly:o,pinnedColumns:s,onPinnedColumnsChange:e=>{r&&r({...n,pinned_columns:e})},columnsRenderMode:l,onColumnsRenderModeChanged:e=>{let t={...n?.columnsRenderMode??{},...e};r&&r({...n,columnsRenderMode:t})},displayMode:a})??{columns:[],rows:[]},[e,n,o,s,a,r,l]),c=e.result?.limit??0,d=c>0&&e.result?.more?`Warning: Displayed results are limited to ${c.toLocaleString()} records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set.`:null,p=[];return(d&&p.push(d),0===u.columns.length)?(0,h.jsx)(f.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No data"}):o&&0===u.rows.length?(0,h.jsxs)(f.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,h.jsx)(j.RunToolbar,{run:e,viewOptions:n,onViewOptionsChanged:r,warnings:p}),(0,h.jsx)(f.default,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:"No change"})]}):(0,h.jsxs)(f.default,{sx:{display:"flex",flexDirection:"column",bgcolor:"rgb(249, 249, 249)",height:"100%"},children:[(0,h.jsxs)(j.RunToolbar,{run:e,viewOptions:n,onViewOptionsChanged:r,warnings:p,children:[(0,h.jsx)(L.DiffDisplayModeSwitch,{displayMode:a,onDisplayModeChanged:e=>{r&&r({...n,display_mode:e})}}),(0,h.jsx)(D.ChangedOnlyCheckbox,{changedOnly:n?.changed_only,onChange:()=>{let e=!n?.changed_only;r&&r({...n,changed_only:e})}})]}),(0,h.jsx)(I.ScreenshotDataGrid,{ref:i,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:u.columns,rows:u.rows,renderers:{noRowsFallback:(0,h.jsx)(I.EmptyRowsRenderer,{emptyMessage:"No mismatched rows"})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light"})]})});var F=e.i(562903),B=e.i(233799),z=e.i(664766),V=e.i(497647),H=e.i(400905);function $({params:e,onParamsChanged:t,setIsReadyToExecute:n}){let[r,i]=(0,v.useState)(!e.columns||0===e.columns.length),o=e.model,s=e.primary_key,{columns:a,primaryKey:l,isLoading:u,error:c}=(0,H.default)(e.model);(0,v.useEffect)(()=>{!s&&l&&t({...e,primary_key:l})},[s,l,e,t]),(0,v.useEffect)(()=>{n(!!(s&&o))},[s,o,n]);let d=a.map(e=>e.name),p=Array.isArray(s)?s:s?[s]:void 0;return u?(0,h.jsx)(f.default,{children:"Loading..."}):0===d.length||c?(0,h.jsx)(f.default,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,h.jsxs)(g.default,{spacing:5,sx:{m:"8px 24px",pb:"200px"},children:[(0,h.jsxs)(f.default,{children:[(0,h.jsx)(m.default,{variant:"body2",sx:{mb:1},children:"Model"}),(0,h.jsx)(z.default,{fullWidth:!0,size:"small",value:e.model,slotProps:{input:{readOnly:!0}}})]}),(0,h.jsxs)(f.default,{children:[(0,h.jsx)(m.default,{variant:"body2",sx:{mb:1},children:"Primary key"}),(0,h.jsx)(V.default,{placeholder:"Select primary key",className:"no-track-pii-safe",isMulti:!0,closeMenuOnSelect:!1,options:d.map(e=>({label:e,value:e})),value:(p??[]).filter(e=>void 0!==e).map(e=>({label:e,value:e})),onChange:n=>{let r=Array.isArray(n)?n:[];t({...e,primary_key:1==r.length?r[0].value:r.map(e=>e.value)})},styles:{container:e=>({...e,width:"100%"}),control:e=>({...e,minHeight:"40px"})}})]}),(0,h.jsxs)(f.default,{children:[(0,h.jsx)(m.default,{variant:"body2",sx:{mb:1},children:"Columns"}),(0,h.jsx)(B.default,{control:(0,h.jsx)(F.default,{checked:r,onChange:n=>{i(n.target.checked),t({...e,columns:void 0})},size:"small"}),label:"All columns",sx:{mb:"10px"}}),!r&&(0,h.jsx)(V.default,{isMulti:!0,className:"no-track-pii-safe",closeMenuOnSelect:!1,options:d.map(e=>({label:e,value:e})),value:(e.columns??[]).map(e=>({label:e,value:e})),onChange:n=>{let r,i=Array.isArray(n)?n.map(e=>e.value):[];r=0===i.length?void 0:i,t({...e,columns:r})},styles:{container:e=>({...e,width:"100%"}),control:e=>({...e,minHeight:"40px"})}})]})]})}e.s([],49931),e.i(913599),e.i(830055),e.i(490395),e.i(603634);let W=(0,v.forwardRef)(function({run:e},t){if(!(0,T.isValueDiffRun)(e))throw Error("Run type must be value_diff");let n=e.result,r=e.params,i=(0,R.createDataGrid)(e);if(!i)return null;let{columns:o,rows:s}=i;return(0,h.jsxs)(f.default,{sx:{display:"flex",flexDirection:"column",gap:"5px",pt:"5px",height:"100%"},children:[(0,h.jsxs)(f.default,{sx:{px:"16px"},children:["Model: ",r.model,", ",n.summary.total," total (",n.summary.total-n.summary.added-n.summary.removed," ","common, ",n.summary.added," added, ",n.summary.removed," removed)"]}),(0,h.jsx)(I.ScreenshotDataGrid,{ref:t,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",borderBlock:"1px solid lightgray"},columns:o,rows:s,renderers:{noRowsFallback:(0,h.jsx)(I.EmptyRowsRenderer,{})},defaultColumnOptions:{resizable:!0},className:"rdg-light"})]})});function U(e){return["query","query_base","query_diff","row_count","row_count_diff","profile","profile_diff","value_diff","value_diff_detail","top_k_diff","histogram_diff"].includes(e)}let q={lineage_diff:{title:"Lineage Diff",icon:r.TbBrandStackshare},schema_diff:{title:"Schema Diff",icon:n.MdSchema},query:{title:"Query",icon:r.TbSql,RunResultView:u.QueryResultView},query_base:{title:"Query Base",icon:r.TbSql,RunResultView:u.QueryResultView},query_diff:{title:"Query Diff",icon:r.TbSql,RunResultView:l.QueryDiffResultView},row_count:{title:"Row Count",icon:n.MdFormatListNumberedRtl,RunResultView:c.RowCountResultView},row_count_diff:{title:"Row Count Diff",icon:n.MdFormatListNumberedRtl,RunResultView:c.RowCountDiffResultView},profile:{title:"Profile",icon:r.TbEyeSearch,RunResultView:a.ProfileResultView,RunForm:s.ProfileDiffForm},profile_diff:{title:"Profile Diff",icon:r.TbEyeSearch,RunResultView:a.ProfileDiffResultView,RunForm:s.ProfileDiffForm},value_diff:{title:"Value Diff",icon:r.TbAlignBoxLeftStretch,RunResultView:W,RunForm:$},value_diff_detail:{title:"Value Diff Detail",icon:r.TbAlignBoxLeftStretch,RunResultView:N,RunForm:$},top_k_diff:{title:"Top-K Diff",icon:t.LuChartBarBig,RunResultView:P,RunForm:d.TopKDiffForm},histogram_diff:{title:"Histogram Diff",icon:r.TbChartHistogram,RunResultView:o.HistogramDiffResultView,RunForm:i.HistogramDiffForm},sandbox:{title:"Sandbox",icon:r.TbEyeEdit},simple:{title:"Simple",icon:r.TbEyeEdit}},Q=e=>q[e]},505251,e=>{"use strict";var t=e.i(659004),n=e.i(187725);function r(){let e=(0,t.useRouter)();return[(0,t.usePathname)(),(0,n.useCallback)((t,n)=>{n?.replace?e.replace(t,{scroll:n?.scroll??!0}):e.push(t,{scroll:n?.scroll??!0})},[e])]}e.s(["useAppLocation",()=>r])},29134,e=>{"use strict";e.s(["RecceActionContextProvider",()=>h,"useRecceActionContext",()=>f]);var t=e.i(19483),n=e.i(63257),r=e.i(659004),i=e.i(187725),o=e.i(976452),s=e.i(372230),a=e.i(377855),l=e.i(505251),u=e.i(407101),c=e.i(461566);let d=(0,i.createContext)({runAction:()=>{},showRunId:e=>{},isRunResultOpen:!1,closeRunResult:()=>{},isHistoryOpen:!1,closeHistory:()=>{},showHistory:()=>{},setHistoryOpen:e=>{},clearRunResult:()=>{}});function h({children:e}){let h,[f,p]=(0,i.useState)(),[g,m]=(0,i.useState)(!1),v=(0,i.useCallback)(()=>m(!0),[]),y=(0,i.useCallback)(()=>m(!1),[]),[b,x]=(0,i.useState)(!1),w=(0,i.useCallback)(()=>x(!0),[]),_=(0,i.useCallback)(()=>x(!1),[]),[k,S]=(0,i.useState)(!1),C=(0,i.useCallback)(()=>S(!0),[]),O=(0,i.useCallback)(()=>S(!1),[]),[E,M]=(0,i.useState)(),[A,P]=(0,l.useAppLocation)(),T=(0,n.useQueryClient)(),R=(0,i.useCallback)(async(e,t)=>{M(e),w(),!1!==t&&await T.invalidateQueries({queryKey:u.cacheKeys.runs()})},[w,T]),I=(0,i.useCallback)(()=>{M(void 0),_()},[_]),D=(0,i.useCallback)(async(e,t,n)=>{try{let r,i=new Date().getTime().toString();if(n?.showLast){let n=await (0,c.searchRuns)(e,t,1);1===n.length&&(r=n[0])}let o=(0,s.findByRunType)(e),a=o.RunResultView,{title:l,RunForm:d}=o;if(void 0===a)throw Error(`Run type ${e} does not have a result view`);if(void 0!=d&&n?.showForm)p({session:i,title:l,type:e,params:t,lastRun:r,options:n,RunForm:d}),v();else{let{run_id:r}=await (0,c.submitRun)(e,t,{nowait:!0,trackProps:n?.trackProps});await R(r),await T.invalidateQueries({queryKey:u.cacheKeys.runs()}),A.startsWith("/lineage")&&P("/lineage")}}catch(e){a.toaster.create({title:"Failed to submit a run",description:e instanceof Error?e.message:void 0,type:"error",duration:5e3,closable:!0})}},[v,R,A,P,T]);h=(0,r.usePathname)(),(0,i.useEffect)(()=>{y()},[y,h]);let L=async(e,t)=>{try{y();let{run_id:n}=await (0,c.submitRun)(e,t,{nowait:!0,trackProps:f?.options?.trackProps});await R(n)}catch(e){a.toaster.create({title:"Failed to submit a run",description:e instanceof Error?e.message:void 0,type:"error",duration:5e3,closable:!0})}};return(0,t.jsxs)(d.Provider,{value:{runAction:D,runId:E,showRunId:R,isRunResultOpen:b,closeRunResult:_,isHistoryOpen:k,closeHistory:O,showHistory:C,setHistoryOpen:S,clearRunResult:I},children:[f&&(0,t.jsx)(o.RunModal,{isOpen:g,onClose:y,onExecute:L,title:f.title,type:f.type,params:f.params,initialRun:f.lastRun,RunForm:f.options?.showForm&&f.RunForm?f.RunForm:void 0},f.session),e]})}let f=()=>(0,i.useContext)(d)},475119,e=>{"use strict";var t=e.i(19483),n=e.i(187725);let r='select * from {{ ref("mymodel") }}',i=(0,n.createContext)({sqlQuery:r,setSqlQuery:()=>{},primaryKeys:void 0,setPrimaryKeys:()=>{},isCustomQueries:!1,setCustomQueries:()=>{},baseSqlQuery:r,setBaseSqlQuery:()=>{}});function o({children:e}){let[o,s]=n.default.useState(r),[a,l]=n.default.useState(r),[u,c]=n.default.useState(!1),[d,h]=n.default.useState();return(0,t.jsx)(i.Provider,{value:{setSqlQuery:s,sqlQuery:o,setPrimaryKeys:h,primaryKeys:d,isCustomQueries:u,setCustomQueries:c,baseSqlQuery:a,setBaseSqlQuery:l},children:e})}let s=(0,n.createContext)({isNodesFetching:[],setIsNodesFetching:()=>{}});function a({children:e}){let[r,i]=n.default.useState([]);return(0,t.jsx)(s.Provider,{value:{isNodesFetching:r,setIsNodesFetching:i},children:e})}e.s(["RecceQueryContextProvider",()=>o,"RowCountStateContextProvider",()=>a,"defaultSqlQuery",0,r,"useRecceQueryContext",0,()=>(0,n.useContext)(i)])},909139,750060,113145,e=>{"use strict";let t,n,r;var i,o,s,a,l,u,c,d,h=e.i(19483);let f=0;class p{constructor(e,t){this.from=e,this.to=t}}class g{constructor(e={}){this.id=f++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=y.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}g.closedBy=new g({deserialize:e=>e.split(" ")}),g.openedBy=new g({deserialize:e=>e.split(" ")}),g.group=new g({deserialize:e=>e.split(" ")}),g.isolate=new g({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),g.contextHash=new g({perNode:!0}),g.lookAhead=new g({perNode:!0}),g.mounted=new g({perNode:!0});class m{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[g.mounted.id]}}let v=Object.create(null);class y{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):v,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),r=new y(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(g.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(g.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}y.none=new y("",Object.create(null),0,8);class b{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],i=e[0];i.combine&&i.id in r&&(t=i.combine(r[i.id],t)),r[i.id]=t}}t.push(r?new y(n.name,r,n.id,n.flags):n)}return new b(t)}}let x=new WeakMap,w=new WeakMap;(i=c||(c={}))[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays";class _{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=m.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new L(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new L(x.get(this)||this.topNode);return r.moveTo(e,t),x.set(this,r._tree),r}get topNode(){return new M(this,0,0,null)}resolve(e,t=0){let n=O(x.get(this)||this.topNode,e,t,!1);return x.set(this,n),n}resolveInner(e,t=0){let n=O(w.get(this)||this.topNode,e,t,!0);return w.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof M?r:r.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(i||(i=[r])).push(o.resolve(t,n)),e=o}else{let o=m.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new M(o.tree,o.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(O(s,t,n,!1))}}return i?I(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,o=e.mode||0,s=(o&c.IncludeAnonymous)>0;for(let e=this.cursor(o|c.IncludeAnonymous);;){let o=!1;if(e.from<=i&&e.to>=r&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:B(y.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new _(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new _(y.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=1024,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new k(n,n.length):n,l=r.types,u=0,c=0;function d(e,t,n,i,o,s,a,l,u){let c=[],d=[];for(;e.length>i;)c.push(e.pop()),d.push(t.pop()+n-o);e.push(h(r.types[a],c,d,s-o,l-s,u)),t.push(o-n)}function h(e,t,n,r,i,o,s){if(o){let e=[g.contextHash,o];s=s?[e].concat(s):[e]}if(i>25){let e=[g.lookAhead,i];s=s?[e].concat(s):[e]}return new _(e,t,n,r,s)}let f=[],p=[];for(;a.pos>0;)!function e(t,n,f,p,m,v){let{id:y,start:b,end:x,size:w}=a,k=c,C=u;if(w<0){if(a.next(),-1==w){let e=o[y];f.push(e),p.push(b-t);return}if(-3==w){u=y;return}if(-4==w){c=y;return}else throw RangeError(`Unrecognized record size: ${w}`)}let O=l[y],E,M,A=b-t;if(x-b<=i&&(M=function(e,t){let n=a.fork(),r=0,o=0,l=0,u=n.end-i,c={size:0,start:0,skip:0};t:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=o,c.skip=l,l+=4,r+=4,n.next();continue}let a=n.pos-e;if(e<0||a<i||n.start<u)break;let d=4*(n.id>=s),h=n.start;for(n.next();n.pos>a;){if(n.size<0)if(-3==n.size||-4==n.size)d+=4;else break t;else n.id>=s&&(d+=4);n.next()}o=h,r+=e,l+=d}return(t<0||r==e)&&(c.size=r,c.start=o,c.skip=l),c.size>4?c:void 0}(a.pos-n,m))){let e=new Uint16Array(M.size-M.skip),n=a.pos-M.size,i=e.length;for(;a.pos>n;)i=function e(t,n,r){let{id:i,start:o,end:l,size:d}=a;if(a.next(),d>=0&&i<s){let s=r;if(d>4){let i=a.pos-(d-4);for(;a.pos>i;)r=e(t,n,r)}n[--r]=s,n[--r]=l-t,n[--r]=o-t,n[--r]=i}else -3==d?u=i:-4==d&&(c=i);return r}(M.start,e,i);E=new S(e,x-M.start,r),A=M.start-t}else{let t=a.pos-w;a.next();let n=[],o=[],l=y>=s?y:-1,u=0,c=x;for(;a.pos>t;)l>=0&&a.id==l&&a.size>=0?(a.end<=c-i&&(d(n,o,b,u,a.end,c,l,k,C),u=n.length,c=a.end),a.next()):v>2500?function(e,t,n,o){let s=[],l=0,u=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:r}=a;if(r>4)a.next();else if(u>-1&&t<u)break;else u<0&&(u=n-i),s.push(e,t,n),l++,a.next()}if(l){let t=new Uint16Array(4*l),i=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-i,t[n++]=s[e+2]-i,t[n++]=n;n.push(new S(t,s[2]-i,r)),o.push(i-e)}}(b,t,n,o):e(b,t,n,o,l,v+1);if(l>=0&&u>0&&u<n.length&&d(n,o,b,u,b,c,l,k,C),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,r,i)=>{let o=0,s=n.length-1,a,l;if(s>=0&&(a=n[s])instanceof _){if(!s&&a.type==e&&a.length==i)return a;(l=a.prop(g.lookAhead))&&(o=r[s]+a.length+l)}return h(e,n,r,i,o,t)}}(O,C);E=B(O,n,o,0,n.length,0,x-b,e,e)}else E=h(O,n,o,x-b,k-x,C)}f.push(E),p.push(A)}(e.start||0,e.bufferStart||0,f,p,-1,0);let m=null!=(t=e.length)?t:f.length?p[0]+f[0].length:0;return new _(l[e.topID],f.reverse(),p.reverse(),m)}(e)}}_.empty=new _(y.none,[],[],0);class k{constructor(e,t){this.buffer=e,this.index=t}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 k(this.buffer,this.index)}}class S{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return y.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,n,r,i){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&(!C(i,r,o[a+1],o[a+2])||(s=a,!(n>0)));a=o[a+3]);return s}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){i[a++]=r[s++],i[a++]=r[s++]-n;let t=i[a++]=r[s++]-n;i[a++]=r[s++]-e,o=Math.max(o,t)}return new S(i,o,this.set)}}function C(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function O(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof M&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:c.IgnoreOverlays;if(r)for(let r=e,s=r.parent;s;s=(r=s).parent)r instanceof M&&r.index<0&&(null==(i=s.enter(t,n,o))?void 0:i.from)!=r.from&&(e=s);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class E{cursor(e=0){return new L(this,e)}getChild(e,t=null,n=null){let r=A(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return A(this,e,t,n)}resolve(e,t=0){return O(this,e,t,!1)}resolveInner(e,t=0){return O(this,e,t,!0)}matchContext(e){return P(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class M extends E{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,i=0){for(let o=this;;){for(let{children:s,positions:a}=o._tree,l=t>0?s.length:-1;e!=l;e+=t){let l=s[e],u=a[e]+o.from;if(C(r,n,u,u+l.length)){if(l instanceof S){if(i&c.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,t,n-u,r);if(s>-1)return new R(new T(o,l,e,u),null,s)}else if(i&c.IncludeAnonymous||!l.type.isAnonymous||j(l)){let s;if(!(i&c.IgnoreMounts)&&(s=m.get(l))&&!s.overlay)return new M(s.tree,u,e,o);let a=new M(l,u,e,o);return i&c.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,n,r)}}}if(i&c.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))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,t,n=0){let r;if(!(n&c.IgnoreOverlays)&&(r=m.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:i}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?i>=n:i>n))return new M(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 A(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return o}for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function P(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class T{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class R extends E{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,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new R(this.context,this,i)}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,t,n=0){if(n&c.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new R(this.context,this,i)}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,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new R(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new R(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new _(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function I(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof M&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new D(i,n)}class D{constructor(e,t){this.heads=e,this.node=t}get next(){return I(this.heads)}}class L{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof M)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof M?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}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,t,n=this.mode){return this.buffer?!(n&c.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&c.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&c.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));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&c.IncludeAnonymous||e instanceof S||!e.type.isAnonymous||j(e))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)t:for(let r=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break t}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new R(this.buffer,t,this.stack[e]);return this.bufferNode=new R(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return P(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return P(this._tree,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function j(e){return e.children.some(e=>e instanceof S||!e.type.isAnonymous||j(e))}let N=new WeakMap;function F(e,t){if(!e.isAnonymous||t instanceof S||t.type!=e)return 1;let n=N.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof _)){n=1;break}n+=F(e,r)}N.set(t,n)}return n}function B(e,t,n,r,i,o,s,a,l){let u=0;for(let n=r;n<i;n++)u+=F(e,t[n]);let c=Math.ceil(1.5*u/8),d=[],h=[];return!function t(n,r,i,s,a){for(let u=i;u<s;){let i=u,f=r[u],p=F(e,n[u]);for(u++;u<s;u++){let t=F(e,n[u]);if(p+t>=c)break;p+=t}if(u==i+1){if(p>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+a);continue}d.push(n[i])}else{let t=r[u-1]+n[u-1].length-f;d.push(B(e,n,r,i,u,f,t,null,l))}h.push(f+a-o)}}(t,n,r,i,0),(a||l)(d,h,s)}class z{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new z(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let u=s<t.length?t[s]:null,c=u?u.fromA:1e9;if(c-a>=n)for(;o&&o.from<c;){let t=o;if(a>=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new z(e,n,t.tree,t.offset+l,s>0,!!u)}if(t&&r.push(t),o.to>c)break;o=i<e.length?e[i++]:null}if(!u)break;a=u.toA,l=u.toA-u.toB}return r}}class V{startParse(e,t,n){return"string"==typeof e&&(e=new H(e)),n=n?n.length?n.map(e=>new p(e.from,e.to)):[new p(0,0)]:[new p(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class H{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new g({perNode:!0});let $=[],W=[],U="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,t=0;e<U.length;e++)(e%2?W:$).push(t+=U[e]);function q(e){return e>=127462&&e<=127487}function Q(e,t,n){if(t==e.length)return t;t&&G(e.charCodeAt(t))&&X(e.charCodeAt(t-1))&&t--;let r=K(e,t);for(t+=Y(r);t<e.length;){let i=K(e,t);if(8205==r||8205==i||n&&function(e){if(e<768)return!1;for(let t=0,n=$.length;;){let r=t+n>>1;if(e<$[r])n=r;else{if(!(e>=W[r]))return!0;t=r+1}if(t==n)return!1}}(i))t+=Y(i),r=i;else if(q(i)){let n=0,r=t-2;for(;r>=0&&q(K(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function K(e,t){let n=e.charCodeAt(t);if(!X(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return G(r)?(n-55296<<10)+(r-56320)+65536:n}function G(e){return e>=56320&&e<57344}function X(e){return e>=55296&&e<56320}function Y(e){return e<65536?1:2}class Z{lineAt(e){if(e<0||e>this.length)throw 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 RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=es(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ee.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=es(this,e,t);let n=[];return this.decompose(e,t,n,0),ee.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new en(this),i=new en(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new en(this,e)}iterRange(e,t=this.length){return new er(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ei(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new J(e):ee.from(J.split(e,[])):Z.empty}}class J extends Z{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new eo(r,s,n,o);r=s+1,n++}}decompose(e,t,n,r){var i;let o=e<=0&&t>=this.length?this:new J((i=this.text,et(i,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=et(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new J(t,e.length+o.length));else{let e=t.length>>1;n.push(new J(t.slice(0,e)),new J(t.slice(e)))}}else n.push(o)}replace(e,t,n){var r;if(!(n instanceof J))return super.replace(e,t,n);[e,t]=es(this,e,t);let i=et(this.text,et(n.text,(r=this.text,et(r,[""],0,e))),t),o=this.length+n.length-(t-e);return i.length<=32?new J(i,o):ee.from(J.split(i,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=es(this,e,t);let r="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let s=this.text[o],a=i+s.length;i>e&&o&&(r+=n),e<a&&t>i&&(r+=s.slice(Math.max(0,e-i),t-i)),i=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new J(n,r)),n=[],r=-1);return r>-1&&t.push(new J(n,r)),t}}class ee extends Z{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],s=r+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e<=a&&t>=o){let i=r&(o<=e|2*(a>=t));o>=e&&a<=t&&!i?n.push(s):s.decompose(e-o,t-o,n,i)}o=a+1}}replace(e,t,n){if([e,t]=es(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let o=this.children[r],s=i+o.length;if(e>=i&&t<=s){let a=o.replace(e-i,t-i,n),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let i=this.children.slice();return i[r]=a,new ee(i,this.length-(t-e)+n.length)}return super.replace(i,s,a)}i=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=es(this,e,t);let r="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let s=this.children[i],a=o+s.length;o>e&&i&&(r+=n),e<a&&t>o&&(r+=s.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ee))return 0;let n=0,[r,i,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==o||i==s)return n;let a=this.children[r],l=e.children[i];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new J(n,t)}let r=Math.max(32,n>>5),i=r<<1,o=r>>1,s=[],a=0,l=-1,u=[];function c(){0!=a&&(s.push(1==u.length?u[0]:ee.from(u,l)),l=-1,a=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof ee)for(let n of t.children)e(n);else t.lines>o&&(a>o||!a)?(c(),s.push(t)):t instanceof J&&a&&(n=u[u.length-1])instanceof J&&t.lines+n.lines<=32?(a+=t.lines,l+=t.length+1,u[u.length-1]=new J(n.text.concat(t.text),n.length+1+t.length)):(a+t.lines>r&&c(),a+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==s.length?s[0]:new ee(s,t)}}function et(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}Z.empty=new J([""],0);class en{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof J?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,s=r instanceof J?r.text.length:r.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof J){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof J?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class er{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new en(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),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 ei{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Z.prototype[Symbol.iterator]=function(){return this.iter()},en.prototype[Symbol.iterator]=er.prototype[Symbol.iterator]=ei.prototype[Symbol.iterator]=function(){return this});class eo{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function es(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function ea(e,t,n=!0,r=!0){return function(e,t,n=!0,r=!0){return(n?Q:function(e,t,n){for(;t>0;){let r=Q(e,t-2,n);if(r<t)return r;t--}return 0})(e,t,r)}(e,t,n,r)}function el(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r>=56320&&r<57344?(n-55296<<10)+(r-56320)+65536:n}function eu(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function ec(e){return e<65536?1:2}let ed=/\r\n?|\n/;var eh=((o=eh||(eh={}))[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o);class ef{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}iterChangedRanges(e,t=!1){ev(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new ef(e)}composeDesc(e){return this.empty?e:e.empty?this:eb(this,e)}mapDesc(e,t=!1){return e.empty?this:ey(this,e,t)}mapPos(e,t=-1,n=eh.Simple){let r=0,i=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=r+s;if(a<0){if(l>e)return i+(e-r);i+=s}else{if(n!=eh.Simple&&l>=e&&(n==eh.TrackDel&&r<e&&l>e||n==eh.TrackBefore&&r<e||n==eh.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==r||t<0?i:i+a;i+=a}r=l}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],o=this.sections[n++],s=r+i;if(o>=0&&r<=t&&s>=e)return!(r<e)||!(s>t)||"cover";r=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new ef(e)}static create(e){return new ef(e)}}class ep extends ef{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return ev(this,(t,n,r,i,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return ey(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,i=0;r<t.length;r+=2){let o=t[r],s=t[r+1];if(s>=0){t[r]=s,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(Z.empty);n.push(o?e.slice(i,i+o):Z.empty)}i+=o}return new ep(t,n)}compose(e){return this.empty?e:e.empty?this:eb(this,e,!0)}map(e,t=!1){return e.empty?this:ey(this,e,t,!0)}iterChanges(e,t=!1){ev(this,e,t)}get desc(){return ef.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new ex(this);n:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==i.len;){if(i.done)break n;let e=Math.min(i.len,a-s);eg(r,e,-1);let o=-1==i.ins?-1:0==i.off?i.ins:0;eg(t,e,o),o>0&&em(n,t,i.text),i.forward(e),s+=e}let l=e[o++];for(;s<l;){if(i.done)break n;let e=Math.min(i.len,l-s);eg(t,e,-1),eg(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),s+=e}}return{changes:new ep(t,n),filtered:ef.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],i=[],o=0,s=null;function a(e=!1){if(!e&&!r.length)return;o<t&&eg(r,t-o,-1);let n=new ep(r,i);s=s?s.compose(n.map(s)):n,r=[],i=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof ep){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:u}=l;if(e>s||e<0||s>t)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let c=u?"string"==typeof u?Z.of(u.split(n||ed)):u:Z.empty,d=c.length;if(e==s&&0==d)return;e<o&&a(),e>o&&eg(r,e-o,-1),eg(r,s-e,d),em(i,r,c),o=s}}(e),a(!s),s}static empty(e){return new ep(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if("number"==typeof i)t.push(i,-1);else if(!Array.isArray(i)||"number"!=typeof i[0]||i.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==i.length)t.push(i[0],0);else{for(;n.length<r;)n.push(Z.empty);n[r]=Z.of(i.slice(1)),t.push(i[0],n[r].length)}}return new ep(t,n)}static createSet(e,t){return new ep(e,t)}}function eg(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function em(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Z.empty);e.push(n)}}function ev(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let u=i,c=o,d=Z.empty;for(;u+=a,c+=l,l&&r&&(d=d.append(r[s-2>>1])),!n&&s!=e.sections.length&&!(e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,u,o,c,d),i=u,o=c}}}function ey(e,t,n,r=!1){let i=[],o=r?[]:null,s=new ex(e),a=new ex(t);for(let e=-1;;)if(s.done&&a.len||a.done&&s.len)throw Error("Mismatched change set lengths");else if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);eg(i,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(eg(i,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(eg(i,0,s.ins),o&&em(o,i,s.text),e=s.i),s.forward(n),t-=n}a.next()}else if(s.ins>=0){let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else if(0==a.ins&&a.len<n)n-=a.len,a.next();else break;eg(i,t,e<s.i?s.ins:0),o&&e<s.i&&em(o,i,s.text),e=s.i,s.forward(s.len-n)}else if(s.done&&a.done)return o?ep.createSet(i,o):ef.create(i);else throw Error("Mismatched change set lengths")}function eb(e,t,n=!1){let r=[],i=n?[]:null,o=new ex(e),s=new ex(t);for(let e=!1;;)if(o.done&&s.done)return i?ep.createSet(r,i):ef.create(r);else if(0==o.ins)eg(r,o.len,0,e),o.next();else if(0!=s.len||s.done)if(o.done||s.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,s.len),n=r.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;eg(r,t,n,e),i&&n&&em(i,r,s.text)}else -1==s.ins?(eg(r,o.off?0:o.len,t,e),i&&em(i,r,o.textBit(t))):(eg(r,o.off?0:o.len,s.off?0:s.ins,e),i&&!s.off&&em(i,r,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||r.length>n),o.forward2(t),s.forward(t)}else eg(r,0,s.ins,e),i&&em(i,r,s.text),s.next()}class ex{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 -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Z.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Z.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ew{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 0xffffff==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new ew(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return e_.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return e_.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return e_.range(e.anchor,e.head)}static create(e,t,n){return new ew(e,t,n)}}class e_{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:e_.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new e_([this.main],0)}addRange(e,t=!0){return e_.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,e_.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new e_(e.ranges.map(e=>ew.fromJSON(e)),e.main)}static single(e,t=e){return new e_([e_.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return e_.normalized(e.slice(),t);n=i.to}return new e_(e,t)}static cursor(e,t=0,n,r){return ew.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:0xffffff)<<6)}static range(e,t,n,r){let i=(null!=n?n:0xffffff)<<6|(null==r?7:Math.min(6,r));return t<e?ew.create(t,e,48|i):ew.create(e,t,8*(t>e)|i)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let o=i.from,s=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?e_.range(s,o):e_.range(o,s))}}return new e_(e,t)}}function ek(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let eS=0;class eC{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=eS++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new eC(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?eO:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new eE([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new eE(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new eE(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function eO(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class eE{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=eS++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,s=2==this.type,a=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||eA(e,u)){let t=n(e);if(s?!eM(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[i];if(null!=l){let i=eB(t,l);if(this.dependencies.every(n=>n instanceof eC?t.facet(n)===e.facet(n):!(n instanceof eT)||t.field(n,!1)==e.field(n,!1))||(s?eM(a=n(e),i,r):r(a=n(e),i)))return e.values[o]=i,0}else a=n(e);return e.values[o]=a,1}}}}function eM(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function eA(e,t){let n=!1;for(let r of t)1&eF(e,r)&&(n=!0);return n}let eP=eC.define({static:!0});class eT{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new eT(eS++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(eP).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(eP),i=n.facet(eP),o;return(o=r.find(e=>e.field==this))&&o!=i.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,eP.of({field:this,create:e})]}get extension(){return this}}function eR(e){return t=>new eD(t,e)}let eI={highest:eR(0),high:eR(1),default:eR(2),low:eR(3),lowest:eR(4)};class eD{constructor(e,t){this.inner=e,this.prec=t}}class eL{of(e){return new ej(this,e)}reconfigure(e){return eL.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ej{constructor(e,t){this.compartment=e,this.inner=t}}class eN{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var r,i,o;let s,a,l=[],u=Object.create(null),c=new Map;for(let n of(r=e,i=t,o=c,s=[[],[],[],[],[]],a=new Map,!function e(t,n){let r=a.get(t);if(null!=r){if(r<=n)return;let e=s[r].indexOf(t);e>-1&&s[r].splice(e,1),t instanceof ej&&o.delete(t.compartment)}if(a.set(t,n),Array.isArray(t))for(let r of t)e(r,n);else if(t instanceof ej){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=i.get(t.compartment)||t.inner;o.set(t.compartment,r),e(r,n)}else if(t instanceof eD)e(t.inner,t.prec);else if(t instanceof eT)s[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof eE)s[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let r=t.extension;if(!r)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(r,n)}}(r,2),s.reduce((e,t)=>e.concat(t))))n instanceof eT?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let d=Object.create(null),h=[],f=[];for(let e of l)d[e.id]=f.length<<1,f.push(t=>e.slot(t));let p=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],r=t[0].facet,i=p&&p[e]||[];if(t.every(e=>0==e.type))if(d[r.id]=h.length<<1|1,eO(i,t))h.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));h.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(d[e.id]=h.length<<1|1,h.push(e.value)):(d[e.id]=f.length<<1,f.push(t=>e.dynamicSlot(t)));d[r.id]=f.length<<1,f.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),o=r.filter(e=>!(1&e)),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<r.length;t++){let o=eB(e,r[t]);if(2==i[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of r)eF(e,t);return e.values[s]=a(e),1},update(e,n){if(!eA(e,o))return 0;let r=a(e);return t.compare(r,e.values[s])?0:(e.values[s]=r,1)},reconfigure(e,i){let o=eA(e,r),l=i.config.facets[t.id],u=i.facet(t);if(l&&!o&&eO(n,l))return e.values[s]=u,0;let c=a(e);return t.compare(c,u)?(e.values[s]=u,0):(e.values[s]=c,1)}}})(e,r,t))}}return new eN(e,c,f.map(e=>e(d)),d,h,u)}}function eF(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function eB(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let ez=eC.define(),eV=eC.define({combine:e=>e.some(e=>e),static:!0}),eH=eC.define({combine:e=>e.length?e[0]:void 0,static:!0}),e$=eC.define(),eW=eC.define(),eU=eC.define(),eq=eC.define({combine:e=>!!e.length&&e[0]});class eQ{constructor(e,t){this.type=e,this.value=t}static define(){return new eK}}class eK{of(e){return new eQ(this,e)}}class eG{constructor(e){this.map=e}of(e){return new eX(this,e)}}class eX{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new eX(this.type,t)}is(e){return this.type==e}static define(e={}){return new eG(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}eX.reconfigure=eX.define(),eX.appendConfig=eX.define();class eY{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&ek(n,t.newLength),i.some(e=>e.type==eY.time)||(this.annotations=i.concat(eY.time.of(Date.now())))}static create(e,t,n,r,i,o){return new eY(e,t,n,r,i,o)}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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(eY.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function eZ(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=ep.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):null==(r=e.selection)?void 0:r.map(i),effects:eX.mapEffects(e.effects,i).concat(eX.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function eJ(e,t,n){let r=t.selection,i=e1(t.annotations);return t.userEvent&&(i=i.concat(eY.userEvent.of(t.userEvent))),{changes:t.changes instanceof ep?t.changes:ep.of(t.changes||[],n,e.facet(eH)),selection:r&&(r instanceof e_?r:e_.single(r.anchor,r.head)),effects:e1(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}eY.time=eQ.define(),eY.userEvent=eQ.define(),eY.addToHistory=eQ.define(),eY.remote=eQ.define();let e0=[];function e1(e){return null==e?e0:Array.isArray(e)?e:[e]}var e2=((s=e2||(e2={}))[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s);let e5=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{t=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class e3{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)eF(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return eF(this,n),eB(this,n)}update(...e){return function e(t,n,r){let i=eJ(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let o=!!n[e].sequential;i=eZ(i,eJ(t,n[e],o?i.changes.newLength:t.doc.length),o)}let o=eY.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(eU),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=eZ(r,eJ(t,o,e.changes.newLength),!0))}return r==e?e:eY.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(e$)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else{if(!(i<t.length))return n;o=t[i++],s=t[i++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=ep.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=eY.create(n,e,t.selection&&t.selection.map(i),eX.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(eW);for(let r=i.length-1;r>=0;r--){let o=i[r](t);t=o instanceof eY?o:Array.isArray(o)&&1==o.length&&o[0]instanceof eY?o[0]:e(n,e1(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(eL.reconfigure)?(n&&(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(eX.reconfigure)?(n=null,r=t.value):t.is(eX.appendConfig)&&(n=null,r=e1(r).concat(t.value));t=n?e.startState.values.slice():new e3(n=eN.resolve(r,i,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(eV)?e.newSelection:e.newSelection.asSingle();new e3(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:e_.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=e1(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(l);let u=r.mapDesc(a,!0);i.push(s.range.map(u)),r=r.compose(l),o=eX.mapEffects(o,l).concat(eX.mapEffects(e1(s.effects),u))}return{changes:r,selection:e_.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ep?e:ep.of(e,this.doc.length,this.facet(e3.lineSeparator))}toText(e){return Z.of(e.split(this.facet(e3.lineSeparator)||ed))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(eF(this,t),eB(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof eT&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],o=e[t];r.push(i.init(e=>i.spec.fromJSON(o,e)))}}return e3.create({doc:e.doc,selection:e_.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=eN.resolve(e.extensions||[],new Map),n=e.doc instanceof Z?e.doc:Z.of((e.doc||"").split(t.staticFacet(e3.lineSeparator)||ed)),r=e.selection?e.selection instanceof e_?e.selection:e_.single(e.selection.anchor,e.selection.head):e_.single(0);return ek(r,n.length),t.staticFacet(eV)||(r=r.asSingle()),new e3(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e3.tabSize)}get lineBreak(){return this.facet(e3.lineSeparator)||"\n"}get readOnly(){return this.facet(eq)}phrase(e,...t){for(let t of this.facet(e3.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(ez))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){var n;return n=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return e2.Space;if(function(e){if(t)return t.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||e5.test(n)))return!0}return!1}(e))return e2.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return e2.Word;return e2.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=ea(t,o,!1);if(i(t.slice(e,o))!=e2.Word)break;o=e}for(;s<r;){let e=ea(t,s);if(i(t.slice(s,e))!=e2.Word)break;s=e}return o==s?null:e_.range(o+n,s+n)}}function e4(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],o=r[e];if(void 0===o)r[e]=i;else if(o===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](o,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}e3.allowMultipleSelections=eV,e3.tabSize=eC.define({combine:e=>e.length?e[0]:4}),e3.lineSeparator=eH,e3.readOnly=eq,e3.phrases=eC.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),e3.languageData=ez,e3.changeFilter=e$,e3.transactionFilter=eW,e3.transactionExtender=eU,eL.reconfigure=eX.define();class e8{eq(e){return this==e}range(e,t=e){return e6.create(e,t,this)}}e8.prototype.startSide=e8.prototype.endSide=0,e8.prototype.point=!1,e8.prototype.mapMode=eh.TrackDel;class e6{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new e6(e,t,n)}}function e7(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class e9{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,s=i.length;;){if(o==s)return o;let r=o+s>>1,a=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return a>=0?o:s;a>=0?s=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],o=-1,s=-1;for(let a=0;a<this.value.length;a++){let l=this.value[a],u=this.from[a]+e,c=this.to[a]+e,d,h;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(d=h=e,l.startSide!=l.endSide&&(h=t.mapPos(u,l.endSide))<d))continue}else if((d=t.mapPos(u,l.startSide))>(h=t.mapPos(c,l.endSide))||d==h&&l.startSide>0&&l.endSide<=0)continue;0>(h-d||l.endSide-l.startSide)||(o<0&&(o=d),l.point&&(s=Math.max(s,h-d)),n.push(l),r.push(d-o),i.push(h-o))}return{mapped:n.length?new e9(r,i,n,s):null,pos:o}}}class te{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new te(e,t,n,r)}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 t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(e7)),this.isEmpty)return t.length?te.of(t):this;let s=new tr(this,null,-1).goto(0),a=0,l=[],u=new tt;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(s.chunkIndex)||i<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||r>s.to||i<s.from||o(s.from,s.to,s.value))&&!u.addInner(s.from,s.to,s.value)&&l.push(e6.create(s.from,s.to,s.value)),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?te.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i],a=e.touchesRange(o,o+s.length);if(!1===a)r=Math.max(r,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===a){let{mapped:i,pos:a}=s.map(o,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(a))}}let i=this.nextLayer.map(e);return 0==t.length?i:new te(n,t,i||te.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return ti.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ti.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),a=tn(o,s,n),l=new ts(o,a,i),u=new ts(s,a,i);n.iterGaps((e,t,n)=>ta(l,e,u,t,n,r)),n.empty&&0==n.length&&ta(l,0,u,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=0x3b9ac9ff);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=o.length)return!1;if(!i.length)return!0;let s=tn(i,o),a=new ts(i,s,0).goto(n),l=new ts(o,s,0).goto(n);for(;;){if(a.to!=l.to||!tl(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new ts(e,null,i).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),i=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,a);r.point(s,e,o.point,n,i,o.pointRank),a=Math.min(o.openEnd(e),n.length)}else e>s&&(r.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new tt;for(let r of e instanceof e6?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(e7(t,r)>0)return e.slice().sort(e7);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return te.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=te.empty;r=r.nextLayer)t=new te(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}te.empty=new te([],[],null,-1),te.empty.nextLayer=te.empty;class tt{finishChunk(e){this.chunks.push(new e9(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,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new tt)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(te.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=te.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function tn(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=r.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||i.add(e.chunk[t])}return i}class tr{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!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],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.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 ti{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new tr(o,t,n,i));return 1==r.length?r[0]:new ti(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)to(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)to(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)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(),to(this.heap,0)}}}function to(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class ts{constructor(e,t,n){this.minPoint=n,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=ti.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){tu(this.active,e),tu(this.activeTo,e),tu(this.activeRank,e),this.minActive=td(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;tc(this.active,t,n),tc(this.activeTo,t,r),tc(this.activeRank,t,i),e&&tc(e,t,this.cursor.from),this.minActive=td(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&tu(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function ta(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t;for(;;){let t=e.to+l-n.to,r=t||e.endSide-n.endSide,i=r<0?e.to+l:n.to,u=Math.min(i,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&tl(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,u,e.point,n.point):u>a&&!tl(e.active,n.active)&&o.compareRange(a,u,e.active,n.active),i>s)break;(t||e.openEnd!=n.openEnd)&&o.boundChange&&o.boundChange(i),a=i,r<=0&&e.next(),r>=0&&n.next()}}function tl(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function tu(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function tc(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function td(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function th(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=ea(e,i));return r}function tf(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=ea(e,r)}return!0===r?-1:e.length}let tp="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),tg="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),tm="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class tv{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,o,s){let a=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==i)return o.push(t[0]+";");for(let n in i){let s=i[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),s,o);else if(s&&"object"==typeof s){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(r(n),s,a,u)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(a.length||u)&&o.push((n&&!l&&!s?t.map(n):t).join(", ")+" {"+a.join(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=tm[tp]||1;return tm[tp]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[tg],i=n&&n.nonce;r?i&&r.setNonce(i):r=new tb(e,i),r.mount(Array.isArray(t)?t:[t],e)}}let ty=new Map;class tb{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=ty.get(n);if(t)return e[tg]=t;this.sheet=new r.CSSStyleSheet,ty.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[tg]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),i--,s=-1),-1==s){if(this.modules.splice(i++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var tx={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:"'"},tw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},t_="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),tk="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tS=0;tS<10;tS++)tx[48+tS]=tx[96+tS]=String(tS);for(var tS=1;tS<=24;tS++)tx[tS+111]="F"+tS;for(var tS=65;tS<=90;tS++)tx[tS]=String.fromCharCode(tS+32),tw[tS]=String.fromCharCode(tS);for(var tC in tx)tw.hasOwnProperty(tC)||(tw[tC]=tx[tC]);function tO(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let tE="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},tM="undefined"!=typeof document?document:{documentElement:{style:{}}},tA=/Edge\/(\d+)/.exec(tE.userAgent),tP=/MSIE \d/.test(tE.userAgent),tT=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tE.userAgent),tR=!!(tP||tT||tA),tI=!tR&&/gecko\/(\d+)/i.test(tE.userAgent),tD=!tR&&/Chrome\/(\d+)/.exec(tE.userAgent),tL="webkitFontSmoothing"in tM.documentElement.style,tj=!tR&&/Apple Computer/.test(tE.vendor),tN=tj&&(/Mobile\/\w+/.test(tE.userAgent)||tE.maxTouchPoints>2);var tF={mac:tN||/Mac/.test(tE.platform),windows:/Win/.test(tE.platform),linux:/Linux|X11/.test(tE.platform),ie:tR,ie_version:tP?tM.documentMode||6:tT?+tT[1]:tA?+tA[1]:0,gecko:tI,gecko_version:tI?+(/Firefox\/(\d+)/.exec(tE.userAgent)||[0,0])[1]:0,chrome:!!tD,chrome_version:tD?+tD[1]:0,ios:tN,android:/Android\b/.test(tE.userAgent),webkit:tL,webkit_version:tL?+(/\bAppleWebKit\/(\d+)/.exec(tE.userAgent)||[0,0])[1]:0,safari:tj,safari_version:tj?+(/\bVersion\/(\d+(\.\d+)?)/.exec(tE.userAgent)||[0,0])[1]:0,tabSize:null!=tM.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function tB(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let tz=Object.create(null);function tV(e,t,n){if(e==t)return!0;e||(e=tz),t||(t=tz);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(-1==i.indexOf(o)||e[o]!==t[o]))return!1;return!0}function tH(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,"style"==i?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,"style"==i?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}class t${eq(e){return!1}updateDOM(e,t){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,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var tW=((a=tW||(tW={}))[a.Text=0]="Text",a[a.WidgetBefore=1]="WidgetBefore",a[a.WidgetAfter=2]="WidgetAfter",a[a.WidgetRange=3]="WidgetRange",a);class tU extends e8{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new tq(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new tK(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:o}=tG(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new tK(e,n,r,t,e.widget||null,!0)}static line(e){return new tQ(e)}static set(e,t=!1){return te.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}tU.none=te.empty;class tq extends tU{constructor(e){let{start:t,end:n}=tG(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?tB(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||tz}eq(e){return this==e||e instanceof tq&&this.tagName==e.tagName&&tV(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}tq.prototype.point=!1;class tQ extends tU{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof tQ&&this.spec.class==e.spec.class&&tV(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}tQ.prototype.mapMode=eh.TrackBefore,tQ.prototype.point=!0;class tK extends tU{constructor(e,t,n,r,i,o){super(t,n,i,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?eh.TrackBefore:eh.TrackAfter:eh.TrackDel}get type(){return this.startSide!=this.endSide?tW.WidgetRange:this.startSide<=0?tW.WidgetBefore:tW.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof tK&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function tG(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function tX(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}tK.prototype.point=!0;class tY extends e8{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof tY&&this.tagName==e.tagName&&tV(this.attributes,e.attributes)}static create(e){return new tY(e.tagName,e.attributes||tz)}static set(e,t=!1){return te.of(e,t)}}function tZ(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function tJ(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function t0(e,t){if(!t.anchorNode)return!1;try{return tJ(e,t.anchorNode)}catch(e){return!1}}function t1(e){return 3==e.nodeType?nn(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function t2(e,t,n,r){return!!n&&(t4(e,t,n,r,-1)||t4(e,t,n,r,1))}function t5(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function t3(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function t4(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:t8(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=t5(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?t8(e):0}}}function t8(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function t6(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function t7(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(r>.995&&r<1.005||!isFinite(r)||1>Math.abs(t.height-e.offsetHeight))&&(r=1),{scaleX:n,scaleY:r}}tY.prototype.startSide=tY.prototype.endSide=-1;class t9{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:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?t8(t):0),n,Math.min(e.focusOffset,n?t8(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let ne=null;function nt(e){if(e.setActive)return e.setActive();if(ne)return e.focus(ne);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==ne?{get preventScroll(){return ne={preventScroll:!0},!0}}:void 0),!ne){ne=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function nn(e,t,r=t){let i=n||(n=document.createRange());return i.setEnd(e,r),i.setStart(e,t),i}function nr(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function ni(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function no(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r>0)return{node:n,offset:r};else if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=t8(n=n.childNodes[r-1])}else{if(!n.parentNode||t3(n))return null;r=t5(n),n=n.parentNode}}function ns(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};else if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||t3(n))return null;r=t5(n)+1,n=n.parentNode}}tF.safari&&tF.safari_version>=26&&(ne=!1);class na{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new na(e.parentNode,t5(e),t)}static after(e,t){return new na(e.parentNode,t5(e)+1,t)}}var nl=((l=nl||(nl={}))[l.LTR=0]="LTR",l[l.RTL=1]="RTL",l);let nu=nl.LTR,nc=nl.RTL;function nd(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let nh=nd("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),nf=nd("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),np=Object.create(null),ng=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);np[t]=n,np[n]=-t}function nm(e){return e<=247?nh[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?nf[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let nv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ny{get dir(){return this.level%2?nc:nu}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(i<0||(0!=r?r<0?s.from<t:s.to>t:e[i].level>s.level))&&(i=o)}}if(i<0)throw RangeError("Index out of range");return i}}let nb=[];function nx(e){return[new ny(0,e,0)]}let nw="",n_=eC.define(),nk=eC.define(),nS=eC.define(),nC=eC.define(),nO=eC.define(),nE=eC.define(),nM=eC.define(),nA=eC.define(),nP=eC.define(),nT=eC.define({combine:e=>e.some(e=>e)}),nR=eC.define({combine:e=>e.some(e=>e)}),nI=eC.define();class nD{constructor(e,t="nearest",n="nearest",r=5,i=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new nD(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 nD(e_.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let nL=eX.define({map:(e,t)=>e.map(t)}),nj=eX.define();function nN(e,t,n){let r=e.facet(nC);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let nF=eC.define({combine:e=>!e.length||e[0]}),nB=0,nz=eC.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class nV{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(nz.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(nz.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:i,decorations:o}=t||{};return new nV(nB++,e,n,r,e=>{let t=[];return o&&t.push(nU.of(t=>{let n=t.plugin(e);return n?o(n):tU.none})),i&&t.push(i(e)),t})}static fromClass(e,t){return nV.define((t,n)=>new e(t,n),t)}}class nH{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 e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(nN(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){nN(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){nN(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let n$=eC.define(),nW=eC.define(),nU=eC.define(),nq=eC.define(),nQ=eC.define(),nK=eC.define(),nG=eC.define();function nX(e,t){let n=e.state.facet(nG);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return te.spans(r,t.from,t.to,{point(){},span(e,n,r,o){let s=e-t.from,a=n-t.from,l=i;for(let e=r.length-1;e>=0;e--,o--){let n=r[e].spec.bidiIsolate,i;if(null==n&&(n=function(e,t,n){for(let r=t;r<n;r++){let t=nm(e.charCodeAt(r));if(1==t)break;if(2==t||4==t)return nc}return nu}(t.text,s,a)),o>0&&l.length&&(i=l[l.length-1]).to==s&&i.direction==n)i.to=a,l=i.inner;else{let e={from:s,to:a,direction:n,inner:[]};l.push(e),l=e.inner}}}}),i}let nY=eC.define();function nZ(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(nY)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(r=Math.max(r,s.top)),null!=s.bottom&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}let nJ=eC.define();class n0{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new n0(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 t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,i=0,o=0;;){let s=Math.min(r<e.length?e[r].fromB:1e9,i<t.length?t[i]:1e9);if(1e9==s)break;let a=s+o,l=s,u=a;for(;;)if(i<t.length&&t[i]<=l){let n=t[i+1];i+=2,l=Math.max(l,n);for(let t=r;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(r<e.length&&e[r].fromB<=l){let t=e[r++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new n0(a,u,s,l))}return n}}class n1{constructor(e,t,n){for(let r of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ep.empty(this.startState.doc.length),n))this.changes=this.changes.compose(r.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new n0(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new n1(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let n2=[];class n5{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return n2}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,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(this.dom,e)}}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,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=t5(this.dom),r=this.length?e>0:t>0;return new na(this.parent.dom,n+ +!!r,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof n8)return e;return null}static get(e){return e.cmTile}}class n3 extends n5{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(2&this.flags)return;super.sync(e);let t=this.dom,n=null,r,i=(null==e?void 0:e.node)==t?e:null,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=s.dom&&(i.written=!0),s.dom.parentNode==t)for(;r&&r!=s.dom;)r=n4(r);else t.insertBefore(s.dom,r);n=s.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=n4(r);this.length=o}}function n4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class n8 extends n3{constructor(e,t){super(t),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 t=n5.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&i++,r=t.pop()}else{let o=n.children[r++];if(o instanceof n6)t.push(r),n=o,r=0;else{let t=i+o.length,n=e(o,i);if(void 0!==n)return n;i=t+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,o=-1;if(this.blockTiles((s,a)=>{let l=a+s.length;if(e>=a&&e<=l){if(s.isWidget()&&t>=-1&&t<=1){if(32&s.flags)return!0;16&s.flags&&(n=void 0)}(a<e||e==l&&(t<-1?s.length:s.covers(1)))&&(!n||!s.isWidget()&&n.isWidget())&&(n=s,r=e-a),(l>e||e==a&&(t>1?s.length:s.covers(-1)))&&(!i||!s.isWidget()&&i.isWidget())&&(i=s,o=e-a)}}),!n&&!i)throw Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:o}}}class n6 extends n3{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new n6(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class n7 extends n3{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new n7(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,o=null,s=-1;!function e(a,l){for(let u=0,c=0;u<a.children.length&&c<=l;u++){let d=a.children[u],h=c+d.length;h>=l&&(d.isComposite()?e(d,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}(o,d)))&&(h>l||32&d.flags)?(o=d,s=l-c):(c<l||16&d.flags&&!d.isHidden)&&(r=d,i=l-c)),c=h}}(this,e);let a=(t<0?r:o)||r||o;return a?{tile:a,offset:a==r?i:s}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=t1(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new na(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,t);let i=n.tile.parent,o=!1;for(let e of i.children){if(o)return new na(e.dom,0);e==n.tile&&(o=!0)}}return new na(this.dom,0)}}class n9 extends n3{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new n9(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class re extends n5{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(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,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,o=0;0==e&&t<0||e==n&&t>=0?!(tF.chrome||tF.gecko)&&(e?(r--,o=1):i<n&&(i++,o=-1)):t<0?r--:i<n&&i++;let s=nn(this.dom,r,i).getClientRects();if(!s.length)return null;let a=s[(o?o<0:t>=0)?0:s.length-1];return tF.safari&&!o&&0==a.width&&(a=Array.prototype.find.call(s,e=>e.width)||a),o?t6(a,o<0):a||null}static of(e,t){let n=new re(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class rt extends n5{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return t6(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let i=r?t.length-1:0;n=t[i],e>0?0!=i:i!=t.length-1&&!(n.top<n.bottom);i+=r?-1:1);return t6(n,!r)}}get overrideDOMText(){if(!this.length)return Z.empty;let{root:e}=this;if(!e)return Z.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,i){return!i&&(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new rt(i,n,e,r)}}class rn extends n5{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!1}get overrideDOMText(){return Z.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class rr{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:o,parents:s}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(i==r.children.length){if(!e&&!s.length)break;n&&n.leave(r),o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++}else{let a=r.children[i],l=a.breakAfter;(t>0?a.length<=e:a.length<e)&&(!n||!1!==n.skip(a,0,a.length)||!a.isComposite)?(o=!!l,i++,e-=a.length):(s.push({tile:r,index:i}),r=a,i=0,n&&a.isComposite()&&n.enter(a))}else if(i==r.length)o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;return this.tile=r,this.index=i,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class ri{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class ro{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var i;this.flushBuffer();let o=this.ensureMarks(t,n),s=o.lastChild;s&&s.isText()&&!(8&s.flags)?(this.cache.reused.set(s,2),(o.children[o.children.length-1]=new re(s.dom,s.text+e)).parent=o):o.append(r||re.of(e,null==(i=this.cache.find(re))?void 0:i.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?rh(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof n9&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(rh(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=n5.get(n.dom);e&&e.setDOM(rh(n.dom))}let e=n9.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=new re(e.text,e.text.nodeValue);i.flags|=8,r.append(i)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let i=this.ensureMarks(t,n);r||16&e.flags||i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).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 t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=rd);let r=n7.start(e,t||(null==(n=this.cache.find(n7))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}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,t){var n;let r=this.curLine;for(let i=e.length-1;i>=0;i--){let o=e[i],s;if(t>0&&(s=r.lastChild)&&s instanceof n9&&s.mark.eq(o))r=s,t--;else{let e=n9.of(o,null==(n=this.cache.find(n9,e=>e.mark.eq(o)))?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!rc(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(tF.ios&&rc(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rp,0,32)||new rt(rp.toDOM(),0,rp,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 t=new ri(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&0>(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to);)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof n6&&r.wrapper.eq(n.wrapper))t=r;else{let r=n6.of(n.wrapper,null==(e=this.cache.find(n6,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(rn,void 0,1);return n&&(n.flags=t),n||new rn(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class rs{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:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error("Ran out of text content when drawing inline views");this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let ra=[rt,n7,re,n9,rn,n6,n8];for(let e=0;e<ra.length;e++)ra[e].bucket=e;class rl{constructor(e){this.view=e,this.buckets=ra.map(()=>[]),this.index=ra.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],o=this.index[r];for(let e=i.length-1;e>=0;e--){let s=(e+o)%i.length,a=i[s];if((!t||t(a))&&!this.reused.has(a))return i.splice(s,1),s<o&&this.index[r]--,this.reused.set(a,n),a}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,o=0;;i++){if(i==r.length){if(o)return null;o=1,i=0}let s=r[i];if(!this.reused.has(s)&&(0==o?s.widget.compare(e):s.widget.constructor==e.constructor&&e.updateDOM(s.dom,this.view)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,this.reused.set(s,1),s.length=t,s.flags=-498&s.flags|n,s}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}}class ru{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new rl(e),this.text=new rs(e.state.doc),this.builder=new ro(this.cache,new n8(e,e.contentDOM),te.iter(n)),this.cache.reused.set(t,2),this.old=new rr(t)}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,o=0;;){let s=o<e.length?e[o++]:null,a=s?s.fromA:this.old.root.length;if(a>r){let e=a-r;this.preserve(e,!o,!s),r=a,i+=e}if(!s)break;this.forward(s.fromA,s.toA),t&&s.fromA<=t.range.fromA&&s.toA>=t.range.toA?(this.emit(i,t.range.fromB),this.builder.addComposition(t,n),this.emit(t.range.toB,s.toB)):this.emit(i,s.toB),i=s.toB,r=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof n9&&t.push(r.mark)}return t}(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?rt.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.addInlineWidget(o,r,i),i=r.length)}else if(e.isText())t||n!=e.length?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)):this.builder.addText(e.text,r,i,this.cache.reuse(e)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof rn)this.cache.add(e);else{if(!(e instanceof n9))return!1;this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof n9&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=i=0):e instanceof n9&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,o=te.spans(this.decorations,e,t,{point:(e,t,o,s,a,l)=>{var u,c,d;if(o instanceof tK){if(this.disallowBlockEffectsFor[l]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=s.length,a>s.length)r.continueWidget(t-e);else{let i,l=o.widget||(o.block?rf.block:rf.inline),c=(i=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(i|=256),i),d=this.cache.findWidget(l,t-e,c)||rt.of(l,this.view,t-e,c);o.block?(o.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(d)):(r.ensureLine(n),r.addInlineWidget(d,s,a))}n=null}else{let e,t;c=n,e=(d=o).spec.attributes,t=d.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&tB(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,i,o)=>{for(let s=e;s<t;){let e=this.text.next(Math.min(512,t-s));null==e?(r.addLineStartIfNotCovered(n),r.addBreak(),s++):(r.ensureLine(n),r.addText(e,i,o),s+=e.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>i,this.openMarks=o}forward(e,t){this.old.advance(t-e,1,{skip:(e,t,n)=>{(e.isText()||n==e.length)&&this.cache.add(e)},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}})}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=n5.get(r);if(r==this.view.contentDOM)break;e instanceof n9?t.push(e):(null==e?void 0:e.isLine())?n=e:"DIV"!=r.nodeName||n||r==this.view.contentDOM?t.push(n9.of(new tq({tagName:r.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}(r)}),r)):n=new n7(r,rd)}return{line:n,marks:t}}}function rc(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}let rd={class:"cm-line"};function rh(e){let t=n5.get(e);return t&&t.setDOM(e.cloneNode()),e}class rf extends t${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}}rf.inline=new rf("span"),rf.block=new rf("div");let rp=new class extends t${toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class rg{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=tU.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 n8(e,e.contentDOM),this.updateInner([new n0(0,0,0,e.state.doc.length)],null)}update(e){var t,n,r,i,o,s,a,l,u;let c,d,h,f=e.changedRanges;this.minWidth>0&&f.length&&(f.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>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 p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?p=this.domChanged.newSel.head:(n=e.changes,r=this.hasComposition,c=!1,r&&n.iterChangedRanges((e,t)=>{e<r.to&&t>r.from&&(c=!0)}),c||e.selectionSet||(p=e.state.selection.main.head)));let g=p>-1?function(e,t,n){let r=rv(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new n0(l.mapPos(o),l.mapPos(s),o,s),text:i}}(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;f=new n0(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(f.slice())}this.hasComposition=g?{from:g.range.fromB,to:g.range.toB}:null,(tF.ie||tF.chrome)&&!g&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let m=this.decorations,v=this.blockWrappers;this.updateDeco();let y=(i=m,o=this.decorations,s=e.changes,d=new ry,te.compare(i,o,s,d),d.changes);y.length&&(f=n0.extendWithRanges(f,y));let b=(a=v,l=this.blockWrappers,u=e.changes,h=new rb,te.compare(a,l,u,h),h.changes);return b.length&&(f=n0.extendWithRanges(f,b)),g&&!f.some(e=>e.fromA<=g.range.fromA&&e.toA>=g.range.toA)&&(f=g.range.addToSet(f.slice())),(!(2&this.tile.flags)||0!=f.length)&&(this.updateInner(f,g),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new ru(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),rm(n,r.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 r=tF.chrome||tF.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof rx&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(nj)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(nF)||r.tabIndex>-1)&&t0(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||t||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),tF.gecko&&l.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new na(e,0),a=!0}let d=this.view.observer.selectionRange;!a&&d.focusNode&&(t2(u.node,u.offset,d.anchorNode,d.anchorOffset)&&t2(c.node,c.offset,d.focusNode,d.focusOffset)||this.suppressWidgetCursorChange(d,l))||(this.view.observer.ignore(()=>{tF.android&&tF.chrome&&r.contains(d.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(d.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let e=tZ(this.view.root);if(e)if(l.empty){if(tF.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?no:ns)(u.node,u.offset);t&&(u=new na(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new na(d.anchorNode,d.anchorOffset),this.impreciseHead=c.precise?null:new na(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&t2(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=tZ(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=0==t8(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!n5.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,o,s=-1,a=!1;return(this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&n)return!0;16&t.flags&&(i=!0)}else{let u=l+t.length;if(l<=e&&(n=t,r=e-l,i=u<e),u>=e&&!o&&(o=t,s=e-l,a=l>e),l>e&&o)return!0}}),n||o)?(i&&o?n=null:a&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(s,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof rx?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return t.isLine()?t:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=ea(t.text,n);if(e==n)return null;let r=nn(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==nl.LTR,l=0,u=(e,c,d)=>{for(let h=0;h<e.children.length&&!(c>r);h++){let r=e.children[h],f=c+r.length,p=r.dom.getBoundingClientRect(),{height:g}=p;if(d&&!h&&(l+=p.top-d.top),r instanceof n6)f>n&&u(r,c,p);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=r.dom.lastChild,t=e?t1(e):[];if(t.length){let e=t[t.length-1],n=a?e.right-p.left:p.right-e.left;n>s&&(s=n,this.minWidth=i,this.minWidthFrom=c,this.minWidthTo=f)}}d&&h==e.children.length-1&&(l+=d.bottom-p.bottom),c=f+r.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?nl.RTL:nl.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=t1(r.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,r,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=t1(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.view.state.doc.length;if(o>n){let r=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(tU.replace({widget:new rx(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return tU.set(e)}updateDeco(){let e=1,t=this.view.state.facet(nU).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(nQ).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(te.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(nq).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(nI))try{if(t(this.view,e.range,e))return!0}catch(e){nN(this.view.state,e,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=nZ(this.view),o={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,r,i,o,s,a){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,d=!1;c&&!d;)if(1==c.nodeType){let e,h=c==l.body,f=1,p=1;if(h)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(d=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=t7(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let g=0,m=0;if("nearest"==i)t.top<e.top?(m=t.top-(e.top+s),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+s)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+s,n<0&&t.top-m<e.top&&(m=t.top-(e.top+s)));else{let r=t.bottom-t.top,o=e.bottom-e.top;m=("center"==i&&r<=o?t.top+r/2-o/2:"start"==i||"center"==i&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==r?t.left<e.left?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==a?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(h)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/p,n=(c.scrollTop-e)*p}if(g){let t=c.scrollLeft;c.scrollLeft+=g/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(r="nearest"),n&&1>Math.abs(n-m)&&(i="nearest")}if(h)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==nl.LTR)}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){rm(this.tile)}}function rm(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let r of(null==n&&e.destroy(),e.children))rm(r,t)}function rv(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=no(n.focusNode,n.focusOffset),i=ns(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let t=n5.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let e=n5.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let ry=class{constructor(){this.changes=[]}compareRange(e,t){tX(e,t,this.changes)}comparePoint(e,t){tX(e,t,this.changes)}boundChange(e){tX(e,e,this.changes)}};class rb{constructor(){this.changes=[]}compareRange(e,t){tX(e,t,this.changes)}comparePoint(){}boundChange(e){tX(e,e,this.changes)}}class rx extends t${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 rw(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==tW.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function r_(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let t=function(e,t,n,r,i){var o;let s=r.head-e.from,a=ny.find(t,s,null!=(o=r.bidiLevel)?o:-1,r.assoc),l=t[a],u=l.side(i,n);if(s==u){let e=a+=i?1:-1;if(e<0||e>=t.length)return null;s=(l=t[a=e]).side(!i,n),u=l.side(i,n)}let c=ea(e.text,s,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),nw=e.text.slice(Math.min(s,c),Math.max(s,c));let d=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return d&&c==u&&d.level+ +!i<l.level?e_.cursor(d.side(!i,n)+e.from,d.forward(i,n)?1:-1,d.level):e_.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}(i,o,s,a,n),u=nw;if(!t){if(i.number==(n?e.state.doc.lines:1))return a;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return t;l=r(u)}a=t}}function rk(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,o)=>{if(t>e&&t<i){let o=r||n||(t-e<i-t?-1:1);t=o<0?e:i,r=o}});if(!r)return t}}function rS(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let t=rk(e,i.from,0);t!=i.from&&(o=e_.cursor(t,-1))}else{let t=rk(e,i.from,-1),n=rk(e,i.to,1);(t!=i.from||n!=i.to)&&(o=e_.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?e_.create(n,t.mainIndex):t}function rC(e,t,n){let r=rk(e.state.facet(nK).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:e_.cursor(r,r<n.from?1:-1)}class rO{constructor(e,t){this.pos=e,this.assoc=t}}function rE(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:s,y:a}=t,l=a-o,u;for(;;){if(l<0)return new rO(0,1);if(l>e.viewState.docHeight)return new rO(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==r)break;if(u.type==tW.Text){let t=e.docView.coordsAt(r<0?u.from:u.to,r);if(t&&(r<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==tW.Text){let t=function(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+tf(s,o,e.state.tabSize)}(e,i,u,s,a);return new rO(t,t==u.from?1:-1)}}return u.type!=tW.Text?l<(u.top+u.bottom)/2?new rO(u.from,1):new rO(u.to,-1):function e(t,n,r,i,o){let s=-1,a=null,l=1e9,u=1e9,c=o,d=o,h=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];if(r.top==r.bottom)continue;let h=r.left>i?r.left-i:r.right<i?i-r.right:0,f=r.top>o?r.top-o:r.bottom<o?o-r.bottom:0;r.top<=d&&r.bottom>=c&&(c=Math.min(r.top,c),d=Math.max(r.bottom,d),f=0),(s<0||0>(f-u||h-l))&&(s>=0&&u&&l<h&&a.top<=d-2&&a.bottom>=c+2?u=0:(s=t,l=h,u=f,a=r))}};if(n.isText()){for(let e=0;e<n.length;){let t=ea(n.text,e);if(h(nn(n.dom,e,t).getClientRects(),e),!l&&!u)break;e=t}return i>(a.left+a.right)/2==(rM(t,s+r)==nl.LTR)?new rO(r+ea(n.text,s),-1):new rO(r+s,1)}{if(!n.length)return new rO(r,1);for(let e=0;e<n.children.length;e++){let t=n.children[e];if(!(48&t.flags)&&(h((1==t.dom.nodeType?t.dom:nn(t.dom,0,t.length)).getClientRects(),e),!l&&!u))break}let c=n.children[s],d=n.posBefore(c,r);return c.isComposite()||c.isText()?e(t,c,d,Math.max(a.left,Math.min(a.right,i)),o):i>(a.left+a.right)/2==(rM(t,s+r)==nl.LTR)?new rO(d+c.length,-1):new rO(d,1)}}(e,e.docView.lineAt(u.from),u.from,s,a)}function rM(e,t){let n=e.state.doc.lineAt(t);return e.bidiSpans(n)[ny.find(e.bidiSpans(n),t-n.from,-1,1)].dir}class rA{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(e3.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="￿"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=n5.get(r),o=r.nextSibling;if(o==t){(null==i?void 0:i.breakAfter)&&!o&&this.lineBreak();break}let s=n5.get(o);(i&&s?i.breakAfter:(i?i.breakAfter:t3(r))||t3(o)&&("BR"!=r.nodeName||(null==i?void 0:i.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=n5.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,s;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=r.exec(t))&&(i=s.index,o=s[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=i+o}}readNode(e){let t=n5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<t8(t))return!1;if(t==e)return!0;n=t5(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class rP{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class rT{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,r,i){if(t.isComposite()){let o=-1,s=-1,a=-1,l=-1;for(let u=0,c=i,d=i;u<t.children.length;u++){let i=t.children[u],h=c+i.length;if(c<n&&h>r)return e(i,n,r,c);if(h>=n&&-1==o&&(o=u,s=c),c>r&&i.dom.parentNode==t.dom){a=u,l=d;break}d=h,c=h+i.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=i||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new rP(n,r)),(i!=n||o!=r)&&t.push(new rP(i,o))),t}(e),n=new rA(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?e_.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!tJ(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!tJ(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((tF.ios||tF.chrome)&&e.state.selection.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),o=s.from-t,a=s.to-i;(0==o||1==o||0==t)&&(0==a||-1==a||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(e_.range(r,n)):this.newSel=e_.single(r,n)}}}function rR(e,t){let n,{newSel:r}=t,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:s}=t.bounds,a=i.from,l=null;(8===o||tF.android&&t.text.length<s-r)&&(a=i.to,l="end");let u=rD(e.state.doc.sliceString(r,s,"￿"),t.text,a-r,l);u&&(tF.chrome&&13==o&&u.toB==u.from+2&&"￿￿"==t.text.slice(u.from,u.toB)&&u.toB--,n={from:r+u.from,to:r+u.toA,insert:Z.of(t.text.slice(u.from,u.toB).split("￿"))})}else r&&(!e.hasFocus&&e.state.facet(nF)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(tF.mac||tF.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=e_.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Z.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:tF.chrome&&n&&n.from==n.to&&n.from==i.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=e_.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Z.of([" "])}),n)return rI(e,n,r,o);if(!r||r.main.eq(i))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(r=rS(e.state.facet(nK).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}}function rI(e,t,n,r=-1){let i;if(tF.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(tF.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&nr(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&nr(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&nr(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>i||(i=function(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,r=n<0?o.from:o.to,a=rk(i.facet(nK).map(t=>t(e)),r,n);t.from==a&&(s=a)}if(s>-1)r={changes:t,selection:e_.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?i.sliceDoc(o.from,t.from):"",s=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=i.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&rv(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let d=o.to-t.to;r=i.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let r=n.to-d,c=r-l.length;if(e.state.sliceDoc(c,r)!=l||r>=u.from&&c<=u.to)return{range:n};let h=i.changes({from:c,to:r,insert:t.insert}),f=n.to-o.to;return{changes:h,range:a?e_.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}})}else r={changes:s,selection:a&&i.selection.replaceRange(a)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}(e,t,n));return e.state.facet(nE).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}function rD(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if("end"==r){let e=Math.max(0,o-Math.min(s,a));n-=s+e-o}if(s<o&&e.length<t.length){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}else if(a<o){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}class rL{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,tF.safari&&e.contentDOM.addEventListener("input",()=>null),tF.gecko&&function(e){r8.has(e)||(r8.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(r=n5.get(n))&&r.isWidget()&&r.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(rj(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(rj(t.value,r))}}for(let e in rH)n(e).handlers.push(rH[e]);for(let e in r$)n(e).observers.push(r$[e]);return t}(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let i=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=i&&(r.removeEventListener(e,this.handleEvent),o=null),o||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){let t;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))||((this.tabFocusMode>0&&27!=e.keyCode&&0>rB.indexOf(e.keyCode)&&(this.tabFocusMode=-1),tF.android&&tF.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))?(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0):tF.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=rN.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||rF.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(229!=e.keyCode&&this.view.observer.forceFlush(),!1))}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,nr(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(tF.safari&&!tF.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}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 rj(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){nN(n.state,e)}}}let rN=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],rF="dthko",rB=[16,17,18,20,91,92,224,225];function rz(e){return .7*Math.max(0,e)+8}class rV{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i;)if(i==t.body||n&&r)break;else if(1==i.nodeType)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(11==i.nodeType)i=i.host;else break;return{x:n,y:r}}(e.contentDOM),this.atoms=e.state.facet(nK).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(e3.allowMultipleSelections)&&function(e,t){let n=e.state.facet(n_);return n.length?n[0](t):tF.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=tZ(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==r0(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=nZ(this.view);e.clientX-l.left<=i+6?n=-rz(i-e.clientX):e.clientX+l.right>=s-6&&(n=rz(e.clientX-s)),e.clientY-l.top<=o+6?r=-rz(o-e.clientY):e.clientY+l.bottom>=a-6&&(r=rz(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&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,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=rS(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let rH=Object.create(null),r$=Object.create(null),rW=tF.ie&&tF.ie_version<15||tF.ios&&tF.webkit_version<604;function rU(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function rq(e,t){t=rU(e.state,nA,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(null!=r2&&n.selection.ranges.every(e=>e.empty)&&r2==o.toString()){let e=-1;r=n.changeByRange(r=>{let a=n.doc.lineAt(r.from);if(a.from==e)return{range:r};e=a.from;let l=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:e_.cursor(r.from+l.length)}})}else r=s?n.changeByRange(e=>{let t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:e_.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}function rQ(e,t,n,r){if(1==r)return e_.cursor(t,n);{if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return e_.cursor(t);0==o?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=ea(i.text,o,!1):a=ea(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let e=ea(i.text,s,!1);if(r(i.text.slice(e,s))!=l)break;s=e}for(;a<i.length;){let e=ea(i.text,a);if(r(i.text.slice(a,e))!=l)break;a=e}return e_.range(s+i.from,a+i.from)}(e.state,t,n);let i=e.docView.lineAt(t),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,e_.range(s,a)}}r$.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},rH.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),r$.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},r$.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},rH.mousedown=(e,t)=>{var n,r;let i,o,s;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let a=null;for(let n of e.state.facet(nS))if(a=n(e,t))break;if(a||0!=t.button||(i=rG(n=e,r=t),o=r0(r),s=n.state.selection,a={update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),s=s.map(e.changes))},get(e,t,r){let a=rG(n,e),l,u=rQ(n,a.pos,a.bias,o);if(i.pos!=a.pos&&!t){let e=rQ(n,i.pos,i.bias,o),t=Math.min(e.from,u.from),r=Math.max(e.to,u.to);u=t<u.from?e_.range(t,r):e_.range(r,t)}return t?s.replaceRange(s.main.extend(u.from,u.to)):r&&1==o&&s.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return e_.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(s,a.pos))?l:r?s.addRange(u):e_.create([u])}}),a){let n=!e.hasFocus;e.inputState.startMouseSelection(new rV(e,t,a,n)),n&&e.observer.ignore(()=>{nt(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let rK=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function rG(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:function(e,t,n,r){let i=e.docView.lineAt(t);if(!i)return 1;let o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return -1;let s=i.coordsIn(o,-1);if(s&&rK(n,r,s))return -1;let a=i.coordsIn(o,1);return a&&rK(n,r,a)?1:s&&s.bottom>=r?-1:1}(e,n,t.clientX,t.clientY)}}let rX=tF.ie&&tF.ie_version<=11,rY=null,rZ=0,rJ=0;function r0(e){if(!rX)return e.detail;let t=rY,n=rJ;return rY=e,rJ=Date.now(),rZ=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(rZ+1)%3:1}function r1(e,t,n,r){let i;if(!(n=rU(e.state,nA,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=r&&s&&((i=e.state.facet(nk)).length?i[0](t):tF.mac?!t.altKey:!t.ctrlKey)?{from:s.from,to:s.to}:null,l={from:o,insert:n},u=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}rH.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=e_.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",rU(e.state,nP,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},rH.dragend=e=>(e.inputState.draggedContent=null,!1),rH.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&r1(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return r1(e,t,n,!0),!0}return!1},rH.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=rW?null:t.clipboardData;return n?(rq(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),rq(e,n.value)},50)}(e),!1)};let r2=null;rH.copy=rH.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:rU(e,nP,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!i)return!1;r2=i?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=rW?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};let r5=eQ.define();function r3(e,t){let n=[];for(let r of e.facet(nM)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:r5.of(!0)}):null}function r4(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=r3(e.state,t);n?e.dispatch(n):e.update([])}},10)}r$.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),r4(e)},r$.blur=e=>{e.observer.clearSelectionRange(),r4(e)},r$.compositionstart=r$.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},r$.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,tF.chrome&&tF.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},r$.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},rH.beforeinput=(e,t)=>{var n,r;let i;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),i=t.getTargetRanges();if(r&&i.length){let t=i[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return rI(e,{from:n,to:o,insert:e.state.toText(r)},null),!0}}if(tF.chrome&&tF.android&&(i=rN.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null==(r=window.visualViewport)?void 0:r.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return tF.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),tF.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>r$.compositionend(e,t),20),!1};let r8=new Set,r6=["pre-wrap","normal","pre-line","break-spaces"],r7=!1;class r9{constructor(e){this.lineWrapping=e,this.doc=Z.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 r6.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,i,o){let s=r6.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class ie{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class it{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return"number"==typeof this._content?tW.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 tK?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new it(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var ir=((u=ir||(ir={}))[u.ByPos=0]="ByPos",u[u.ByHeight=1]="ByHeight",u[u.ByPosNoHeight=2]="ByPosNoHeight",u);class ii{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(r7=!0),this.height=e)}replace(e,t,n){return ii.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,o=n.doc;for(let s=r.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:u,toB:c}=r[s],d=i.lineAt(a,ir.ByPosNoHeight,n.setDoc(t),0,0),h=d.to>=l?d:i.lineAt(l,ir.ByPosNoHeight,n,0,0);for(c+=h.to-l,l=h.to;s>0&&d.from<=r[s-1].toA;)a=r[s-1].fromA,u=r[s-1].fromB,s--,a<d.from&&(d=i.lineAt(a,ir.ByPosNoHeight,n,0,0));u+=d.from-a,a=d.from;let f=ih.build(n.setDoc(o),e,u,c);i=io(i,i.replace(a,l,f))}return i.updateHeight(n,0)}static empty(){return new il(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,i=0;for(;;)if(t==n)if(r>2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else if(i>2*r){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}else break;else if(r<i){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(i+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new ic(ii.of(e.slice(0,t)),o,ii.of(e.slice(n)))}}function io(e,t){return e==t?e:(e.constructor!=t.constructor&&(r7=!0),t)}ii.prototype.size=1;let is=tU.replace({});class ia extends ii{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new it(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new it(r,0,n,this.spaceAbove,is):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let o=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(o):o}forEachLine(e,t,n,r,i,o){e<=i+this.length&&t>=i&&o(this.lineAt(0,ir.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class il extends ia{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new it(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof il||r instanceof iu&&4&r.flags)&&10>Math.abs(this.length-r.length)?(r instanceof iu?r=new il(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ii.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||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 iu extends ii{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,o,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);o=t/i,this.length>i+1&&(s=(this.height-t)/(this.length-i-1))}else o=this.height/i;return{firstLine:n,lastLine:r,perLine:o,perChar:s}}blockAt(e,t,n,r){let{firstLine:i,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(i),l=s+o.length*a,u=Math.max(n,e-l/2);return new it(o.from,o.length,u,l,0)}{let r=Math.max(0,Math.min(o-i,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(i+r);return new it(a,l,n+s*r,s,0)}}lineAt(e,t,n,r,i){if(t==ir.ByHeight)return this.blockAt(e,n,r,i);if(t==ir.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new it(t,r-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(n,i),l=n.doc.lineAt(e),u=s+l.length*a,c=l.number-o,d=r+s*c+a*(l.from-i-c);return new it(l.from,l.length,Math.max(r,Math.min(d,r+this.height-u)),u,0)}forEachLine(e,t,n,r,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);for(let u=e,c=r;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-s;c+=a*n+l*(e-i-n)}let r=a+l*t.length;o(new it(t.from,t.length,c,r,0)),c+=r,u=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof iu?n[n.length-1]=new iu(e.length+r):n.push(null,new iu(r-1))}if(e>0){let t=n[0];t instanceof iu?n[0]=new iu(e+t.length):n.unshift(new iu(e-1),null)}return ii.of(n)}decomposeLeft(e,t){t.push(new iu(e-1),null)}decomposeRight(e,t){t.push(null,new iu(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),s=-1;for(r.from>t&&n.push(new iu(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++],a=0;i<0&&(a=-i,i=r.heights[r.index++]),-1==s?s=i:Math.abs(i-s)>=.001&&(s=-2);let l=new il(t,i,a);l.outdated=!1,n.push(l),o+=t+1}o<=i&&n.push(null,new iu(i-o).updateHeight(e,o));let a=ii.of(n);return(s<0||Math.abs(a.height-this.height)>=.001||Math.abs(s-this.heightMetrics(e,t).perLine)>=.001)&&(r7=!0),io(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class ic extends ii{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let o=r+this.left.height,s=i+this.left.length+this.break,a=t==ir.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let u=t==ir.ByPosNoHeight?ir.ByPosNoHeight:ir.ByPos;return a?l.join(this.right.lineAt(s,u,n,o,s)):this.left.lineAt(s,u,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let s=r+this.left.height,a=i+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,i,o),t>=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,ir.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&id(i,o-1),t<this.length){let e=i.length;this.decomposeRight(t,i),id(i,e)}return ii.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ii.of(this.break?[e,null,t]:[e,t]):(this.left=io(this.left,e),this.right=io(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,s=t+i.length+this.break,a=null;return(r&&r.from<=t+i.length&&r.more?a=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=s+o.length&&r.more?a=o=o.updateHeight(e,s,n,r):o.updateHeight(e,s,n),a)?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function id(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof iu&&(r=e[t+1])instanceof iu&&e.splice(t-1,3,new iu(n.length+1+r.length))}class ih{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof il?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new il(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new ia(o,r,n)):(o||i||r>=5)&&this.addLineDeco(r,i,o)}else t>e&&this.span(e,t);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:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new il(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new iu(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof il)return e;let t=new il(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof il||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new il(0,-1,0));let n=e;for(let e of this.nodes)e instanceof il&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let i=new ih(n,e);return te.spans(t,n,r,i,0),i.finish(n)}}class ip{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&tX(e,t,this.changes,5)}}class ig{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return tU.replace({widget:new im(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class im extends t${constructor(e,t){super(),this.size=e,this.vertical=t}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 iv{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=iw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=nl.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(nW).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new r9(t),this.stateDeco=e.facet(nU).filter(e=>"function"!=typeof e),this.heightMap=ii.empty().applyChanges(this.stateDeco,Z.empty,this.heightOracle.setDoc(e.doc),[new n0(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=tU.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new iy(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iw:new i_(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ik(e,this.scaler))})}update(e,t=null){var n,r;let i;this.state=e.state;let o=this.stateDeco;this.stateDeco=this.state.facet(nU).filter(e=>"function"!=typeof e);let s=e.changedRanges,a=n0.extendWithRanges(s,(n=this.stateDeco,r=e?e.changes:ep.empty(this.state.doc.length),i=new ip,te.compare(o,n,r,i,0),i.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);r7=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||r7)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||2&e.flags)&&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),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(nR)&&(this.mustEnforceCursorAssoc=!0)}measure(e){var t;let n,r,i=e.contentDOM,o=window.getComputedStyle(i),s=this.heightOracle,a=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?nl.RTL:nl.LTR;let l=this.heightOracle.mustRefreshForWrapping(a),u=i.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,h=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=t7(i,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,d|=16,l=c=!0)}let f=(parseInt(o.paddingTop)||0)*this.scaleY,p=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=ni(e.scrollDOM);let m=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();o=Math.max(o,r.left),s=Math.min(s,r.right),a=Math.max(a,r.top),l=Math.min(t==e.parentNode?i.innerHeight:l,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}})(i,this.paddingTop),v=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(n=(t=e.dom).getBoundingClientRect(),r=t.ownerDocument.defaultView||window,!(n.left<r.innerWidth)||!(n.right>0)||!(n.top<r.innerHeight)||!(n.bottom>0)))return 0;let x=u.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let t=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(t)&&(l=!0),l||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:n,charWidth:r,textHeight:i}=e.docView.measureTextSize();(l=n>0&&s.refresh(a,n,r,i,Math.max(5,x/r),t))&&(e.docView.minWidth=0,d|=16)}for(let n of(v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),r7=!1,this.viewports)){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(l?ii.empty().applyChanges(this.stateDeco,Z.empty,this.heightOracle,[new n0(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new ie(n.from,r))}r7&&(d|=2)}let w=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return w&&(2&d&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(2&d||w)&&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,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new iy(r.lineAt(o-1e3*n,ir.ByHeight,i,0,0).from,r.lineAt(s+(1-n)*1e3,ir.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=r.lineAt(e,ir.ByPos,i,0,0),s;s="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<a.from?o.top:o.bottom-n,a=new iy(r.lineAt(s-500,ir.ByHeight,i,0,0).from,r.lineAt(s+n+500,ir.ByHeight,i,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new iy(this.heightMap.lineAt(n,ir.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,ir.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,ir.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,ir.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=s+Math.max(10,Math.min(n,250)))&&r>o-2e3&&i<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new ig(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,o=r<<1;if(this.defaultTextDirection!=nl.LTR&&!n)return[];let s=[],a=(r,o,l,u)=>{if(o-r<i)return;let c=this.state.selection.main,d=[c.from];for(let e of(c.empty||d.push(c.to),d))if(e>r&&e<o){a(r,e-10,l,u),a(e+10,o,l,u);return}let h=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-o)<i&&!d.some(t=>e.from<t&&e.to>t));if(!h){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(e_.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(l,r,o,u),i=n||e<2e6?e:2e6;h=new ig(r,o,e,i)}s.push(h)},l=t=>{var i,s,l;let u,c,d,h,f;if(t.length<o||t.type!=tW.Text)return;let p=(i=t.from,s=t.to,l=this.stateDeco,d=[],h=i,f=0,te.spans(l,i,s,{span(){},point(e,t){e>h&&(d.push({from:h,to:e}),f+=e-h),h=t}},20),h<s&&(d.push({from:h,to:s}),f+=s-h),{total:f,ranges:d});if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let r=ix(p,g),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;u=ib(p,e),c=ib(p,n)}else{let n,i,o=p.total*this.heightOracle.charWidth,s=r*this.heightOracle.charWidth,a=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=n.size-n.displaySize);let l=this.pixelViewport.left+a,d=this.pixelViewport.right+a;if(null!=g){let e=ix(p,g),t=((d-l)/2+s)/o;n=e-t,i=e+t}else n=(l-s)/o,i=(d+s)/o;u=ib(p,n),c=ib(p,i)}u>t.from&&a(t.from,u,t,p),c<t.to&&a(c,t.to,t,p)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,r){let i=ix(r,n)-ix(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){ig.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=tU.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];te.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],o=n[t];(i.from!=o.from||i.to!=o.to)&&(r|=4,e&&e.mapPos(i.from,-1)==o.from&&e.mapPos(i.to,1)==o.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ik(this.heightMap.lineAt(e,ir.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(t=>t.top<=e&&t.bottom>=e)||ik(this.heightMap.lineAt(this.scaler.fromDOM(e),ir.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ik(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 iy{constructor(e,t){this.from=e,this.to=t}}function ib({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function ix(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}let iw={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class i_{constructor(e,t,n){let r=0,i=0,o=0;for(let s of(this.viewports=n.map(({from:n,to:i})=>{let o=t.lineAt(n,ir.ByPos,e,0,0).top,s=t.lineAt(i,ir.ByPos,e,0,0).bottom;return r+=s-o,{from:n,to:i,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r),this.viewports))s.domTop=o+(s.top-i)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),i=s.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(e){return e instanceof i_&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function ik(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new it(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>ik(e,t)):e._content)}let iS=eC.define({combine:e=>e.join(" ")}),iC=eC.define({combine:e=>e.indexOf(!0)>-1}),iO=tv.newName(),iE=tv.newName(),iM=tv.newName(),iA={"&light":"."+iE,"&dark":"."+iM};function iP(e,t,n){return new tv(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let iT=iP("."+iO,{"&":{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"}},iA),iR={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},iI=tF.ie&&tF.ie_version<=11;class iD{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new t9,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(t=>{for(let e of t)this.queue.push(e);(tF.ie&&tF.ie_version<=11||tF.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&tF.android&&!1!==e.constructor.EDIT_CONTEXT&&!(tF.chrome&&tF.chrome_version<126)&&(this.editContext=new iN(e),e.state.facet(nF)&&(e.contentDOM.editContext=this.editContext.editContext)),iI&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.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){("change"!=e.type&&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((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(nF)?n.root.activeElement!=this.dom:!t0(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(tF.ie&&tF.ie_version<=11||tF.android&&tF.chrome)&&!n.state.selection.main.empty&&r.focusNode&&t2(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=tZ(e.root);if(!t)return!1;let n=tF.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ij(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?ij(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=t0(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,t8(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:r=t8(n=e)}else{if(n==e)return!0;r=t5(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.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,iR),iI&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),iI&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&nr(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.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 t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&t0(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new rT(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=rR(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=iL(t,e.previousSibling||e.target.previousSibling,-1),r=iL(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.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(nF)!=e.state.facet(nF)&&(e.view.contentDOM.editContext=e.state.facet(nF)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let r of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))r.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 iL(e,t,n){for(;t;){let r=n5.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function ij(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return t2(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}class iN{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=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)});for(let n in this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:o}=r,s=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let l=a-s>n.text.length;s==this.from&&i<this.from?s=i:a==this.to&&i>this.to&&(a=i);let u=rD(e.state.sliceDoc(s,a),n.text,(l?r.from:r.to)-s,l?"end":null);if(!u){let t=e_.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));t.main.eq(r)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+s,to:u.toA+s,insert:Z.of(n.text.slice(u.from,u.toB).split("\n"))};if((tF.mac||tF.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:s,to:a,insert:Z.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);rI(e,c,e_.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(i<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(tU.mark({attributes:{style:e}}).range(i,o))}}}e.dispatch({effects:nj.of(tU.set(n))})},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:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=tZ(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,o,s,a,l)=>{if(n)return;let u=l.length-(o-i);if(r&&o>=r.to)if(r.from==i&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.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)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+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 t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class iF{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 t;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:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new iv(e.state||e3.create(e)),e.scrollTo&&e.scrollTo.is(nL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(nz).map(e=>new nH(e)),this.plugins))t.update(this);this.observer=new iD(this),this.inputState=new rL(this),this.inputState.ensureHandlers(this.plugins),this.docView=new rg(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=1==e.length&&e[0]instanceof eY?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=t.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(r5))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(a=r3(i,o))||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(e3.phrases)!=this.state.facet(e3.phrases))return this.setState(i);r=n1.create(this,i,e),r.flags|=s;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;c=new nD(e.empty?e:e_.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(nL)&&(c=e.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=iV.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(nJ)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(iS)!=r.state.facet(iS)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(nO))try{e(r)}catch(e){nN(this.state,e,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!rR(this,u)&&l.force&&nr(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw 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 t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new iv(e),this.plugins=e.facet(nz).map(e=>new nH(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new rg(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(nz),n=e.state.facet(nz);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new nH(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){nN(this.state,e,"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 t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(ni(n))i=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(e=>{try{return e.read(this)}catch(e){return nN(this.state,e),iz}}),u=n1.create(this,this.state,[]),c=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=iz)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){nN(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o;if(e>1||e<-1){n.scrollTop=(r+=e)/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(nO))e(t)}get themeClasses(){return iO+" "+(this.state.facet(iC)?iM:iE)+" "+this.state.facet(iS)}updateAttrs(){let e=iH(this,n$,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(nF)?"true":"false",class:"cm-content",style:`${tF.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),iH(this,nW,t);let n=this.observer.ignore(()=>{let n=tH(this.contentDOM,this.contentAttrs,t),r=tH(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(iF.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(nJ);let e=this.state.facet(iF.cspNonce);tv.mount(this.root,this.styleModules.concat(iT).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.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,t,n){return rC(this,e,r_(this,e,t,n))}moveByGroup(e,t){return rC(this,e,r_(this,e,t,t=>{var n;let r,i;return n=e.head,i=(r=this.state.charCategorizer(n))(t),e=>{let t=r(e);return i==e2.Space&&(i=t),i==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return e_.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let i=rw(e,t.head,t.assoc||-1),o=r&&i.type==tW.Text&&(e.lineWrapping||i.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),s=e.posAtCoords({x:n==(r==nl.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return e_.cursor(s,n?-1:1)}return e_.cursor(n?i.to:i.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return rC(this,e,function(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return e_.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||-1),c=e.documentTop;if(u)null==s&&(s=u.left-l.left),a=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(i);null==s&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-t.from))),a=(o<0?t.top:t.bottom)+c}let d=l.left+s,h=null!=r?r:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=rE(e,{x:d,y:a+(h+t)*o},!1,o);return e_.cursor(n.pos,n.assoc,void 0,s)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=rE(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),rE(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r);return t6(n,i[ny.find(i,e-r.from,-1,t)].dir==nl.LTR==t>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(nT)||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>iB)return nx(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!e(i.inner,o.inner))return!1}return!0}(r.isolates,n=nX(this,e))))return r.order;n||(n=nX(this,e));let r=function(e,t,n){if(!e)return[new ny(0,0,+(t==nc))];if(t==nu&&!n.length&&!nv.test(e))return nx(e.length);if(n.length)for(;e.length>nb.length;)nb[nb.length]=256;let r=[],i=+(t!=nu);return function e(t,n,r,i,o,s,a){let l=n%2?2:1;!function(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let t=s,n=l,r=l;t<a;t++){let i=nm(e.charCodeAt(t));512==i?i=n:8==i&&4==r&&(i=16),nb[t]=4==i?2:i,7&i&&(r=i),n=i}for(let e=s,t=l,r=l;e<a;e++){let i=nb[e];if(128==i)e<a-1&&t==nb[e+1]&&24&t?i=nb[e]=t:nb[e]=256;else if(64==i){let i=e+1;for(;i<a&&64==nb[i];)i++;let o=e&&8==t||i<n&&8==nb[i]?1==r?1:8:256;for(let t=e;t<i;t++)nb[t]=o;e=i-1}else 8==i&&1==r&&(nb[e]=1);t=i,7&i&&(r=i)}}}(t,o,s,i,l),function(e,t,n,r,i){let o=1==i?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let u=s?r[s-1].to:t,c=s<r.length?r[s].from:n;for(let t=u,n,r,s;t<c;t++)if(r=np[n=e.charCodeAt(t)])if(r<0){for(let e=a-3;e>=0;e-=3)if(ng[e+1]==-r){let n=ng[e+2],r=2&n?i:4&n?1&n?o:i:0;r&&(nb[t]=nb[ng[e]]=r),a=e;break}}else if(189==ng.length)break;else ng[a++]=t,ng[a++]=n,ng[a++]=l;else if(2==(s=nb[t])||1==s){let e=s==i;l=+!e;for(let t=a-3;t>=0;t-=3){let n=ng[t+2];if(2&n)break;if(e)ng[t+2]|=2;else{if(4&n)break;ng[t+2]|=4}}}}}(t,o,s,i,l),function(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let s=nb[l];if(256==s){let s=l+1;for(;;)if(s==a){if(i==n.length)break;s=n[i++].to,a=i<n.length?n[i].from:t}else if(256==nb[s])s++;else break;let u=1==o,c=u==((s<t?nb[s]:r)==1)?u?1:2:r;for(let t=s,r=i,o=r?n[r-1].to:e;t>l;)t==o&&(t=n[--r].from,o=r?n[r-1].to:e),nb[--t]=c;l=s}else o=s,l++}}}(o,s,i,l),function t(n,r,i,o,s,a,l){let u=o%2?2:1;if(o%2==s%2)for(let c=r,d=0;c<i;){let r=!0,h=!1;if(d==a.length||c<a[d].from){let e=nb[c];e!=u&&(r=!1,h=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,g=c;r:for(;;)if(d<a.length&&g==a[d].from){if(h)break;let t=a[d];if(!r)for(let e=t.to,n=d+1;;){if(e==i)break r;if(n<a.length&&a[n].from==e)e=a[n++].to;else if(nb[e]==u)break r;else break}d++,f?f.push(t):(t.from>c&&l.push(new ny(c,t.from,p)),e(n,t.direction==nu!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==i||(r?nb[g]!=u:nb[g]==u))break;else g++;f?t(n,c,g,o+1,s,f,l):c<g&&l.push(new ny(c,g,p)),c=g}else for(let c=i,d=a.length;c>r;){let i=!0,h=!1;if(!d||c>a[d-1].to){let e=nb[c-1];e!=u&&(i=!1,h=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,g=c;r:for(;;)if(d&&g==a[d-1].to){if(h)break;let t=a[--d];if(!i)for(let e=t.from,n=d;;){if(e==r)break r;if(n&&a[n-1].to==e)e=a[--n].from;else if(nb[e-1]==u)break r;else break}f?f.push(t):(t.to<c&&l.push(new ny(t.to,c,p)),e(n,t.direction==nu!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==r||(i?nb[g-1]!=u:nb[g-1]==u))break;else g--;f?t(n,g,c,o+1,s,f,l):g<c&&l.push(new ny(g,c,p)),c=g}}(t,o,s,n,r,i,a)}(e,i,i,n,0,e.length,r),r}(e.text,t,n);return this.bidiCache.push(new iV(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||tF.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{nt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),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,t={}){return nL.of(new nD("number"==typeof e?e_.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return nL.of(new nD(e_.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nV.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nV.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=tv.newName(),r=[iS.of(n),nJ.of(iP(`.${n}`,e))];return t&&t.dark&&r.push(iC.of(!0)),r}static baseTheme(e){return eI.lowest(nJ.of(iP("."+iO,e,iA)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&n5.get(n)||n5.get(e);return(null==(t=null==r?void 0:r.root)?void 0:t.view)||null}}iF.styleModule=nJ,iF.inputHandler=nE,iF.clipboardInputFilter=nA,iF.clipboardOutputFilter=nP,iF.scrollHandler=nI,iF.focusChangeEffect=nM,iF.perLineTextDirection=nT,iF.exceptionSink=nC,iF.updateListener=nO,iF.editable=nF,iF.mouseSelectionStyle=nS,iF.dragMovesSelection=nk,iF.clickAddsSelectionRange=n_,iF.decorations=nU,iF.blockWrappers=nq,iF.outerDecorations=nQ,iF.atomicRanges=nK,iF.bidiIsolatedRanges=nG,iF.scrollMargins=nY,iF.darkTheme=iC,iF.cspNonce=eC.define({combine:e=>e.length?e[0]:""}),iF.contentAttributes=nW,iF.editorAttributes=n$,iF.lineWrapping=iF.contentAttributes.of({class:"cm-lineWrapping"}),iF.announce=eX.define();let iB=4096,iz={};class iV{constructor(e,t,n,r,i,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:nl.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir!=r||t.touchesRange(o.from,o.to)||n.push(new iV(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function iH(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&tB(o,n)}return n}let i$=tF.mac?"mac":tF.windows?"win":tF.linux?"linux":"key";function iW(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let iU=eI.default(iF.domEventHandlers({keydown:(e,t)=>iY(iK(t.state),e,t,"editor")})),iq=eC.define({enables:iU}),iQ=new WeakMap;function iK(e){let t=e.facet(iq),n=iQ.get(t);return n||iQ.set(t,n=function(e,t=i$){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,s,a)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map(e=>(function(e,t){let n,r,i,o,s=e.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(let e=0;e<s.length-1;++e){let a=s[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))"mac"==t?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+a)}return n&&(a="Alt-"+a),r&&(a="Ctrl-"+a),o&&(a="Meta-"+a),i&&(a="Shift-"+a),a})(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=iG={view:t,prefix:n,scope:e};return setTimeout(()=>{iG==r&&(iG=null)},4e3),!0}]})}let h=d.join(" ");i(h,!1);let f=c[h]||(c[h]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(l=c._any)?void 0:l.run)?void 0:u.slice())||[]});o&&f.run.push(o),s&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,iX))}let i=r[t]||r.key;if(i)for(let t of e)o(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(t,"Shift-"+i,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let iG=null,iX=null;function iY(e,t,n,r){var i;iX=t;let o=("Esc"==(i=!(t_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||tk&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?tw:tx)[t.keyCode]||t.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),s=ec(el(o,0))==o.length&&" "!=o,a="",l=!1,u=!1,c=!1;iG&&iG.view==n&&iG.scope==r&&(a=iG.prefix+" ",0>rB.indexOf(t.keyCode)&&(u=!0,iG=null));let d=new Set,h=e=>{if(e){for(let t of e.run)if(!d.has(t)&&(d.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},f=e[r],p,g;return f&&(h(f[a+iW(o,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(tF.windows&&t.ctrlKey&&t.altKey)&&!(tF.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=tx[t.keyCode])&&p!=o?h(f[a+iW(p,t,!0)])?l=!0:t.shiftKey&&(g=tw[t.keyCode])!=o&&g!=p&&h(f[a+iW(g,t,!1)])&&(l=!0):s&&t.shiftKey&&h(f[a+iW(o,t,!0)])&&(l=!0),!l&&h(f._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),iX=null,l}class iZ{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(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,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==nl.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=iJ(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),d=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=a.right-(c?parseInt(c.paddingRight):0),f=rw(e,r,1),p=rw(e,i,-1),g=f.type==tW.Text?f:null,m=p.type==tW.Text?p:null;if(g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=i0(e,r,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=i0(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(b(n.from,n.to,g));{let t=g?b(n.from,null,g):x(f,!1),r=m?b(null,n.to,m):x(p,!0),i=[];return(g||f).to<(m||p).from-(g&&m?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(v(d,t.bottom,h,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==tW.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(i).concat(y(r))}function v(e,n,r,i){return new iZ(t,e-l.left,n-l.top,r-e,i-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(v(n[i],e,n[i+1],t));return r}function b(t,n,r){let i=1e9,s=-1e9,a=[];function l(t,n,l,u,c){let f=e.coordsAtPos(t,t==r.to?-2:2),p=e.coordsAtPos(l,l==r.from?2:-2);f&&p&&(i=Math.min(f.top,p.top,i),s=Math.max(f.bottom,p.bottom,s),c==nl.LTR?a.push(o&&n?d:f.left,o&&u?h:p.right):a.push(!o&&u?d:p.left,!o&&n?h:f.right))}let u=null!=t?t:r.from,c=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>u&&r.from<c)for(let i=Math.max(r.from,u),o=Math.min(r.to,c);;){let r=e.state.doc.lineAt(i);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=o)break;a>i&&l(Math.max(e,i),null==t&&e<=u,Math.min(a,o),null==n&&a>=c,s.dir)}if((i=r.to+1)>=o)break}return 0==a.length&&l(u,null==t,c,null==n,e.textDirection),{top:i,bottom:s,horizontal:a}}function x(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let i=iJ(e);return[new iZ(t,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}}}function iJ(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==nl.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function i0(e,t,n,r){let i=e.coordsAtPos(t,2*n);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return null==a||null==l?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}class i1{constructor(e,t){this.view=e,this.layer=t,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"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(i2)!=e.state.facet(i2)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(i2);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,tF.safari&&tF.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()}}let i2=eC.define();function i5(e){return[nV.define(t=>new i1(t,e)),i2.of(e)]}let i3=eC.define({combine:e=>e4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function i4(e){return e.startState.facet(i3)!=e.state.facet(i3)}let i8=i5({above:!0,markers(e){let{state:t}=e,n=t.facet(i3),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=i.empty?i:e_.cursor(i.head,i.head>i.anchor?-1:1);for(let i of iZ.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=i4(e);return n&&i6(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){i6(t.state,e)},class:"cm-cursorLayer"});function i6(e,t){t.style.animationDuration=e.facet(i3).cursorBlinkRate+"ms"}let i7=i5({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:iZ.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||i4(e),class:"cm-selectionLayer"}),i9=eI.highest(iF.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"}}}})),oe=eX.define({map:(e,t)=>null==e?null:t.mapPos(e)}),ot=eT.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(oe)?t.value:e,e))}),on=nV.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(ot);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(ot)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(ot),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(ot)!=e&&this.view.dispatch({effects:oe.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function or(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}class oi{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,i)=>{let o=n(e,t,r);o&&i(r,r+e[0].length,o)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new tt,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))or(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return(e.docChanged&&e.changes.iterChanges((t,i,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(s,r))}),e.viewportMoved||r-n>1e3)?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),s=Math.min(i.to,r);if(s>=o){let n=e.state.doc.lineAt(o),r=n.to<s?e.state.doc.lineAt(s):n,a=Math.max(i.from,n.from),l=Math.min(i.to,r.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;s<r.to;s++)if(this.boundary.test(r.text[s-r.from])){l=s;break}}let u=[],c,d=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,d);else or(e.state.doc,this.regexp,a,l,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:u})}}return t}}let oo=null!=/x/.unicode?"gu":"g",os=RegExp("[\0-\b\n-\x1f-Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",oo),oa={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},ol=null,ou=eC.define({combine(e){let t=e4(e,{render:null,specialChars:os,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==ol&&"undefined"!=typeof document&&document.body){let t=document.body.style;ol=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return ol||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,oo)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,oo)),t}}),oc=null;class od extends t${constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"␤":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(oa[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class oh extends t${constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let of=tU.line({class:"cm-activeLine"}),op=nV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(of.range(i.from)),t=i.from)}return tU.set(n)}},{decorations:e=>e.decorations});class og extends t${constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?t1(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=t6(t[0],"rtl"!=n.direction),i=parseInt(n.lineHeight);return r.bottom-r.top>1.5*i?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}}function om(e,t){var n;let r,i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(i),s=i-o.from,a=s>2e3?-1:s==o.length?(n=t.clientX,(r=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((r.left-n)/e.defaultCharacterWidth)):-1):th(o.text,e.state.tabSize,i-o.from);return{line:o.number,col:a,off:s}}let ov={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},oy={style:"cursor: crosshair"},ob="-10000px";class ox{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],a=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(a=e)}if(a<0)o[n]=this.createTooltipView(r,n?o[n-1]:null),s&&(s[n]=!!r.above);else{let r=o[n]=this.tooltipViews[a];s&&(s[n]=t[a]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=r,this.tooltips=i,this.tooltipViews=o,!0}}function ow(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let o_=eC.define({combine:e=>{var t,n,r;return{position:tF.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(r=e.find(e=>e.tooltipSpace))?void 0:r.tooltipSpace)||ow}}}),ok=new WeakMap,oS=nV.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(o_);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ox(e,oM,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(o_);if(r.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=r.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=ob,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(tF.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=nZ(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(o_).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:c}=u,d=e.pos[a],h=e.size[a];if(!d||!1!==l.clip&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){c.style.top=ob;continue}let f=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,g=h.right-h.left,m=null!=(t=ok.get(u))?t:h.bottom-h.top,v=u.offset||oE,y=this.view.textDirection==nl.LTR,b=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(d.left-14*!!f+v.x,r.right-g)):Math.min(Math.max(r.left,d.left-g+14*!!f-v.x),r.right-g),x=this.above[a];!l.strictSide&&(x?d.top-m-p-v.y<r.top:d.bottom+m+p+v.y>r.bottom)&&x==r.bottom-d.bottom>d.top-r.top&&(x=this.above[a]=!x);let w=(x?d.top-r.top:r.bottom-d.bottom)-p;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=ob;continue}ok.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let _=x?d.top-m-p-v.y:d.bottom+p+v.y,k=b+g;if(!0!==u.overlap)for(let e of s)e.left<k&&e.right>b&&e.top<_+m&&e.bottom>_&&(_=x?e.top-m-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(_-e.parent.top)/o+"px",oC(c,(b-e.parent.left)/i)):(c.style.top=_/o+"px",oC(c,b/i)),f){let e=d.left+(y?v.x:-v.x)-(b+14-7);f.style.left=e/i+"px"}!0!==u.overlap&&s.push({left:b,top:_,right:k,bottom:_+m}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=ob}},{eventObservers:{scroll(){this.maybeMeasure()}}});function oC(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let oO=iF.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),oE={x:0,y:0},oM=eC.define({enables:[oS,oO]}),oA=eC.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class oP{static create(e){return new oP(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new ox(e,oA,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r){if(void 0===t)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let oT=oM.compute([oA],e=>{let t=e.facet(oA);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:oP.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class oR{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(null==(r=e.posAtCoords(t)))return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),s=o&&o.dir==nl.RTL?-1:1;i=t.x<n.left?-s:s}let o=this.source(e,r,i);if(null==o?void 0:o.then){let t=this.pending={pos:r};o.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>nN(e.state,t,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(oS),t=e?e.manager.tooltips.findIndex(e=>e.create==oP.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r.length&&i&&!function(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let e=s.getBoundingClientRect();i=Math.min(e.top,i),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=i-4&&t.clientY<=o+4}(i.dom,e)||this.pending){let{pos:i}=r[0]||this.pending,o=null!=(n=null==(t=r[0])?void 0:t.end)?n:i;(i==o?this.view.posAtCoords(this.lastMove)!=i:!function(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}(this.view,i,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function oI(e,t){let n=e.plugin(oS);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}let oD=eX.define(),oL=eC.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function oj(e,t){let n=e.plugin(oN),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}let oN=nV.fromClass(class{constructor(e){this.input=e.state.facet(oz),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(oL);for(let n of(this.top=new oF(e,!0,t.topContainer),this.bottom=new oF(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(oL);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new oF(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new oF(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(oz);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],o=[],s=[];for(let n of t){let t=this.specs.indexOf(n),a;t<0?(a=n(e.view),s.push(a)):(a=this.panels[t]).update&&a.update(e),r.push(a),(a.top?i:o).push(a)}for(let e of(this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o),s))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>iF.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class oF{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=oB(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=oB(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 oB(e){let t=e.nextSibling;return e.remove(),t}let oz=eC.define({enables:oN});class oV extends e8{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}oV.prototype.elementClass="",oV.prototype.toDOM=void 0,oV.prototype.mapMode=eh.TrackBefore,oV.prototype.startSide=oV.prototype.endSide=-1,oV.prototype.point=!0;let oH=eC.define(),o$=eC.define(),oW={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},oU=eC.define();function oq(e){return[oK(),oU.of({...oW,...e})]}let oQ=eC.define({combine:e=>e.some(e=>e)});function oK(e){let t=[oG];return e&&!1===e.fixed&&t.push(oQ.of(!0)),t}let oG=nV.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.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=e.state.facet(oU).map(t=>new oJ(e,t)),this.fixed=!e.state.facet(oQ),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.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(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.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(oQ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=te.iter(this.view.state.facet(oH),this.view.viewport.from),r=[],i=this.gutters.map(e=>new oZ(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==tW.Text&&t){for(let e of(oY(n,r,o.from),i))e.line(this.view,o,r);t=!1}else if(o.widget)for(let e of i)e.widget(this.view,o)}else if(e.type==tW.Text)for(let t of(oY(n,r,e.from),i))t.line(this.view,e,r);else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(oU),n=e.state.facet(oU),r=e.docChanged||e.heightChanged||e.viewportChanged||!te.eq(e.startState.facet(oH),e.state.facet(oH),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new oJ(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>i.indexOf(e)&&e.destroy();for(let e of i)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>iF.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==nl.LTR?{left:r,right:i}:{right:r,left:i}})});function oX(e){return Array.isArray(e)?e:[e]}function oY(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class oZ{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=te.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let t=new o0(e,o,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,o,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];oY(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;(0!=r.length||o.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(o$)){let i=n(e,t.widget,t);i&&(r||(r=[])).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class oJ{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,r)&&r.preventDefault()});this.markers=oX(t.markers(e)),t.initialSpacer&&(this.spacer=new o0(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=oX(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!te.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class o0{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)&&this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let i=0,o=0;;){let s=o,a=i<t.length?t[i++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!a)break;a.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let o1=eC.define(),o2=eC.define(),o5=eC.define({combine:e=>e4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class o3 extends oV{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function o4(e,t){return e.state.facet(o5).formatNumber(t,e.state)}let o8=oU.compute([o5],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(o1),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new o3(o4(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(o2)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(o5)!=e.state.facet(o5),initialSpacer:e=>new o3(o4(e,o7(e.state.doc.lines))),updateSpacer(e,t){let n=o4(t.view,o7(t.view.state.doc.lines));return n==e.number?e:new o3(n)},domEventHandlers:e.facet(o5).domEventHandlers,side:"before"}));function o6(e={}){return[o5.of(e),oK(),o8]}function o7(e){let t=9;for(;t<e;)t=10*t+9;return t}let o9=new class extends oV{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},se=oH.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(o9.range(i)))}return te.of(t)}),st=0;class sn{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=st++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof sn&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new sn("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new si(e);return e=>e.modified.indexOf(t)>-1?e:si.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let sr=0;class si{constructor(e){this.name=e,this.instances=[],this.id=sr++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r,i;return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every((e,t)=>e==i[t]))});if(n)return n;let r=[],i=new sn(e.name,r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)r.push(si.get(t,e));return i}}function so(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){i=0;break}if("/"!=s)throw RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw RangeError("Invalid path: "+e);let l=new sa(r,i,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return ss.add(t)}let ss=new g({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new sa(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class sa{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}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}}function sl(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function su(e,t,n,r=0,i=e.length){let o=new sc(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}sa.empty=new sa([],2,null);class sc{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:o,from:s,to:a}=e;if(s>=n||a<=t)return;o.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=r,u=function(e){let t=e.type.prop(ss);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||sa.empty,c=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(i,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,s),l),u.opaque)return;let d=e.tree&&e.tree.prop(g.mounted);if(d&&d.overlay){let o=e.node.enter(d.overlay[0].from+s,1),u=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),c=e.firstChild();for(let h=0,f=s;;h++){let p=h<d.overlay.length?d.overlay[h]:null,g=p?p.from+s:a,m=Math.max(t,f),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,r,i),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!p||g>n)break;(f=p.to+s)>t&&(this.highlightRange(o.cursor(),Math.max(t,p.from+s),Math.min(n,f),"",u),this.startSpan(Math.min(n,f),l))}c&&e.parent()}else if(e.firstChild()){d&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling())e.parent()}}}let sd=sn.define,sh=sd(),sf=sd(),sp=sd(sf),sg=sd(sf),sm=sd(),sv=sd(sm),sy=sd(sm),sb=sd(),sx=sd(sb),sw=sd(),s_=sd(),sk=sd(),sS=sd(sk),sC=sd(),sO={comment:sh,lineComment:sd(sh),blockComment:sd(sh),docComment:sd(sh),name:sf,variableName:sd(sf),typeName:sp,tagName:sd(sp),propertyName:sg,attributeName:sd(sg),className:sd(sf),labelName:sd(sf),namespace:sd(sf),macroName:sd(sf),literal:sm,string:sv,docString:sd(sv),character:sd(sv),attributeValue:sd(sv),number:sy,integer:sd(sy),float:sd(sy),bool:sd(sm),regexp:sd(sm),escape:sd(sm),color:sd(sm),url:sd(sm),keyword:sw,self:sd(sw),null:sd(sw),atom:sd(sw),unit:sd(sw),modifier:sd(sw),operatorKeyword:sd(sw),controlKeyword:sd(sw),definitionKeyword:sd(sw),moduleKeyword:sd(sw),operator:s_,derefOperator:sd(s_),arithmeticOperator:sd(s_),logicOperator:sd(s_),bitwiseOperator:sd(s_),compareOperator:sd(s_),updateOperator:sd(s_),definitionOperator:sd(s_),typeOperator:sd(s_),controlOperator:sd(s_),punctuation:sk,separator:sd(sk),bracket:sS,angleBracket:sd(sS),squareBracket:sd(sS),paren:sd(sS),brace:sd(sS),content:sb,heading:sx,heading1:sd(sx),heading2:sd(sx),heading3:sd(sx),heading4:sd(sx),heading5:sd(sx),heading6:sd(sx),contentSeparator:sd(sb),list:sd(sb),quote:sd(sb),emphasis:sd(sb),strong:sd(sb),link:sd(sb),monospace:sd(sb),strikethrough:sd(sb),inserted:sd(),deleted:sd(),changed:sd(),invalid:sd(),meta:sC,documentMeta:sd(sC),annotation:sd(sC),processingInstruction:sd(sC),definition:sn.defineModifier("definition"),constant:sn.defineModifier("constant"),function:sn.defineModifier("function"),standard:sn.defineModifier("standard"),local:sn.defineModifier("local"),special:sn.defineModifier("special")};for(let e in sO){let t=sO[e];t instanceof sn&&(t.name=e)}sl([{tag:sO.link,class:"tok-link"},{tag:sO.heading,class:"tok-heading"},{tag:sO.emphasis,class:"tok-emphasis"},{tag:sO.strong,class:"tok-strong"},{tag:sO.keyword,class:"tok-keyword"},{tag:sO.atom,class:"tok-atom"},{tag:sO.bool,class:"tok-bool"},{tag:sO.url,class:"tok-url"},{tag:sO.labelName,class:"tok-labelName"},{tag:sO.inserted,class:"tok-inserted"},{tag:sO.deleted,class:"tok-deleted"},{tag:sO.literal,class:"tok-literal"},{tag:sO.string,class:"tok-string"},{tag:sO.number,class:"tok-number"},{tag:[sO.regexp,sO.escape,sO.special(sO.string)],class:"tok-string2"},{tag:sO.variableName,class:"tok-variableName"},{tag:sO.local(sO.variableName),class:"tok-variableName tok-local"},{tag:sO.definition(sO.variableName),class:"tok-variableName tok-definition"},{tag:sO.special(sO.variableName),class:"tok-variableName2"},{tag:sO.definition(sO.propertyName),class:"tok-propertyName tok-definition"},{tag:sO.typeName,class:"tok-typeName"},{tag:sO.namespace,class:"tok-namespace"},{tag:sO.className,class:"tok-className"},{tag:sO.macroName,class:"tok-macroName"},{tag:sO.propertyName,class:"tok-propertyName"},{tag:sO.operator,class:"tok-operator"},{tag:sO.comment,class:"tok-comment"},{tag:sO.meta,class:"tok-meta"},{tag:sO.invalid,class:"tok-invalid"},{tag:sO.punctuation,class:"tok-punctuation"}]);let sE=new g,sM=new g;class sA{constructor(e,t,n=[],r=""){this.data=e,this.name=r,e3.prototype.hasOwnProperty("tree")||Object.defineProperty(e3.prototype,"tree",{get(){return sR(this)}}),this.parser=t,this.extension=[sV.of(this),e3.languageData.of((e,t,n)=>{let r=sP(e,t,n),i=r.type.prop(sE);if(!i)return[];let o=e.facet(i),s=r.type.prop(sM);if(s){let i=r.resolve(t-r.from,n);for(let t of s)if(t.test(i,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return sP(e,t,n).type.prop(sE)==this.data}findRegions(e){let t=e.facet(sV);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(sE)==this.data)return void n.push({from:t,to:t+e.length});let i=e.prop(g.mounted);if(i){if(i.tree.prop(sE)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof _&&r(i,e.positions[n]+t)}};return r(sR(e),0),n}get allowsNesting(){return!0}}function sP(e,t,n){let r=e.facet(sV),i=sR(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,c.ExcludeBuffers))e.type.isTop&&(i=e);return i}sA.setState=eX.define();class sT extends sA{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,eC.define({combine:t?e=>e.concat(t):void 0}));return new sT(n,e.parser.configure({props:[sE.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new sT(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function sR(e){let t=e.field(sA.state,!1);return t?t.tree:_.empty}class sI{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,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let sD=null;class sL{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new sL(e,t,[],_.empty,0,n,[],null)}startParse(){return this.parser.startParse(new sI(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=_.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(z.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(z.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=sD;sD=this;try{return e()}finally{sD=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sj(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=z.applyChanges(n,t),r=_.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(s=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&s.push({from:n,to:r})}}return new sL(this.parser,t,n,r,i,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=sj(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends V{createParse(t,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let t=sD;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new _(y.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return sD}}function sj(e,t,n){return z.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class sN{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new sN(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=sL.create(e.facet(sV).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new sN(n)}}sA.state=eT.define({create:sN.init,update(e,t){for(let e of t.effects)if(e.is(sA.setState))return e.value;return t.startState.facet(sV)!=t.state.facet(sV)?sN.init(t.state):e.apply(t)}});let sF=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(sF=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let sB="undefined"!=typeof navigator&&(null==(d=navigator.scheduling)?void 0:d.isInputPending)?()=>navigator.scheduling.isInputPending():null,sz=nV.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 t=this.view.state.field(sA.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(sA.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=sF(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(sA.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!sB?Math.max(25,e.timeRemaining()-5):1e9),s=i.context.treeLen<r&&n.doc.length>r+1e3,a=i.context.work(()=>sB&&sB()||Date.now()>o,r+1e5*!s);this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:sA.setState.of(new sN(i.context))})),this.chunkBudget>0&&!(a&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>nN(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sV=eC.define({combine:e=>e.length?e[0]:null,enables:e=>[sA.state,sz,iF.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class sH{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let s$=eC.define(),sW=eC.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function sU(e){let t=e.facet(sW);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function sq(e,t){let n="",r=e.tabSize,i=e.facet(sW)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function sQ(e,t){for(let n of(e instanceof e3&&(e=new sK(e)),e.state.facet(s$))){let r=n(e,t);if(void 0!==r)return r}let n=sR(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return sX(r,e,n)}(e,n,t):null}class sK{constructor(e,t={}){this.state=e,this.options=t,this.unit=sU(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;if(null!=r&&r>=n.from&&r<=n.to)if(i&&r==e)return{text:"",from:e};else if(t<0?r<e:r<=e)return{text:n.text.slice(r-n.from),from:r};else return{text:n.text.slice(0,r-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return th(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let sG=new g;function sX(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(sG);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(g.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>s0(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?sY:null}(r.node);if(e)return e(sZ.create(t,n,r))}return 0}function sY(){return 0}class sZ extends sK{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new sZ(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return sX(this.context.next,this.base,this.pos)}}function sJ({closing:e,align:t=!0,units:n=1}){return r=>s0(r,t,n,e)}function s0(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}let s1=eC.define(),s2=new g;function s5(e,t,n){for(let r of e.facet(s1)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=sR(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let i=s.node;if(i.to<=n||i.from>n)continue;if(o&&i.from<t)break;let a=i.type.prop(s2);if(a&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=a(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function s3(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let s4=eX.define({map:s3}),s8=eX.define({map:s3});function s6(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let s7=eT.define({create:()=>tU.none,update(e,t){for(let n of(t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=s9(e,t,n)),e=e.map(t.changes),t.effects))if(n.is(s4)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(ao),i=r?tU.replace({widget:new au(r(t.state,n.value))}):al;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(s8)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=s9(e,t.selection.main.head)),e},provide:e=>iF.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(al.range(r,i))}return tU.set(t,!0)}});function s9(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function ae(e,t,n){var r;let i=null;return null==(r=e.field(s7,!1))||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function at(e,t){return e.field(s7,!1)?t:t.concat(eX.appendConfig.of(as()))}function an(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return iF.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let ar=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of s6(e)){let n=s5(e.state,t.from,t.to);if(n)return e.dispatch({effects:at(e.state,[s4.of(n),an(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(s7,!1))return!1;let t=[];for(let n of s6(e)){let r=ae(e.state,n.from,n.to);r&&t.push(s8.of(r),an(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=s5(t,i.from,i.to);o&&n.push(s4.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:at(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(s7,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(s8.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],ai={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ao=eC.define({combine:e=>e4(e,ai)});function as(e){let t=[s7,ah];return e&&t.push(ao.of(e)),t}function aa(e,t){let{state:n}=e,r=n.facet(ao),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=ae(e.state,n.from,n.to);r&&e.dispatch({effects:s8.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}let al=tU.replace({widget:new class extends t${toDOM(e){return aa(e,null)}}});class au extends t${constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return aa(e,this.value)}}let ac={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ad extends oV{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let ah=iF.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 af{constructor(e,t){let n;function r(e){let t=tv.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof sA?e=>e.prop(sE)==o.data:o?e=>e==o:void 0,this.style=sl(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new tv(n):null,this.themeType=t.themeType}static define(e,t){return new af(e,t||{})}}let ap=eC.define(),ag=eC.define({combine:e=>e.length?[e[0]]:null});function am(e){let t=e.facet(ap);return t.length?t:e.facet(ag)}function av(e,t){let n=[ay],r;return e instanceof af&&(e.module&&n.push(iF.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(ag.of(e)):r?n.push(ap.computeN([iF.darkTheme],t=>t.facet(iF.darkTheme)==("dark"==r)?[e]:[])):n.push(ap.of(e)),n}let ay=eI.high(nV.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=sR(e.state),this.decorations=this.buildDeco(e,am(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=sR(e.state),n=am(e.state),r=n!=am(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return tU.none;let n=new tt;for(let{from:r,to:i}of e.visibleRanges)su(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=tU.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),ab=af.define([{tag:sO.meta,color:"#404740"},{tag:sO.link,textDecoration:"underline"},{tag:sO.heading,textDecoration:"underline",fontWeight:"bold"},{tag:sO.emphasis,fontStyle:"italic"},{tag:sO.strong,fontWeight:"bold"},{tag:sO.strikethrough,textDecoration:"line-through"},{tag:sO.keyword,color:"#708"},{tag:[sO.atom,sO.bool,sO.url,sO.contentSeparator,sO.labelName],color:"#219"},{tag:[sO.literal,sO.inserted],color:"#164"},{tag:[sO.string,sO.deleted],color:"#a11"},{tag:[sO.regexp,sO.escape,sO.special(sO.string)],color:"#e40"},{tag:sO.definition(sO.variableName),color:"#00f"},{tag:sO.local(sO.variableName),color:"#30a"},{tag:[sO.typeName,sO.namespace],color:"#085"},{tag:sO.className,color:"#167"},{tag:[sO.special(sO.variableName),sO.macroName],color:"#256"},{tag:sO.definition(sO.propertyName),color:"#00c"},{tag:sO.comment,color:"#940"},{tag:sO.invalid,color:"#f00"}]),ax=iF.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),aw="()[]{}",a_=eC.define({combine:e=>e4(e,{afterCursor:!0,brackets:aw,maxScanDistance:1e4,renderMatch:aC})}),ak=tU.mark({class:"cm-matchingBracket"}),aS=tU.mark({class:"cm-nonmatchingBracket"});function aC(e){let t=[],n=e.matched?ak:aS;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let aO=[eT.define({create:()=>tU.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(a_);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=aP(t.state,e.head,-1,r)||e.head>0&&aP(t.state,e.head-1,1,r)||r.afterCursor&&(aP(t.state,e.head,1,r)||e.head<t.state.doc.length&&aP(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return tU.set(n,!0)},provide:e=>iF.decorations.from(e)}),ax],aE=new g;function aM(e,t,n){let r=e.prop(t<0?g.openedBy:g.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function aA(e){let t=e.type.prop(aE);return t?t(e.node):e}function aP(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||aw,s=sR(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let r=aM(e.type,n,o);if(r&&e.from<e.to){let i=aA(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},u=0,c=null==a?void 0:a.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(0==u&&o.indexOf(c.type.name)>-1&&c.from<c.to){let e=aA(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(aM(c.type,n,s))u++;else if(aM(c.type,-n,s)){if(0==u){let e=aA(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling())return{start:l,matched:!1}}(0,0,n,e,i,r,o)}}return function(e,t,n,r,i,o,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0)&&r.resolveInner(a+e,1).type==i)if(t%2==0==n>0)d++;else{if(1==d)return{start:u,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};d--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,s,a.type,i,o)}let aT=Object.create(null),aR=[y.none],aI=[],aD=Object.create(null),aL=Object.create(null);for(let[e,t]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"]])aL[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||sO[n];r?"function"==typeof r?t.length?t=t.map(r):aj(n,`Modifier ${n} used at start of tag`):t.length?aj(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:aj(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),o=aD[i];if(o)return o.id;let s=aD[i]=y.define({id:aR.length,name:r,props:[so({[r]:n})]});return aR.push(s),s.id}(aT,t);function aj(e,t){aI.indexOf(e)>-1||(aI.push(e),console.warn(t))}nl.RTL,nl.LTR;var aN=e.i(316575);class aF{constructor(e,t,n,r,i,o,s,a,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new aF(e,[],t,n,n,0,[],0,r?new aB(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:i}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=i.dynamicPrecedence(r);if(s&&(this.score+=s),0==n){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(n-1)*3-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,u=this.reducePos-l;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[r])?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=a?this.stack[a-1]:0,d=this.bufferBase+this.buffer.length-c;if(r<i.minRepeatTerm||131072&e){let e=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,e,d+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=i.getGoto(e,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(0==r&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&(0!=this.buffer[i-4]||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(e,1)||(this.reducePos=r)),this.pushState(e,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new aF(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new az(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,i=this.stack.length-3*n;if(i<0||0>e.getGoto(this.stack[i],r,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let r=65535&t,i=this.stack.length-3*n;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new aB(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class aB{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class az{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class aV{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new aV(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}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]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new aV(this.stack,this.pos,this.index)}}function aH(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class a${constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let aW=new a$;class aU{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=aW,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=aW,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class aq{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;aK(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}aq.prototype.contextual=aq.prototype.fallback=aq.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?aH(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(aK(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&r++,null==i)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}).prototype.contextual=aq.prototype.fallback=aq.prototype.extend=!1;class aQ{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function aK(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;t:for(;(a&e[s])!=0;){let n=e[s+1];for(let r=s+3;r<n;r+=2)if((e[r+1]&a)>0){let n=e[r];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,r){let i=aG(n,r,t);return i<0||aG(n,r,e)<i}(n,t.token.value,i,o))){t.acceptToken(n);break}}let r=t.next,u=0,c=e[s+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){s=e[n+3*c-1];continue}for(;u<c;){let i=u+c>>1,o=n+i+(i<<1),a=e[o],l=e[o+1]||65536;if(r<a)c=i;else if(r>=l)u=i+1;else{s=e[o+2],t.advance();continue t}}break}}function aG(e,t,n){for(let r=t,i;65535!=(i=e[r]);r++)if(i==n)return r-t;return -1}let aX=void 0!==aN.default&&aN.default.env&&/\bparse\b/.test(aN.default.env.LOG),aY=null;function aZ(e,t,n){let r=e.cursor(c.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class aJ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?aZ(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?aZ(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof _){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(g.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class a0{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new a$)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let r=0;r<i.length;r++){if((1<<r&o)==0)continue;let l=i[r],u=this.tokens[r];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=s)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=s),u.lookAhead>u.end+25&&(a=Math.max(u.lookAhead,a)),0!=u.value)){let r=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||((n=new a$).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new a$,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){(1&i)==0?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let a=o.stateSlot(i,e?2:1);;a+=3){if(65535==s[a])if(1==s[a+1])a=a8(s,a+2);else{0==r&&2==s[a+1]&&(r=this.putAction(a8(s,a+2),t,n,r));break}s[a]==t&&(r=this.putAction(a8(s,a+1),t,n,r))}return r}}class a1{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new aU(t,r),this.tokens=new a0(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[aF.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>4*e.bufferLength?new aJ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let s=n[o];for(;;){if(this.tokens.mainToken=null,s.pos>r)i.push(s);else{if(this.advanceStack(s,i,n))continue;e||(e=[],t=[]),e.push(s);let r=this.tokens.getMainToken(s);t.push(r.value,r.end)}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return aX&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw aX&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return aX&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort((e,t)=>t.score-e.score);i.length>e;)i.pop();i.some(e=>e.reducePos>r)&&this.recovering--}else if(i.length>1){e:for(let e=0;e<i.length-1;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let r=i[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500)if((t.score-r.score||t.buffer.length-r.buffer.length)>0)i.splice(n--,1);else{i.splice(e--,1);continue e}}}i.length>12&&(i.sort((e,t)=>t.score-e.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let e=1;e<i.length;e++)i[e].pos<this.minStackPos&&(this.minStackPos=i[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,o=aX?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(r);s;){let r=this.parser.nodeSet.types[s.type.id]==s.type?i.getGoto(e.state,s.type.id):-1;if(r>-1&&s.length&&(!t||(s.prop(g.contextHash)||0)==n))return e.useNode(s,r),aX&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(s.type.id)})`),!0;if(!(s instanceof _)||0==s.children.length||s.positions[0]>0)break;let a=s.children[0];if(a instanceof _&&0==s.positions[0])s=a;else break}}let s=i.stateSlot(e.state,4);if(s>0)return e.reduce(s),aX&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let s=0;s<a.length;){let l=a[s++],u=a[s++],c=a[s++],d=s==a.length||!n,h=d?e:e.split(),f=this.tokens.mainToken;if(h.apply(l,u,f?f.start:h.pos,c),aX&&console.log(o+this.stackID(h)+` (via ${(65536&l)==0?"shift":`reduce of ${i.getName(65535&l)}`} for ${i.getName(u)} @ ${r}${h==e?"":", split"})`),d)return!0;h.pos>r?t.push(h):n.push(h)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return a2(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=t[o<<1],l=t[(o<<1)+1],u=aX?this.stackID(s)+" -> ":"";if(s.deadEnd&&(i||(i=!0,s.restart(),aX&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let c=s.split(),d=u;for(let e=0;e<10&&c.forceReduce()&&(aX&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)aX&&(d=this.stackID(c)+" -> ");for(let e of s.recoverByInsert(a))aX&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),aX&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),a2(s,n)):(!r||r.score<s.score)&&(r=s)}return r}stackToTree(e){return e.close(),_.build({buffer:aV.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(aY||(aY=new WeakMap)).get(e);return t||aY.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function a2(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class a5{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}let a3=e=>e;class a4 extends V{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=g[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let o=t[n+-r];for(let s=-r;s>0;s--)i(t[n++],e,o);n++}}}this.nodeSet=new b(t.map((t,i)=>y.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=aH(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(a6),this.states=aH(e.states,Uint32Array),this.data=aH(e.stateData),this.goto=aH(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new aq(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new a1(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return -1;for(let i=r[t+1];;){let t=r[i++],o=1&t,s=r[i++];if(o&&n)return s;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return s;if(o)return -1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),o;;i+=3){if(65535==(o=n[i]))if(1==n[i+1])o=n[i=a8(n,i+2)];else if(2==n[i+1])return a8(n,i+2);else break;if(o==t||0==o)return a8(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=a8(this.data,n+2);else break;r=t(a8(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=a8(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(a4.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=a6(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;65535!=(i=this.data[n++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[i]=1;return new a5(e,n,r)}static deserialize(e){return new a4(e)}}function a8(e,t){return e[t]|e[t+1]<<16}function a6(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}class a7{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=sR(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(lr(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function a9(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function le(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=a9(t)+a9(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}class lt{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function ln(e){return e.selection.main.from}function lr(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let li=eQ.define(),lo=new WeakMap;function ls(e){if(!Array.isArray(e))return e;let t=lo.get(e);return t||lo.set(e,t=le(e)),t}let la=eX.define(),ll=eX.define();class lu{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=el(e,t),r=ec(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(el(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(1==t.length){let r=el(e,0),i=ec(r),o=i==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,i])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<a;){let o=el(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=ec(o)}if(l<a)return null}let u=0,c=0,d=!1,h=0,f=-1,p=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&c<a;){let l=el(e,r);s<0&&(u<a&&l==t[u]&&(i[u++]=r),h<a&&(l==t[h]||l==n[h]?(0==h&&(f=r),p=r+1,h++):h=0));let y,b=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=eu(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!r||1==b&&g||0==v&&0!=b)&&(t[c]==l||n[c]==l&&(d=!0)?o[c++]=r:o.length&&(m=!1)),v=b,r+=ec(l)}return c==a&&0==o[0]&&m?this.result(-100+(d?-200:0),o,e):h==a&&0==f?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==a?this.ret(-900-e.length,[f,p]):c==a?this.result(-100+(d?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?ec(el(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}}class lc{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let ld=eC.define({combine:e=>e4(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:lf,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>lh(e(n),t(n)),optionClass:(e,t)=>n=>lh(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function lh(e,t){return e?t?e+" "+t:e:t}function lf(e,t,n,r,i,o){let s=e.textDirection==nl.RTL,a=s,l=!1,u="top",c,d,h=t.left-i.left,f=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&h<Math.min(p,f)?a=!1:!a&&f<Math.min(p,h)&&(a=!0),p<=(a?h:f))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,d=Math.min(400,a?h:f);else{l=!0,d=Math.min(400,(s?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${d/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function lp(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class lg{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:i,selected:o}=r.open,s=e.state.facet(ld);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement("span");i.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>s&&i.appendChild(document.createTextNode(o.slice(s,t)));let a=i.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<o.length&&i.appendChild(document.createTextNode(o.slice(s))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=lp(i.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(ld).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:ll.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:s}=n.open;r.open&&r.open.options==i||(this.range=lp(i.length,o,e.state.facet(ld).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),s!=(null==(t=r.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=lp(t.options.length,t.selected,this.view.state.facet(ld).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o="string"==typeof i?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>nN(this.view.state,e,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,o,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/o:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.bottom)/o)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(ld).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let i=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=i&&(o>n.from||0==n.from)&&(i=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}let u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(s);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(s,this.view.state,this.view,a);t&&u.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function lm(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class lv{constructor(e,t,n,r,i,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new lv(this.options,lw(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,o){if(r&&!o&&e.some(e=>e.isPending))return r.setDisabled();let s=function(e,t){let n=[],r=null,i=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},s=t.facet(ld);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)o(new lt(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),a,l=s.filterStrict?new lc(n):new lu(n);for(let t of r.result.options)if(a=l.match(t.label)){let n=t.displayLabel?e?e(t,a.matched):[]:a.matched,s=a.score+(t.boost||0);if(o(new lt(t,r.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(s,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],l=null,u=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?lm(e.completion)>lm(l)&&(a[a.length-1]=e):a.push(e),l=e.completion}return a}(e,t);if(!s.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let a=t.facet(ld).selectOnOpen?0:-1;if(r&&r.selected!=a&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){a=t;break}}return new lv(s,lw(n,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:lP,above:i.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new lv(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new lv(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class ly{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new ly(l_,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ld),r=(n.override||t.languageDataAt("autocomplete",ln(t)).map(ls)).map(t=>(this.active.find(e=>e.source==t)||new lS(t,+!!this.active.some(e=>0!=e.state))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,o=e.effects.some(e=>e.is(lO));for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||o?i=lv.build(r,t,this.id,i,n,o):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new lS(e.source,0):e)),e.effects))s.is(lE)&&(i=i&&i.setSelected(s.value,this.id));return r==this.active&&i==this.open?this:new ly(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?lb:lx}}let lb={"aria-autocomplete":"list"},lx={};function lw(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let l_=[];function lk(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(li);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class lS{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=lk(e,t),r=this;for(let t of((8&n||16&n&&this.touches(e))&&(r=new lS(r.source,0)),4&n&&0==r.state&&(r=new lS(this.source,1)),r=r.updateFor(e,n),e.effects))if(t.is(la))r=new lS(r.source,1,t.value);else if(t.is(ll))r=new lS(r.source,0);else if(t.is(lO))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ln(e.state))}}class lC extends lS{constructor(e,t,n,r,i,o){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=ln(e.state);if(s>o||!r||2&t&&(ln(e.startState)==this.from||s<this.limit))return new lS(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):lr(e,!0).test(i)}(r.validFor,e.state,i,o)?r.update&&(r=r.update(r,i,o,new a7(e.state,s,!1)))?new lC(this.source,this.explicit,a,r,r.from,null!=(n=r.to)?n:ln(e.state)):new lS(this.source,1,this.explicit):new lC(this.source,this.explicit,a,r,i,o)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new lC(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new lS(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let lO=eX.define({map:(e,t)=>e.map(e=>e.map(t))}),lE=eX.define(),lM=eT.define({create:()=>ly.start(),update:(e,t)=>e.update(t),provide:e=>[oM.from(e,e=>e.tooltip),iF.contentAttributes.from(e,e=>e.attrs)]});function lA(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(lM).active.find(e=>e.source==t.source);return r instanceof lC&&("string"==typeof n?e.dispatch({...function(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:e_.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,r.from,r.to),annotations:li.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}let lP=e=>new lg(e,lM,lA);function lT(e,t="option"){return n=>{let r=n.state.field(lM,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ld).interactionDelay)return!1;let i=1,o;"page"==t&&(o=oI(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:lE.of(a)}),!0}}let lR=e=>!!e.state.field(lM,!1)&&(e.dispatch({effects:la.of(!0)}),!0);class lI{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let lD=nV.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(lM).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(lM),n=e.state.facet(ld);if(!e.selectionSet&&!e.docChanged&&e.startState.field(lM)==t)return;let r=e.transactions.some(e=>{let t=lk(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){nN(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(la)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(lM);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ld).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=ln(t),r=new a7(t,n,e.explicit,this.view),i=new lI(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(e=>{i.context.aborted||(i.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:ll.of(null)}),nN(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ld).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ld),r=this.view.state.field(lM);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(void 0===o.done)continue;if(this.running.splice(i--,1),o.done){let r=ln(o.updates.length?o.updates[0].startState:this.view.state),i=Math.min(r,o.done.from+ +!o.active.explicit),s=new lC(o.active.source,o.active.explicit,i,o.done,o.done.from,null!=(e=o.done.to)?e:r);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=r.active.find(e=>e.source==o.active.source);if(s&&s.isPending)if(null==o.done){let e=new lS(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:lO.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(lM,!1);if(t&&t.tooltip&&this.view.state.facet(ld).closeOnBlur){let n=t.open&&oI(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:ll.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:la.of(!1)}),20),this.composing=0}}}),lL="object"==typeof navigator&&/Win/.test(navigator.platform),lj=eI.highest(iF.domEventHandlers({keydown(e,t){let n=t.state.field(lM,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(lL&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&lA(t,r),!1}})),lN=iF.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),lF=tU.widget({widget:new class extends t${toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),lB=tU.mark({class:"cm-snippetField"});class lz{constructor(e,t){this.ranges=e,this.active=t,this.deco=tU.set(e.map(e=>(e.from==e.to?lF:lB).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new lz(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}let lV=eX.define({map:(e,t)=>e&&e.map(t)}),lH=eX.define(),l$=eT.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(lV))return n.value;if(n.is(lH)&&e)return new lz(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>iF.decorations.from(e,e=>e?e.deco:tU.none)});function lW(e){return({state:t,dispatch:n})=>{var r;let i=t.field(l$,!1);if(!i||e<0&&0==i.active)return!1;let o=i.active+e,s=e>0&&!i.ranges.some(t=>t.field==o+e);return n(t.update({selection:(r=i.ranges,e_.create(r.filter(e=>e.field==o).map(e=>e_.range(e.from,e.to)))),effects:lV.of(s?null:new lz(i.ranges,o)),scrollIntoView:!0})),!0}}let lU=[{key:"Tab",run:lW(1),shift:lW(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(l$,!1)&&(t(e.update({effects:lV.of(null)})),!0)}],lq={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},lQ=eX.define({map(e,t){let n=t.mapPos(e,-1,eh.TrackAfter);return null==n?void 0:n}}),lK=new class extends e8{};lK.startSide=1,lK.endSide=-1;let lG=eT.define({create:()=>te.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(lQ)&&(e=e.update({add:[lK.range(n.value,n.value+1)]}));return e}}),lX="()[]{}<>«»»«[]{}";function lY(e){for(let t=0;t<lX.length;t+=2)if(lX.charCodeAt(t)==e)return lX.charAt(t+1);return eu(e<128?e:e+1)}function lZ(e,t){return e.languageDataAt("closeBrackets",t)[0]||lq}let lJ="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),l0=iF.inputHandler.of((e,t,n,r)=>{if((lJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||2==r.length&&1==ec(el(r,0))||t!=i.from||n!=i.to)return!1;let o=function(e,t){let n=lZ(e,e.selection.main.head),r=n.brackets||lq.brackets;for(let i of r){let o=lY(el(i,0));if(t==i)return o==i?function(e,t,n,r){let i=r.stringPrefixes||lq.stringPrefixes,o=null,s=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:lQ.of(r.to+t.length),range:e_.range(r.anchor+t.length,r.head+t.length)};let s=r.head,a=l5(e.doc,s),l;if(a==t){if(l3(e,s))return{changes:{insert:t+t,from:s},effects:lQ.of(s+t.length),range:e_.cursor(s+t.length)};else if(l2(e,s)){let r=n&&e.sliceDoc(s,s+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:s,to:s+r.length,insert:r},range:e_.cursor(s+r.length)}}}else if(n&&e.sliceDoc(s-2*t.length,s)==t+t&&(l=l4(e,s-2*t.length,i))>-1&&l3(e,l))return{changes:{insert:t+t+t+t,from:s},effects:lQ.of(s+t.length),range:e_.cursor(s+t.length)};else if(e.charCategorizer(s)(a)!=e2.Word&&l4(e,s,i)>-1&&!function(e,t,n,r){let i=sR(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&r.indexOf(s.slice(0,a))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=i.to==t&&i.parent;if(!l)break;i=l}return!1}(e,s,t,i))return{changes:{insert:t+t,from:s},effects:lQ.of(s+t.length),range:e_.cursor(s+t.length)};return{range:o=r}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,r.indexOf(i+i+i)>-1,n):function(e,t,n,r){let i=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:lQ.of(o.to+t.length),range:e_.range(o.anchor+t.length,o.head+t.length)};let s=l5(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:lQ.of(o.head+t.length),range:e_.cursor(o.head+t.length)}:{range:i=o}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,o,n.before||lq.before);if(t==o&&l2(e,e.selection.main.from))return function(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&l5(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:e_.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,o)}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}),l1=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=lZ(e,e.selection.main.head).brackets||lq.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){var i,o;let r,s=(i=e.doc,o=t.head,ec(el(r=i.sliceString(o-2,o),0))==r.length?r:r.slice(1));for(let r of n)if(r==s&&l5(e.doc,t.head)==lY(el(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:e_.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function l2(e,t){let n=!1;return e.field(lG).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function l5(e,t){let n=e.sliceString(t,t+2);return n.slice(0,ec(el(n,0)))}function l3(e,t){let n=sR(e).resolveInner(t+1);return n.parent&&n.from==t}function l4(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=e2.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=e2.Word)return n}return -1}let l8=[{key:"Ctrl-Space",run:lR},{mac:"Alt-`",run:lR},{mac:"Alt-i",run:lR},{key:"Escape",run:e=>{let t=e.state.field(lM,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:ll.of(null)}),!0)}},{key:"ArrowDown",run:lT(!0)},{key:"ArrowUp",run:lT(!1)},{key:"PageDown",run:lT(!0,"page")},{key:"PageUp",run:lT(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(lM,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(ld).interactionDelay)&&lA(e,t.open.options[t.open.selected])}}],l6=eI.highest(iq.computeN([ld],e=>e.facet(ld).defaultKeymap?[l8]:[]));function l7(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function l9(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r)return void e.advance();r=n&&!r&&92==e.next,e.advance()}}function ue(e,t){for(;95==e.next||l7(e.next);)null!=t&&(t+=String.fromCharCode(e.next)),e.advance();return t}function ut(e,t){for(;48==e.next||49==e.next;)e.advance();t&&e.next==t&&e.advance()}function un(e,t){for(;;){if(46==e.next){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(69==e.next||101==e.next)for(e.advance(),(43==e.next||45==e.next)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function ur(e){for(;!(e.next<0||10==e.next);)e.advance()}function ui(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}let uo=" \r\n";function us(e,t,n){let r=Object.create(null);for(let t of(r.true=r.false=5,r.null=r.unknown=6,e.split(" ")))t&&(r[t]=20);for(let e of t.split(" "))e&&(r[e]=21);for(let e of(n||"").split(" "))e&&(r[e]=24);return r}let ua="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",ul="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",uu={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:us(ul,ua)};function uc(e){return new aQ(t=>{let{next:n}=t;if(t.advance(),ui(n,uo)){for(;ui(t.next,uo);)t.advance();t.acceptToken(36)}else if(36==n&&e.doubleDollarQuotedStrings){let e=ue(t,"");36==t.next&&(t.advance(),function(e,t){t:for(;;){if(e.next<0)return;if(36==e.next){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue t;e.advance()}if(36==e.next)return void e.advance()}else e.advance()}}(t,e),t.acceptToken(3))}else if(39==n||34==n&&e.doubleQuotedStrings)l9(t,n,e.backslashEscapes),t.acceptToken(3);else if(35==n&&e.hashComments||47==n&&47==t.next&&e.slashComments)ur(t),t.acceptToken(1);else if(45!=n||45!=t.next||e.spaceAfterDashes&&32!=t.peek(1)){if(47==n&&42==t.next){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),42==n&&47==t.next){if(e--,t.advance(),!e)break}else 47==n&&42==t.next&&(e++,t.advance())}t.acceptToken(2)}else if((101==n||69==n)&&39==t.next)t.advance(),l9(t,39,!0),t.acceptToken(3);else if((110==n||78==n)&&39==t.next&&e.charSetCasts)t.advance(),l9(t,39,e.backslashEscapes),t.acceptToken(3);else if(95==n&&e.charSetCasts)for(let n=0;;n++){if(39==t.next&&n>1){t.advance(),l9(t,39,e.backslashEscapes),t.acceptToken(3);break}if(!l7(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(113==n||81==n)&&39==t.next&&t.peek(1)>0&&!ui(t.peek(1),uo)){let e=t.peek(1);t.advance(2),function(e,t){let n="[{<(".indexOf(String.fromCharCode(t)),r=n<0?t:"]}>)".charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&39==e.peek(1))return void e.advance(2);e.advance()}}(t,e),t.acceptToken(3)}else if(ui(n,e.identifierQuotes))l9(t,91==n?93:n,!1),t.acceptToken(19);else if(40==n)t.acceptToken(7);else if(41==n)t.acceptToken(8);else if(123==n)t.acceptToken(9);else if(125==n)t.acceptToken(10);else if(91==n)t.acceptToken(11);else if(93==n)t.acceptToken(12);else if(59==n)t.acceptToken(13);else if(e.unquotedBitLiterals&&48==n&&98==t.next)t.advance(),ut(t),t.acceptToken(22);else if((98==n||66==n)&&(39==t.next||34==t.next)){let n=t.next;t.advance(),e.treatBitsAsBytes?(l9(t,n,e.backslashEscapes),t.acceptToken(23)):(ut(t,n),t.acceptToken(22))}else if(48==n&&(120==t.next||88==t.next)||(120==n||88==n)&&39==t.next){let e=39==t.next;for(t.advance();(i=t.next)>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70;)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(46==n&&t.next>=48&&t.next<=57)un(t,!0),t.acceptToken(4);else if(46==n)t.acceptToken(14);else if(n>=48&&n<=57)un(t,!1),t.acceptToken(4);else if(ui(n,e.operatorChars)){for(;ui(t.next,e.operatorChars);)t.advance();t.acceptToken(15)}else if(ui(n,e.specialVar)){var r,i;if(t.next==n&&t.advance(),39==t.next||34==t.next||96==t.next){let e=t.next;t.advance(),l9(t,e,!1)}else ue(t);t.acceptToken(17)}else if(58==n||44==n)t.acceptToken(16);else if(l7(n)){let i=ue(t,String.fromCharCode(n));t.acceptToken(46==t.next||46==t.peek(-i.length-1)?18:null!=(r=e.words[i.toLowerCase()])?r:18)}}else ur(t),t.acceptToken(1)})}let ud=uc(uu),uh=a4.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ud],topRules:{Script:[0,25]},tokenPrec:0});function uf(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function up(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function ug(e){return e&&("Identifier"==e.name||"QuotedIdentifier"==e.name)}function um(e,t){for(let n=[];;){if(!t||"."!=t.name)return n;let r=uf(t);if(!ug(r))return n;n.unshift(up(e,r)),t=uf(r)}}let uv=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" ")),uy=/^\w*$/,ub=/^[`'"\[]?\w*[`'"\]]?$/;function ux(e){return e.self&&"string"==typeof e.self.label}class uw{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(e){let t=this.children||(this.children=Object.create(null)),n=t[e];return n||(e&&!this.list.some(t=>t.label==e)&&this.list.push(u_(e,"type",this.idQuote,this.idCaseInsensitive)),t[e]=new uw(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion("string"==typeof t?u_(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):ux(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>"."==e?"\0":e).split("\0"),o=this;ux(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&o.addCompletion(r),o=o.child(i[e].replace(/\\\./g,"."));o.addNamespace(n)}}}function u_(e,t,n,r){return RegExp("^[a-z_][a-z_\\d]*$",r?"i":"").test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+uk(n)}}function uk(e){return"["===e?"]":e}let uS=uh.configure({props:[sG.add({Statement:function({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}()}),s2.add({Statement:(e,t)=>({from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}),BlockComment:e=>({from:e.from+2,to:e.to-2})}),so({Keyword:sO.keyword,Type:sO.typeName,Builtin:sO.standard(sO.name),Bits:sO.number,Bytes:sO.string,Bool:sO.bool,Null:sO.null,Number:sO.number,String:sO.string,Identifier:sO.name,QuotedIdentifier:sO.special(sO.string),SpecialVar:sO.special(sO.name),LineComment:sO.lineComment,BlockComment:sO.blockComment,Operator:sO.operator,"Semi Punctuation":sO.punctuation,"( )":sO.paren,"{ }":sO.brace,"[ ]":sO.squareBracket})]});class uC{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(e,t){return new uC(this.dialect,this.language.configure(e,t),this.spec)}static define(e){let t=function(e,t,n,r){let i={};for(let t in uu)i[t]=(e.hasOwnProperty(t)?e:uu)[t];return t&&(i.words=us(t,n||"",r)),i}(e,e.keywords,e.types,e.builtin),n=sT.define({name:"sql",parser:uS.configure({tokenizers:[{from:ud,to:uc(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new uC(t,n,e)}}function uO(e,t){return{label:e,type:t,boost:-1}}function uE(e={}){var t,n,r,i,o,s,a;let l,u,c=e.dialect||uM;return new sH(c.language,[e.schema?(e.dialect||uM).language.data.of({autocomplete:e.schema?(t=e.schema,n=e.tables,r=e.schemas,i=e.defaultTable,o=e.defaultSchema,l=new uw((null==(a=null==(s=e.dialect||uM)?void 0:s.spec.identifierQuotes)?void 0:a[0])||'"',!!(null==s?void 0:s.spec.caseInsensitiveIdentifiers)),u=o?l.child(o):null,l.addNamespace(t),n&&(u||l).addCompletions(n),r&&l.addCompletions(r),u&&l.addCompletions(u.list),i&&l.addCompletions((u||l).child(i).list),e=>{var t,n;let r,o,{parents:s,from:a,quoted:c,empty:d,aliases:h}=(t=e.state,n=e.pos,r=sR(t).resolveInner(n,-1),o=function(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;"Statement"==e.name&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,o=null;t;t=t.nextSibling){let n="Keyword"==t.name?e.sliceString(t.from,t.to).toLowerCase():null,s=null;if(i)if("as"==n&&o&&ug(t.nextSibling))s=up(e,t.nextSibling);else if(n&&uv.has(n))break;else o&&ug(t)&&(s=up(e,t));else i="from"==n;s&&(r||(r=Object.create(null)),r[s]=function(e,t){if("CompositeIdentifier"==t.name){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)ug(r)&&n.push(up(e,r));return n}return[up(e,t)]}(e,o)),o=/Identifier$/.test(t.name)?t:null}return r}(t.doc,r),"Identifier"==r.name||"QuotedIdentifier"==r.name||"Keyword"==r.name?{from:r.from,quoted:"QuotedIdentifier"==r.name?t.doc.sliceString(r.from,r.from+1):null,parents:um(t.doc,uf(r)),aliases:o}:"."==r.name?{from:n,quoted:null,parents:um(t.doc,r),aliases:o}:{from:n,quoted:null,parents:[],empty:!0,aliases:o});if(d&&!e.explicit)return null;h&&1==s.length&&(s=h[s[0]]||s);let f=l;for(let e of s){for(;!f.children||!f.children[e];)if(f==l&&u)f=u;else{if(f!=u||!i)return null;f=f.child(i)}let t=f.maybeChild(e);if(!t)return null;f=t}let p=f.list;if(f==l&&h&&(p=p.concat(Object.keys(h).map(e=>({label:e,type:"constant"})))),!c)return{from:a,options:p,validFor:uy};{let t=c[0],n=uk(t);return{from:a,to:e.state.sliceDoc(e.pos,e.pos+1)==n?e.pos+1:void 0,options:p.map(e=>({...e,label:e.label[0]==t?e.label:t+e.label+n,apply:void 0})),validFor:ub}}}):()=>null}):[],c.language.data.of({autocomplete:function(e,t=!1,n){var r,i,o,s;return r=e.dialect.words,i=n||uO,o=["QuotedIdentifier","String","LineComment","BlockComment","."],s=le(Object.keys(r).map(e=>{var n;return i(t?e.toUpperCase():e,21==(n=r[e])?"type":20==n?"keyword":"variable")})),e=>{for(let t=sR(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return s(e)}}(c,e.upperCaseKeywords,e.keywordCompletion)})])}let uM=uC.define({}),uA=uC.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:ul+"abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:ua+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"});class uP{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}}function uT(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(uI(t)||-1==t)return n}}function uR(e){return 32==e||9==e}function uI(e){return 10==e||13==e}function uD(e){var t;return e<0||uR(t=e)||uI(t)}uP.top=new uP(null,-1,0);let uL=new class{constructor(e){this.start=e.start,this.shift=e.shift||a3,this.reduce=e.reduce||a3,this.reuse=e.reuse||a3,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:uP.top,reduce:(e,t)=>3==e.type&&(20==t||34==t)?e.parent:e,shift(e,t,n,r){if(3==t)return new uP(e,uT(r,r.pos),1);if(65==t||5==t)return new uP(e,uT(r,r.pos),2);if(63==t)return e.parent;if(19==t||33==t)return new uP(e,0,3);if(13==t&&4==e.type)return e.parent;if(47==t){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new uP(e,e.depth+ +t[0],4)}return e},hash:e=>e.hash});function uj(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&uD(e.peek(n+3))}let uN=new aQ((e,t)=>{if(-1==e.next&&t.canShift(64))return e.acceptToken(64);let n=e.peek(-1);if((uI(n)||n<0)&&3!=t.context.type){if(uj(e,45))if(!t.canShift(63))return e.acceptToken(1,3);else e.acceptToken(63);if(uj(e,46))if(!t.canShift(63))return e.acceptToken(2,3);else e.acceptToken(63);let n=0;for(;32==e.next;)n++,e.advance();!(n<t.context.depth)&&(n!=t.context.depth||1!=t.context.type||45==e.next&&uD(e.peek(1)))||-1==e.next||uI(e.next)||35==e.next||e.acceptToken(63,-n)}},{contextual:!0}),uF=new aQ((e,t)=>{if(3==t.context.type){63==e.next&&(e.advance(),uD(e.next)&&e.acceptToken(7));return}if(45==e.next)e.advance(),uD(e.next)&&e.acceptToken(1==t.context.type&&t.context.depth==uT(e,e.pos-1)?4:3);else if(63==e.next)e.advance(),uD(e.next)&&e.acceptToken(2==t.context.type&&t.context.depth==uT(e,e.pos-1)?6:5);else{let n=e.pos;for(;;)if(uR(e.next)){if(e.pos==n)return;e.advance()}else if(33==e.next)uV(e);else if(38==e.next)uH(e);else if(42==e.next){uH(e);break}else if(39==e.next||34==e.next){if(u$(e,!0))break;return}else if(91==e.next||123==e.next){if(!function(e){for(let t=[],n=e.pos+1024;;)if(91==e.next||123==e.next)t.push(e.next),e.advance();else if(39==e.next||34==e.next){if(!u$(e,!0))return!1}else if(93==e.next||125==e.next){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||uI(e.next))return!1;e.advance()}}(e))return;break}else{uq(e,!0,!1,0);break}for(;uR(e.next);)e.advance();if(58==e.next){if(e.pos==n&&t.canShift(29))return;uD(e.peek(1))&&e.acceptTokenTo(2==t.context.type&&t.context.depth==uT(e,n)?66:65,n)}}},{contextual:!0});function uB(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function uz(e,t){var n;return 37==e.next?(e.advance(),uB(e.next)&&e.advance(),uB(e.next)&&e.advance(),!0):(!!((n=e.next)>32)&&!!(n<127)&&34!=n&&37!=n&&44!=n&&60!=n&&62!=n&&92!=n&&94!=n&&96!=n&&123!=n&&124!=n&&125!=n||!!t&&44==e.next)&&(e.advance(),!0)}function uV(e){if(e.advance(),60==e.next){for(e.advance();;)if(!uz(e,!0)){62==e.next&&e.advance();break}}else for(;uz(e,!1););}function uH(e){for(e.advance();!uD(e.next)&&"f"!=uW(e.tag);)e.advance()}function u$(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let o=e.next;if(o<0)break;if(e.advance(),o==n)if(39==o)if(39==e.next)e.advance();else break;else break;else if(92==o&&34==n)e.next>=0&&e.advance();else if(uI(o)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function uW(e){return e<33?"u":e>125?"s":"iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif"[e-33]}function uU(e,t){let n=uW(e);return"u"!=n&&!(t&&"f"==n)}function uq(e,t,n,r){if(!("s"==uW(e.next)||(63==e.next||58==e.next||45==e.next)&&uU(e.peek(1),n)))return!1;e.advance();let i=e.pos;for(;;){var o;let s=e.next,a=0,l=r+1;for(;uR(o=s)||uI(o);){if(uI(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(58==s?uU(e.peek(a+1),n):35==s?32!=e.peek(a-1):uU(s,n)))||!n&&l<=r||0==l&&!n&&(uj(e,45,a)||uj(e,46,a)))break;if(t&&"f"==uW(s))return!1;for(let t=a;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}let uQ=new aQ((e,t)=>{if(33==e.next)uV(e),e.acceptToken(12);else if(38==e.next||42==e.next){let t=38==e.next?10:11;uH(e),e.acceptToken(t)}else 39==e.next||34==e.next?(u$(e,!1),e.acceptToken(9)):uq(e,!1,3==t.context.type,t.context.depth)&&e.acceptToken(8)}),uK=new aQ((e,t)=>{let n=4==t.context.type?t.context.depth:-1,r=e.pos;t:for(;;){let i=0,o=e.next;for(;32==o;)o=e.peek(++i);if(!i&&(uj(e,45,i)||uj(e,46,i))||!uI(o)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break t;let t=uI(e.next);if(e.advance(),t)continue t;r=e.pos}}e.acceptTokenTo(13,r)}),uG=so({DirectiveName:sO.keyword,DirectiveContent:sO.attributeValue,"DirectiveEnd DocEnd":sO.meta,QuotedLiteral:sO.string,BlockLiteralHeader:sO.special(sO.string),BlockLiteralContent:sO.content,Literal:sO.content,"Key/Literal Key/QuotedLiteral":sO.definition(sO.propertyName),"Anchor Alias":sO.labelName,Tag:sO.typeName,Comment:sO.lineComment,": , -":sO.separator,"?":sO.punctuation,"[ ]":sO.squareBracket,"{ }":sO.brace}),uX=a4.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:uL,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[uG],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[uN,uF,uQ,uK,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),uY=sT.define({name:"yaml",parser:uX.configure({props:[sG.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if("BlockLiteralContent"==t.name&&t.from<t.to)return e.baseIndentFor(t);if("BlockLiteral"==t.name)return e.baseIndentFor(t)+e.unit;if("BlockSequence"==t.name||"BlockMapping"==t.name)return e.column(t.from,1);if("QuotedLiteral"==t.name)break;if("Literal"==t.name){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)break}}return null},FlowMapping:sJ({closing:"}"}),FlowSequence:sJ({closing:"]"})}),s2.add({"FlowMapping FlowSequence":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null},"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});sO.meta;var uZ=e.i(230330),uJ=e=>{var{theme:t,settings:n={},styles:r=[]}=e,i={".cm-gutters":{}},o={};n.background&&(o.backgroundColor=n.background),n.backgroundImage&&(o.backgroundImage=n.backgroundImage),n.foreground&&(o.color=n.foreground),n.fontSize&&(o.fontSize=n.fontSize),(n.background||n.foreground)&&(i["&"]=o),n.fontFamily&&(i["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(i[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(i[".cm-content"]={caretColor:n.caret},i[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var s={};return n.gutterActiveForeground&&(s.color=n.gutterActiveForeground),n.lineHighlight&&(i[".cm-activeLine"]={backgroundColor:n.lineHighlight},s.backgroundColor=n.lineHighlight),i[".cm-activeLineGutter"]=s,n.selection&&(i["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(i["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch}),[iF.theme(i,{dark:"dark"===t}),av(af.define(r))]},u0={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},u1=[{tag:[sO.standard(sO.tagName),sO.tagName],color:"#116329"},{tag:[sO.comment,sO.bracket],color:"#6a737d"},{tag:[sO.className,sO.propertyName],color:"#6f42c1"},{tag:[sO.variableName,sO.attributeName,sO.number,sO.operator],color:"#005cc5"},{tag:[sO.keyword,sO.typeName,sO.typeOperator,sO.typeName],color:"#d73a49"},{tag:[sO.string,sO.meta,sO.regexp],color:"#032f62"},{tag:[sO.name,sO.quote],color:"#22863a"},{tag:[sO.heading,sO.strong],color:"#24292e",fontWeight:"bold"},{tag:[sO.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[sO.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[sO.atom,sO.bool,sO.special(sO.variableName)],color:"#e36209"},{tag:[sO.url,sO.escape,sO.regexp,sO.link],color:"#032f62"},{tag:sO.link,textDecoration:"underline"},{tag:sO.strikethrough,textDecoration:"line-through"},{tag:sO.invalid,color:"#cb2431"}],u2=(e=>{var{theme:t="light",settings:n={},styles:r=[]}=e||{};return uJ({theme:t,settings:(0,uZ.default)({},u0,n),styles:[...u1,...r]})})(),u5={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},u3=[{tag:[sO.standard(sO.tagName),sO.tagName],color:"#7ee787"},{tag:[sO.comment,sO.bracket],color:"#8b949e"},{tag:[sO.className,sO.propertyName],color:"#d2a8ff"},{tag:[sO.variableName,sO.attributeName,sO.number,sO.operator],color:"#79c0ff"},{tag:[sO.keyword,sO.typeName,sO.typeOperator,sO.typeName],color:"#ff7b72"},{tag:[sO.string,sO.meta,sO.regexp],color:"#a5d6ff"},{tag:[sO.name,sO.quote],color:"#7ee787"},{tag:[sO.heading,sO.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[sO.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[sO.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[sO.atom,sO.bool,sO.special(sO.variableName)],color:"#ffab70"},{tag:sO.link,textDecoration:"underline"},{tag:sO.strikethrough,textDecoration:"line-through"},{tag:sO.invalid,color:"#f97583"}],u4=(e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return uJ({theme:t,settings:(0,uZ.default)({},u5,n),styles:[...u3,...r]})})(),u8=e.i(382034),u6=e.i(187725);function u7(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let u9=u7(function(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:o}of n){let n=r.length,s=1e9,a=cn(t,e).line;if(a){for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(l.from>i&&(e==o||o>l.from)){i=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),r.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=s);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:s}of r)(s||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),ce=u7(cr,0),ct=u7((e,t)=>cr(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function cn(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function cr(e,t,n=t.selection.ranges){let r=n.map(e=>cn(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,s,a=e.sliceDoc(r-50,r),l=e.sliceDoc(i,i+50),u=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,d=a.length-u;if(a.slice(d-t.length,d)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?o=s=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),s=e.sliceDoc(i-50,i));let h=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(s)[0].length,p=s.length-f-n.length;return o.slice(h,h+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:r+h+t.length,margin:+!!/\s/.test(o.charAt(h+t.length))},close:{pos:i-f-n.length,margin:+!!/\s/.test(s.charAt(p-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:s}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+i.close.length})}return{changes:e}}return null}let ci=eQ.define(),co=eQ.define(),cs=eC.define(),ca=eC.define({combine:e=>e4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),cl=eT.define({create:()=>cw.empty,update(e,t){let n=t.state.facet(ca),r=t.annotation(ci);if(r){let i=cp.fromTransaction(t,r.selection),o=r.side,s=0==o?e.undone:e.done;return s=i?cg(s,s.length,n.minDepth,i):cy(s,t.startState.selection),new cw(0==o?r.rest:s,0==o?s:r.rest)}let i=t.annotation(co);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(eY.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=cp.fromTransaction(t),s=t.annotation(eY.time),a=t.annotation(eY.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new cw(e.done.map(cp.fromJSON),e.undone.map(cp.fromJSON))});function cu(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(cl,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let cc=cu(0,!1),cd=cu(1,!1),ch=cu(0,!0),cf=cu(1,!0);class cp{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new cp(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new cp(e.changes&&ep.fromJSON(e.changes),[],e.mapped&&ef.fromJSON(e.mapped),e.startSelection&&e_.fromJSON(e.startSelection),e.selectionsAfter.map(e_.fromJSON))}static fromTransaction(e,t){let n=cv;for(let t of e.startState.facet(cs)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new cp(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,cv)}static selection(e){return new cp(void 0,cv,void 0,void 0,e)}}function cg(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function cm(e,t){return e.length?t.length?e.concat(t):e:t}let cv=[];function cy(e,t){if(!e.length)return[cp.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),cg(e,e.length-1,1e9,n.setSelAfter(r)))}}function cb(e,t){if(!e.length)return e;let n=e.length,r=cv;for(;n;){let i=function(e,t,n){let r=cm(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):cv,n);if(!e.changes)return cp.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new cp(i,eX.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[cp.selection(r)]:cv}let cx=/^(input\.type|delete)($|\.)/;class cw{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new cw(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,s;let a,l,u=this.done,c=u[u.length-1];return new cw(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||cx.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=c.changes,s=e.changes,a=[],l=!1,o.iterChangedRanges((e,t)=>a.push(e,t)),s.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<a.length;){let t=a[e++],i=a[e++];r>=t&&n<=i&&(l=!0)}}),l))||"input.type.compose"==n)?cg(u,u.length-1,r.minDepth,new cp(e.changes.compose(c.changes),cm(eX.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,cv)):cg(u,u.length,r.minDepth,e),cv,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:cv;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new cw(cy(this.done,e),this.undone,t,n)}addMapping(e){return new cw(cb(this.done,e),cb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,s;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:ci.of({side:e,rest:(n=r[r.length-1],(s=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==r.length?cv:r.slice(0,r.length-1);return i.mapped&&(n=cb(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:ci.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}cw.empty=new cw(cv,cv);let c_=[{key:"Mod-z",run:cc,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:cd,preventDefault:!0},{linux:"Ctrl-Shift-z",run:cd,preventDefault:!0},{key:"Mod-u",run:ch,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:cf,preventDefault:!0}];function ck(e,t){return e_.create(e.ranges.map(t),e.mainIndex)}function cS(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function cC({state:e,dispatch:t},n){let r=ck(e.selection,n);return!r.eq(e.selection,!0)&&(t(cS(e,r)),!0)}function cO(e,t){return e_.cursor(t?e.to:e.from)}function cE(e,t){return cC(e,n=>n.empty?e.moveByChar(n,t):cO(n,t))}function cM(e){return e.textDirectionAt(e.state.selection.main.head)==nl.LTR}let cA=e=>cE(e,!cM(e)),cP=e=>cE(e,cM(e));function cT(e,t){return cC(e,n=>n.empty?e.moveByGroup(n,t):cO(n,t))}function cR(e,t,n){let r,i,o=sR(e).resolveInner(t.head),s=n?g.closedBy:g.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,s)?r=n?t.to:t.from:o=t}return i=o.type.prop(s)&&(r=n?aP(e,o.from,1):aP(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,e_.cursor(i,n?-1:1)}function cI(e,t){return cC(e,n=>{if(!n.empty)return cO(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let cD=e=>cI(e,!1),cL=e=>cI(e,!0);function cj(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(iF.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function cN(e,t){let n,r=cj(e),{state:i}=e,o=ck(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):cO(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>a&&t.bottom<l&&(n=iF.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(cS(i,o),{effects:n}),!0}let cF=e=>cN(e,!1),cB=e=>cN(e,!0);function cz(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=e_.cursor(r.from+n))}return i}function cV(e,t){let n=ck(e.state.selection,e=>{let n=t(e);return e_.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(cS(e.state,n)),!0)}function cH(e,t){return cV(e,n=>e.moveByChar(n,t))}let c$=e=>cH(e,!cM(e)),cW=e=>cH(e,cM(e));function cU(e,t){return cV(e,n=>e.moveByGroup(n,t))}function cq(e,t){return cV(e,n=>e.moveVertically(n,t))}let cQ=e=>cq(e,!1),cK=e=>cq(e,!0);function cG(e,t){return cV(e,n=>e.moveVertically(n,t,cj(e).height))}let cX=e=>cG(e,!1),cY=e=>cG(e,!0),cZ=({state:e,dispatch:t})=>(t(cS(e,{anchor:0})),!0),cJ=({state:e,dispatch:t})=>(t(cS(e,{anchor:e.doc.length})),!0),c0=({state:e,dispatch:t})=>(t(cS(e,{anchor:e.selection.main.anchor,head:0})),!0),c1=({state:e,dispatch:t})=>(t(cS(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function c2(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let o=n.doc.lineAt(r.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<o.from||r.head>o.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(cS(n,e_.create(i,i.length-1))),!0)}function c5(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let s=t(r);s<i?(n="delete.backward",s=c3(e,s,!1)):s>i&&(n="delete.forward",s=c3(e,s,!0)),i=Math.min(i,s),o=Math.max(o,s)}else i=c3(e,i,!1),o=c3(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:e_.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?iF.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function c3(e,t,n){if(e instanceof iF)for(let r of e.state.facet(iF.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let c4=(e,t,n)=>c5(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(" "==a[a.length-1])return i-1;let e=th(a,o.tabSize)%sU(o)||sU(o);for(let t=0;t<e&&" "==a[a.length-1-t];t++)i--;l=i}else(l=ea(s.text,i-s.from,t,t)+s.from)==i&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=ea(s.text,l-s.from,!1,!1)+s.from);return l}),c8=e=>c4(e,!1,!0),c6=e=>c4(e,!0,!1),c7=(e,t)=>c5(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let a=ea(o.text,r-o.from,t)+o.from,l=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),u=s(l);if(null!=e&&u!=e)break;(" "!=l||r!=n.head)&&(e=u),r=a}return r}),c9=e=>c7(e,!1);function de(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function dt(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of de(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n)for(let n of(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(e_.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(e_.range(n.anchor-s,n.head-s))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:e_.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function dn(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of de(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let dr=ds(!1),di=ds(!0);function ds(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),s=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=sR(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(g.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let a=new sK(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=sQ(a,r);for(null==l&&(l=th(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;s?{from:r,to:i}=s:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let u=["",sq(t,l)];return s&&u.push(sq(t,a.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:Z.of(u)},range:e_.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function da(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let s=e.doc.lineAt(o);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),o=s.to+1}let o=e.changes(i);return{changes:i,range:e_.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let dl=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(da(e,(t,n)=>{n.push({from:t.from,insert:e.facet(sW)})}),{userEvent:"input.indent"})),!0),du=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(da(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=th(r,e.tabSize),o=0,s=sq(e,Math.max(0,i-sU(e)));for(;o<r.length&&o<s.length&&r.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0),dc=[{key:"Ctrl-b",run:cA,shift:c$,preventDefault:!0},{key:"Ctrl-f",run:cP,shift:cW},{key:"Ctrl-p",run:cD,shift:cQ},{key:"Ctrl-n",run:cL,shift:cK},{key:"Ctrl-a",run:e=>cC(e,t=>e_.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>cV(e,t=>e_.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>cC(e,t=>e_.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>cV(e,t=>e_.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:c6},{key:"Ctrl-h",run:c8},{key:"Ctrl-k",run:e=>c5(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:c9},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Z.of(["",""])},range:e_.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:ea(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:ea(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:e_.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:cB}],dd=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>cC(e,t=>cR(e.state,t,!cM(e))),shift:e=>cV(e,t=>cR(e.state,t,!cM(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>cC(e,t=>cR(e.state,t,cM(e))),shift:e=>cV(e,t=>cR(e.state,t,cM(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>dt(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>dn(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>dt(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>dn(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>c2(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>c2(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=e_.create([n.main]):n.main.empty||(r=e_.create([e_.cursor(n.main.head)])),!!r&&(t(cS(e,r)),!0)}},{key:"Mod-Enter",run:di},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=de(e).map(({from:t,to:n})=>e_.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:e_.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=ck(e.selection,t=>{let n=sR(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return e_.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(cS(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:du},{key:"Mod-]",run:dl},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new sK(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=da(e,(t,i,o)=>{let s=sQ(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=sq(e,s);(a!=l||o.from<t.from+a.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+a.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(de(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=ck(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=ck(e.selection,t=>{let r=aP(e,t.head,-1)||aP(e,t.head,1)||t.head>0&&aP(e,t.head-1,1)||t.head<e.doc.length&&aP(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return e_.cursor(i)}),!!n&&(t(cS(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=cn(e.state,n.from);return r.line?u9(e):!!r.block&&ct(e)}},{key:"Alt-A",run:ce},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:cA,shift:c$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>cT(e,!cM(e)),shift:e=>cU(e,!cM(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>cC(e,t=>cz(e,t,!cM(e))),shift:e=>cV(e,t=>cz(e,t,!cM(e))),preventDefault:!0},{key:"ArrowRight",run:cP,shift:cW,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>cT(e,cM(e)),shift:e=>cU(e,cM(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>cC(e,t=>cz(e,t,cM(e))),shift:e=>cV(e,t=>cz(e,t,cM(e))),preventDefault:!0},{key:"ArrowUp",run:cD,shift:cQ,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cZ,shift:c0},{mac:"Ctrl-ArrowUp",run:cF,shift:cX},{key:"ArrowDown",run:cL,shift:cK,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cJ,shift:c1},{mac:"Ctrl-ArrowDown",run:cB,shift:cY},{key:"PageUp",run:cF,shift:cX},{key:"PageDown",run:cB,shift:cY},{key:"Home",run:e=>cC(e,t=>cz(e,t,!1)),shift:e=>cV(e,t=>cz(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:cZ,shift:c0},{key:"End",run:e=>cC(e,t=>cz(e,t,!0)),shift:e=>cV(e,t=>cz(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:cJ,shift:c1},{key:"Enter",run:dr,shift:dr},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:c8,shift:c8,preventDefault:!0},{key:"Delete",run:c6,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:c9,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>c7(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>c5(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>c5(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(dc.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),dh={key:"Tab",run:dl,shift:du},df="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class dp{constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(df(e)):df,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return el(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=eu(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ec(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let o=r.charCodeAt(e),s=this.match(o,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(s)return this.value=s,this;break}i==n&&e<t.length&&t.charCodeAt(e)==o&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],o=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(dp.prototype[Symbol.iterator]=function(){return this});let dg={from:-1,to:-1,match:/.*/.exec("")},dm="gm"+(null==/x/.unicode?"":"u");class dv{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=dg,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new dx(e,t,n,r,i);this.re=new RegExp(t,dm+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=dw(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=dw(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let dy=new WeakMap;class db{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=dy.get(e);if(!r||r.from>=n||r.to<=t){let r=new db(t,e.sliceString(t,n));return dy.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),dy.set(e,new db(o,i)),new db(t,i.slice(t-o,n-o))}}class dx{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=dg,this.matchPos=dw(e,r),this.re=new RegExp(t,dm+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=db.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=dw(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=db.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function dw(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function d_(e){let t=tO("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,o,s,a,l]=n,u=a?+a.slice(1):0,c=s?+s:i.number;if(s&&l){let e=c/100;o&&(e=e*("-"==o?-1:1)+i.number/r.doc.lines),c=Math.round(r.doc.lines*e)}else s&&o&&(c=c*("-"==o?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,c))),h=e_.cursor(d.from+Math.max(0,Math.min(u,d.length)));e.dispatch({effects:[dk.of(!1),iF.scrollIntoView(h.from,{y:"center"})],selection:h}),e.focus()}return{dom:tO("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:dk.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},tO("label",e.state.phrase("Go to line"),": ",t)," ",tO("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),tO("button",{name:"close",onclick:()=>{e.dispatch({effects:dk.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&(dv.prototype[Symbol.iterator]=dx.prototype[Symbol.iterator]=function(){return this});let dk=eX.define(),dS=eT.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(dk)&&(e=n.value);return e},provide:e=>oz.from(e,e=>e?d_:null)}),dC=iF.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),dO={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},dE=eC.define({combine:e=>e4(e,dO,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),dM=tU.mark({class:"cm-selectionMatch"}),dA=tU.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function dP(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=e2.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=e2.Word)}let dT=nV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(dE),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tU.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return tU.none;let e=n.wordAt(i.head);if(!e)return tU.none;s=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return tU.none;if(t.wholeWords){var a,l,u;if(o=n.sliceDoc(i.from,i.to),!(dP(s=n.charCategorizer(i.head),n,i.from,i.to)&&(a=s,l=i.from,u=i.to,a(n.sliceDoc(l,l+1))==e2.Word&&a(n.sliceDoc(u-1,u))==e2.Word)))return tU.none}else if(!(o=n.sliceDoc(i.from,i.to)))return tU.none}let c=[];for(let r of e.visibleRanges){let e=new dp(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||dP(s,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?c.push(dA.range(r,o)):(r>=i.to||o<=i.from)&&c.push(dM.range(r,o)),c.length>t.maxMatches))return tU.none}}return tU.set(c)}},{decorations:e=>e.decorations}),dR=iF.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),dI=eC.define({combine:e=>e4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new d7(e),scrollToMatch:e=>iF.scrollIntoView(e)})});class dD{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,dm),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new dV(this):new dN(this)}getCursor(e,t=0,n){let r=e.doc?e:e3.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?dF(this,r,t,n):dj(this,r,t,n)}}class dL{constructor(e){this.spec=e}}function dj(e,t,n,r){var i,o;return new dp(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(i=t.doc,o=t.charCategorizer(t.selection.main.head),(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=i.sliceString(r,Math.min(i.length,t+2))),(o(dB(n,e-r))!=e2.Word||o(dz(n,e-r))!=e2.Word)&&(o(dz(n,t-r))!=e2.Word||o(dB(n,t-r))!=e2.Word))):void 0)}class dN extends dL{constructor(e){super(e)}nextMatch(e,t,n){let r=dj(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=dj(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=dj(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=dj(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=dj(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function dF(e,t,n,r){var i;return new dv(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(i=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(i(dB(n.input,n.index))!=e2.Word||i(dz(n.input,n.index))!=e2.Word)&&(i(dz(n.input,n.index+n[0].length))!=e2.Word||i(dB(n.input,n.index+n[0].length))!=e2.Word)):void 0},n,r)}function dB(e,t){return e.slice(ea(e,t,!1),t)}function dz(e,t){return e.slice(t,ea(e,t))}class dV extends dL{nextMatch(e,t,n){let r=dF(this.spec,e,n,e.doc.length).next();return r.done&&(r=dF(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=dF(this.spec,e,i,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(i==t||s.from>i+10))return s;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=dF(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=dF(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let dH=eX.define(),d$=eX.define(),dW=eT.define({create:e=>new dU(d2(e).create(),null),update(e,t){for(let n of t.effects)n.is(dH)?e=new dU(n.value.create(),e.panel):n.is(d$)&&(e=new dU(e.query,n.value?d1:null));return e},provide:e=>oz.from(e,e=>e.panel)});class dU{constructor(e,t){this.query=e,this.panel=t}}let dq=tU.mark({class:"cm-searchMatch"}),dQ=tU.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dK=nV.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(dW))}update(e){let t=e.state.field(dW);(t!=e.startState.field(dW)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return tU.none;let{view:n}=this,r=new tt;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:s,to:a}=i[t];for(;t<o-1&&a>i[t+1].from-500;)a=i[++t].to;e.highlight(n.state,s,a,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?dQ:dq)})}return r.finish()}},{decorations:e=>e.decorations});function dG(e){return t=>{let n=t.state.field(dW,!1);return n&&n.query.spec.valid?e(t,n):d4(t)}}let dX=dG((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=e_.single(r.from,r.to),o=e.state.facet(dI);return e.dispatch({selection:i,effects:[ht(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),d3(e),!0}),dY=dG((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=e_.single(i.from,i.to),s=e.state.facet(dI);return e.dispatch({selection:o,effects:[ht(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),d3(e),!0}),dZ=dG((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:e_.create(n.map(e=>e_.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),dJ=dG((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,u,c=[];s.from==r&&s.to==i&&(u=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:u}),s=t.nextMatch(n,s.from,s.to),c.push(iF.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let d=e.state.changes(a);return s&&(l=e_.single(s.from,s.to).map(d),c.push(ht(e,s)),c.push(n.facet(dI).scrollToMatch(l.main,e))),e.dispatch({changes:d,selection:l,effects:c,userEvent:"input.replace"}),!0}),d0=dG((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:iF.announce.of(r),userEvent:"input.replace.all"}),!0});function d1(e){return e.state.facet(dI).createPanel(e)}function d2(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let u=e.facet(dI);return new dD({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(r=null==t?void 0:t.caseSensitive)?r:u.caseSensitive,literal:null!=(i=null==t?void 0:t.literal)?i:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(s=null==t?void 0:t.wholeWord)?s:u.wholeWord})}function d5(e){let t=oj(e,d1);return t&&t.dom.querySelector("[main-field]")}function d3(e){let t=d5(e);t&&t==e.root.activeElement&&t.select()}let d4=e=>{let t=e.state.field(dW,!1);if(t&&t.panel){let n=d5(e);if(n&&n!=e.root.activeElement){let r=d2(e.state,t.query.spec);r.valid&&e.dispatch({effects:dH.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[d$.of(!0),t?dH.of(d2(e.state,t.query.spec)):eX.appendConfig.of(hr)]});return!0},d8=e=>{let t=e.state.field(dW,!1);if(!t||!t.panel)return!1;let n=oj(e,d1);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:d$.of(!1)}),!0},d6=[{key:"Mod-f",run:d4,scope:"editor search-panel"},{key:"F3",run:dX,shift:dY,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:dX,shift:dY,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:d8,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let t=new dp(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(s=o.length),o.push(e_.range(t.value.from,t.value.to))}return t(e.update({selection:e_.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=oj(e,d_);if(!t){let n=[dk.of(!0)];null==e.state.field(dS,!1)&&n.push(eX.appendConfig.of([dS,dC])),e.dispatch({effects:n}),t=oj(e,d_)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=e_.create(n.ranges.map(t=>e.wordAt(t.head)||e_.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new dp(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new dp(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(e_.range(i.from,i.to),!1),effects:iF.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class d7{constructor(e){this.view=e;let t=this.query=e.state.field(dW).query.spec;function n(e,t,n){return tO("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=tO("input",{value:t.search,placeholder:d9(e,"Find"),"aria-label":d9(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=tO("input",{value:t.replace,placeholder:d9(e,"Replace"),"aria-label":d9(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=tO("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=tO("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=tO("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=tO("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>dX(e),[d9(e,"next")]),n("prev",()=>dY(e),[d9(e,"previous")]),n("select",()=>dZ(e),[d9(e,"all")]),tO("label",null,[this.caseField,d9(e,"match case")]),tO("label",null,[this.reField,d9(e,"regexp")]),tO("label",null,[this.wordField,d9(e,"by word")]),...e.state.readOnly?[]:[tO("br"),this.replaceField,n("replace",()=>dJ(e),[d9(e,"replace")]),n("replaceAll",()=>d0(e),[d9(e,"replace all")])],tO("button",{name:"close",onclick:()=>d8(e),"aria-label":d9(e,"close"),type:"button"},["×"])])}commit(){let e=new dD({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:dH.of(e)}))}keydown(e){var t;(t=this.view,iY(iK(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?dY:dX)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),dJ(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(dH)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(dI).top}}function d9(e,t){return e.state.phrase(t)}let he=/[\s\.,:;?!]/;function ht(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),s=Math.min(i,n+30),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let e=0;e<30;e++)if(!he.test(a[e+1])&&he.test(a[e])){a=a.slice(e);break}}if(s!=i){for(let e=a.length-1;e>a.length-30;e--)if(!he.test(a[e-1])&&he.test(a[e])){a=a.slice(0,e);break}}return iF.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}let hn=iF.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),hr=[dW,eI.low(dK),hn];class hi{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class ho{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(hm).markerFilter;r&&(e=r(e,n));let i=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new tt,s=[],a=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,r=e==i.length?null:i[e];if(!r&&!s.length)break;if(s.length)t=a,n=s.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if((t=r.from)>c)break;n=r.to,s.push(r),e++}for(;e<i.length;){let r=i[e];if(r.from==t&&(r.to>r.from||r.to==t))s.push(r),e++,n=Math.min(r.to,n);else{n=Math.min(r.from,n);break}}n=Math.min(n,c);let d=!1;if(s.some(e=>e.from==t&&(e.to==n||n==c))&&!(d=t==n)&&n-t<10){let e=t-(u+l.value.length);e>0&&(l.next(e),u=t);for(let e=t;;){if(e>=n){d=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let h=hC(s);if(d)o.add(t,t,tU.widget({widget:new hx(h),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,tU.mark({class:"cm-lintRange cm-lintRange-"+h+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>n)}))}if((a=n)==c)break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1)}let d=o.finish();return new ho(d,t,hs(d))}}function hs(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t)))if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new hi(r.from,n,r.diagnostic)}else r=new hi(e,n,t||i.diagnostics[0])}),r}function ha(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(hm).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(hl))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}let hl=eX.define(),hu=eX.define(),hc=eX.define(),hd=eT.define({create:()=>new ho(tU.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=hs(n,e.selected.diagnostic,i)||hs(n,null,i)}!n.size&&i&&t.state.facet(hm).autoPanel&&(i=null),e=new ho(n,i,r)}for(let n of t.effects)if(n.is(hl)){let r=t.state.facet(hm).autoPanel?n.value.length?h_.open:null:e.panel;e=ho.init(n.value,r,t.state)}else n.is(hu)?e=new ho(e.diagnostics,n.value?h_.open:null,e.selected):n.is(hc)&&(e=new ho(e.diagnostics,e.panel,n.value));return e},provide:e=>[oz.from(e,e=>e.panel),iF.decorations.from(e,e=>e.diagnostics)]}),hh=tU.mark({class:"cm-lintRange cm-lintRange-active"});function hf(e,t){return tO("ul",{class:"cm-tooltip-lint"},t.map(t=>hb(e,t,!1)))}let hp=e=>{let t=e.state.field(hd,!1);return!!t&&!!t.panel&&(e.dispatch({effects:hu.of(!1)}),!0)},hg=[{key:"Mod-Shift-m",run:e=>{var t,n;let r=e.state.field(hd,!1);r&&r.panel||e.dispatch({effects:(t=e.state,n=[hu.of(!0)],t.field(hd,!1)?n:n.concat(eX.appendConfig.of(hM)))});let i=oj(e,h_.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(hd,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return(!!r.value||!!(r=t.diagnostics.iter(0)).value&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],hm=eC.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...e4(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:hv,tooltipFilter:hv,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})})});function hv(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function hy(e){let t=[];if(e)i:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue i}}t.push("")}return t}function hb(e,t,n){var r;let i=n?hy(t.actions):[];return tO("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},tO("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(r=t.actions)?void 0:r.map((n,r)=>{let o=!1,s=r=>{if(r.preventDefault(),o)return;o=!0;let i=hs(e.state.field(hd).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:a}=n,l=i[r]?a.indexOf(i[r]):-1,u=l<0?a:[a.slice(0,l),tO("u",a.slice(l,l+1)),a.slice(l+1)];return tO("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${i[r]})"`}.`},u)}),t.source&&tO("div",{class:"cm-diagnosticSource"},t.source))}class hx extends t${constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return tO("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class hw{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=hb(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class h_{constructor(e){this.view=e,this.items=[];let t=t=>{if(27==t.keyCode)hp(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=hy(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=hs(this.view.state.field(hd).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=tO("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=tO("div",{class:"cm-panel-lint"},this.list,tO("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>hp(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(hd).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(hd),n=0,r=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:a})=>{for(let e of a.diagnostics){if(o.has(e))continue;o.add(e);let s=-1,a;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){s=t;break}s<0?(a=new hw(this.view,e),this.items.splice(n,0,a),r=!0):(a=this.items[s],s>n&&(this.items.splice(n,s-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new hw(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=hs(this.view.state.field(hd).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:hc.of(t)})}static open(e){return new h_(e)}}function hk(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let hS=iF.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:hk("#d11")},".cm-lintRange-warning":{backgroundImage:hk("orange")},".cm-lintRange-info":{backgroundImage:hk("#999")},".cm-lintRange-hint":{backgroundImage:hk("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function hC(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}let hO=eX.define(),hE=eT.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=ha(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(hO)?t.value:e,e)),provide:e=>oM.from(e)}),hM=[hd,iF.decorations.compute([hd],e=>{let{selected:t,panel:n}=e.field(hd);return t&&n&&t.from!=t.to?tU.set([hh.range(t.from,t.to)]):tU.none}),function(e,t={}){let n=eX.define(),r=eT.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,eh.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(oD)&&(e=[]);return e},provide:e=>oA.from(e)});return{active:r,extension:[r,nV.define(i=>new oR(i,e,r,n,t.hoverTime||300)),oT]}}(function(e,t,n){let{diagnostics:r}=e.state.field(hd),i,o=-1,s=-1;r.between(t-(n<0),t+ +(n>0),(e,r,{spec:a})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=a.diagnostics,o=e,s=r,!1});let a=e.state.facet(hm).tooltipFilter;return(i&&a&&(i=a(i,e.state)),i)?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create:()=>({dom:hf(e,i)})}:null},{hideOn:ha}),hS],hA=eC.define({combine:e=>e4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var hP=function(e){let t;void 0===e&&(e={});var{crosshairCursor:n=!1}=e,r=[];!1!==e.closeBracketsKeymap&&(r=r.concat(l1)),!1!==e.defaultKeymap&&(r=r.concat(dd)),!1!==e.searchKeymap&&(r=r.concat(d6)),!1!==e.historyKeymap&&(r=r.concat(c_)),!1!==e.foldKeymap&&(r=r.concat(ar)),!1!==e.completionKeymap&&(r=r.concat(l8)),!1!==e.lintKeymap&&(r=r.concat(hg));var i=[];return!1!==e.lineNumbers&&i.push(o6()),!1!==e.highlightActiveLineGutter&&i.push(se),!1!==e.highlightSpecialChars&&i.push(function(e={}){return[ou.of(e),oc||(oc=nV.fromClass(class{constructor(e){this.view=e,this.decorations=tU.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(ou)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new oi({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=el(t[0],0);if(9==o){let e=i.lineAt(r),t=n.state.tabSize,o=th(e.text,t,r-e.from);return tU.replace({widget:new oh((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=tU.replace({widget:new od(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(ou);e.startState.facet(ou)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&i.push(function(e={}){return[cl,ca.of(e),iF.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?cc:"historyRedo"==e.inputType?cd:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push(function(e={}){let t={...ac,...e},n=new ad(t,!0),r=new ad(t,!1),i=nV.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(sV)!=e.state.facet(sV)||e.startState.field(s7,!1)!=e.state.field(s7,!1)||sR(e.startState)!=sR(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new tt;for(let i of e.viewportLineBlocks){let o=ae(e.state,i.from,i.to)?r:s5(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[i,oq({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(i))?void 0:t.markers)||te.empty},initialSpacer:()=>new ad(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let r=ae(e.state,t.from,t.to);if(r)return e.dispatch({effects:s8.of(r)}),!0;let i=s5(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:s4.of(i)}),!0)}}}),as()]}()),!1!==e.drawSelection&&i.push(function(e={}){return[i3.of(e),i8,i7,i9,nR.of(!0)]}()),!1!==e.dropCursor&&i.push([ot,on]),!1!==e.allowMultipleSelections&&i.push(e3.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push(e3.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=sQ(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=sq(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&i.push(av(ab,{fallback:!0})),!1!==e.bracketMatching&&i.push(function(e={}){return[a_.of(e),aO]}()),!1!==e.closeBrackets&&i.push([l0,lG]),!1!==e.autocompletion&&i.push(function(e={}){return[lj,lM,ld.of(e),lD,l6,lN]}()),!1!==e.rectangularSelection&&i.push((t=e=>e.altKey&&0==e.button,iF.mouseSelectionStyle.of((e,n)=>{let r,i;return t(n)?(r=om(e,n),i=e.state.selection,{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(r.line).from),n=e.state.doc.lineAt(t);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(e.changes)}},get(t,n,o){let s=om(e,t),a=function(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=a&&o.push(e_.range(n.from+s,n.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=tf(n.text,s,e.tabSize,!0);if(r<0)o.push(e_.cursor(n.to));else{let t=tf(n.text,a,e.tabSize);o.push(e_.range(n.from+r,n.from+t))}}}return o}(e.state,r,s);return a.length?o?e_.create(a.concat(i.ranges)):e_.create(a):i}}):null}))),!1!==n&&i.push(function(e={}){let[t,n]=ov[e.key||"Alt"],r=nV.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,iF.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(r))?void 0:t.isDown)?oy:null})]}()),!1!==e.highlightActiveLine&&i.push(op),!1!==e.highlightSelectionMatches&&i.push([dR,dT]),e.tabSize&&"number"==typeof e.tabSize&&i.push(sW.of(" ".repeat(e.tabSize))),i.concat([iq.of(r.flat())]).filter(Boolean)};let hT="#e06c75",hR="#abb2bf",hI="#7d8799",hD="#d19a66",hL="#2c313a",hj="#282c34",hN="#353a42",hF="#528bff",hB=[iF.theme({"&":{color:hR,backgroundColor:hj},".cm-content":{caretColor:hF},".cm-cursor, .cm-dropCursor":{borderLeftColor:hF},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:hR},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:hj,color:hI,border:"none"},".cm-activeLineGutter":{backgroundColor:hL},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:hN},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hN,borderBottomColor:hN},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:hL,color:hR}}},{dark:!0}),av(af.define([{tag:sO.keyword,color:"#c678dd"},{tag:[sO.name,sO.deleted,sO.character,sO.propertyName,sO.macroName],color:hT},{tag:[sO.function(sO.variableName),sO.labelName],color:"#61afef"},{tag:[sO.color,sO.constant(sO.name),sO.standard(sO.name)],color:hD},{tag:[sO.definition(sO.name),sO.separator],color:hR},{tag:[sO.typeName,sO.className,sO.number,sO.changed,sO.annotation,sO.modifier,sO.self,sO.namespace],color:"#e5c07b"},{tag:[sO.operator,sO.operatorKeyword,sO.url,sO.escape,sO.regexp,sO.link,sO.special(sO.string)],color:"#56b6c2"},{tag:[sO.meta,sO.comment],color:hI},{tag:sO.strong,fontWeight:"bold"},{tag:sO.emphasis,fontStyle:"italic"},{tag:sO.strikethrough,textDecoration:"line-through"},{tag:sO.link,color:hI,textDecoration:"underline"},{tag:sO.heading,fontWeight:"bold",color:hT},{tag:[sO.atom,sO.bool,sO.special(sO.variableName)],color:hD},{tag:[sO.processingInstruction,sO.string,sO.inserted],color:"#98c379"},{tag:sO.invalid,color:"#ffffff"}]))];var hz=iF.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),hV=function(e){let t;void 0===e&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(iq.of([dh])),a&&("boolean"==typeof a?l.unshift(hP()):l.unshift(hP(a))),s&&l.unshift((t=nV.fromClass(class{constructor(e){this.view=e,this.placeholder=s?tU.set([tU.widget({widget:new og(s),side:1}).range(0)]):tU.none}get decorations(){return this.view.state.doc.length?tU.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof s?[t,iF.contentAttributes.of({"aria-placeholder":s})]:t)),o){case"light":l.push(hz);break;case"dark":l.push(hB);break;case"none":break;default:l.push(o)}return!1===r&&l.push(iF.editable.of(!1)),i&&l.push(e3.readOnly.of(!0)),[...l]};class hH{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class h${constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var hW=null,hU=eQ.define(),hq=[],hQ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],hK=(0,u6.forwardRef)((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,autoFocus:c,theme:d="light",height:f,minHeight:p,maxHeight:g,width:m,minWidth:v,maxWidth:y,basicSetup:b,placeholder:x,indentWithTab:w,editable:_,readOnly:k,root:S,initialState:C}=e,O=(0,u8.default)(e,hQ),E=(0,u6.useRef)(null),{state:M,view:A,container:P,setContainer:T}=function(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=hq,autoFocus:l,theme:u="light",height:c=null,minHeight:d=null,maxHeight:h=null,width:f=null,minWidth:p=null,maxWidth:g=null,placeholder:m="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:x=!0,root:w,initialState:_}=e,[k,S]=(0,u6.useState)(),[C,O]=(0,u6.useState)(),[E,M]=(0,u6.useState)(),A=(0,u6.useState)(()=>({current:null}))[0],P=(0,u6.useState)(()=>({current:null}))[0],T=iF.theme({"&":{height:c,minHeight:d,maxHeight:h,width:f,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),R=[iF.updateListener.of(e=>{e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(hU))&&(A.current?A.current.reset():(A.current=new hH(()=>{if(P.current){var e=P.current;P.current=null,e()}A.current=null},200),("undefined"==typeof window?new h$:(!hW&&(hW=new h$),hW)).add(A.current)),r(e.state.doc.toString(),e)),i&&i({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),T,...hV({theme:u,editable:v,readOnly:y,placeholder:m,indentWithTab:b,basicSetup:x})];return s&&"function"==typeof s&&R.push(iF.updateListener.of(s)),R=R.concat(a),(0,u6.useLayoutEffect)(()=>{if(k&&!E){var e={doc:t,selection:n,extensions:R},r=_?e3.fromJSON(_.json,e,_.fields):e3.create(e);if(M(r),!C){var i=new iF({state:r,parent:k,root:w});O(i),o&&o(i,r)}}return()=>{C&&(M(void 0),O(void 0))}},[k,E]),(0,u6.useEffect)(()=>{e.container&&S(e.container)},[e.container]),(0,u6.useEffect)(()=>()=>{C&&(C.destroy(),O(void 0)),A.current&&(A.current.cancel(),A.current=null)},[C]),(0,u6.useEffect)(()=>{l&&C&&C.focus()},[l,C]),(0,u6.useEffect)(()=>{C&&C.dispatch({effects:eX.reconfigure.of(R)})},[u,a,c,d,h,f,p,g,m,v,y,b,x,r,s]),(0,u6.useEffect)(()=>{if(void 0!==t){var e=C?C.state.doc.toString():"";if(C&&t!==e){var n=A.current&&!A.current.isDone,r=()=>{C&&t!==C.state.doc.toString()&&C.dispatch({changes:{from:0,to:C.state.doc.toString().length,insert:t||""},annotations:[hU.of(!0)]})};n?P.current=r:r()}}},[t,C]),{state:E,setState:M,view:C,setView:O,container:k,setContainer:S}}({root:S,value:r,autoFocus:c,theme:d,height:f,minHeight:p,maxHeight:g,width:m,minWidth:v,maxWidth:y,basicSetup:b,placeholder:x,indentWithTab:w,editable:_,readOnly:k,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,extensions:o,initialState:C});(0,u6.useImperativeHandle)(t,()=>({editor:E.current,state:M,view:A}),[E,P,M,A]);var R=(0,u6.useCallback)(e=>{E.current=e,T(e)},[T]);if("string"!=typeof r)throw Error("value must be typeof string but got "+typeof r);var I="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,h.jsx)("div",(0,uZ.default)({ref:R,className:""+I+(n?" "+n:"")},O))});function hG({value:e,onChange:t,language:n="sql",readOnly:r=!1,lineNumbers:i=!0,wordWrap:o=!0,fontSize:s=14,height:a="100%",className:l="",theme:u="light",keyBindings:c=[]}){let d=(0,u6.useMemo)(()=>{let e=[(e=>{switch(e){case"sql":default:return uE({dialect:uA});case"yaml":return new sH(uY)}})(n),iF.theme({"&":{fontSize:`${s}px`},".cm-content":{fontFamily:"monospace"},".cm-gutters":{fontFamily:"monospace"}})];return o&&e.push(iF.lineWrapping),c.length>0&&e.push(eI.highest(iq.of(c))),e},[n,s,o,c]),f=(0,u6.useMemo)(()=>"dark"===u?u4:u2,[u]);return(0,h.jsx)(hK,{value:e,onChange:e=>{t&&t(e)},extensions:d,readOnly:r,basicSetup:{lineNumbers:i,foldGutter:!0,highlightActiveLineGutter:!r,highlightActiveLine:!r,tabSize:2},height:a,className:`${l} no-track-pii-safe`,theme:f})}hK.displayName="CodeMirror",e.s(["CodeEditor",()=>hG],750060);class hX{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(e,t=e){return new hX(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function hY(e,t,n,r,i,o){if(e==r)return[];let s=h4(e,t,n,r,i,o),a=h8(e,t+s,n,r,i+s,o);t+=s,n-=a,i+=s;let l=n-t,u=(o-=a)-i;if(!l||!u)return[new hX(t,n,i,o)];if(l>u){let s=e.slice(t,n).indexOf(r.slice(i,o));if(s>-1)return[new hX(t,t+s,i,i),new hX(t+s+u,n,o,o)]}else if(u>l){let s=r.slice(i,o).indexOf(e.slice(t,n));if(s>-1)return[new hX(t,t,i,i+s),new hX(n,n,i+s+l,o)]}if(1==l||1==u)return[new hX(t,n,i,o)];let c=function e(t,n,r,i,o,s){let a=r-n,l=s-o;if(a<l){let a=e(i,o,s,t,n,r);return a&&[a[1],a[0],a[2]]}return a<4||2*l<a?null:h6(t,n,r,i,o,s,Math.floor(a/4),-1)}(e,t,n,r,i,o);if(c){let[s,a,l]=c;return hY(e,t,s,r,i,a).concat(hY(e,s+l,n,r,a+l,o))}return function(e,t,n,r,i,o){let s=n-t,a=o-i;if(hZ<1e9&&Math.min(s,a)>16*hZ||hJ>0&&Date.now()>hJ)return Math.min(s,a)>64*hZ?[new hX(t,n,i,o)]:h7(e,t,n,r,i,o);let l=Math.ceil((s+a)/2);h2.reset(l),h5.reset(l);let u=(n,o)=>e.charCodeAt(t+n)==r.charCodeAt(i+o),c=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(o-i-1),d=(s-a)%2!=0?h5:null,h=d?null:h2;for(let f=0;f<l;f++){if(f>hZ||hJ>0&&!(63&f)&&Date.now()>hJ)return h7(e,t,n,r,i,o);let p=h2.advance(f,s,a,l,d,!1,u)||h5.advance(f,s,a,l,h,!0,c);if(p)return function(e,t,n,r,i,o,s,a){let l=!1;return(fu(e,r)||++r!=n||(l=!0),fu(i,a)||++a!=s||(l=!0),l)?[new hX(t,n,o,s)]:hY(e,t,r,i,o,a).concat(hY(e,r,n,i,a,s))}(e,t,n,t+p[0],r,i,o,i+p[1])}return[new hX(t,n,i,o)]}(e,t,n,r,i,o)}let hZ=1e9,hJ=0,h0=!1;class h1{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,o,s){for(let a=-e+this.start;a<=e-this.end;a+=2){let l=r+a,u=a==-e||a!=e&&this.vec[l-1]<this.vec[l+1]?this.vec[l+1]:this.vec[l-1]+1,c=u-a;for(;u<t&&c<n&&s(u,c);)u++,c++;if(this.vec[l]=u,u>t)this.end+=2;else if(c>n)this.start+=2;else if(i){let e=r+(t-n)-a;if(e>=0&&e<this.len&&-1!=i.vec[e]){if(o){let n=i.vec[e];if(n>=t-u)return[n,r+n-e]}else if(u>=t-i.vec[e])return[u,c]}}}return null}}let h2=new h1,h5=new h1;function h3(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function h4(e,t,n,r,i,o){if(t==n||t==o||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let s=h3(n-t,o-i);for(let a=t,l=i;;){let i=a+s,u=l+s;if(i>n||u>o||e.slice(a,i)!=r.slice(l,u)){if(1==s)return a-t-!fu(e,a);s>>=1}else{if(i==n||u==o)return i-t;a=i,l=u}}}function h8(e,t,n,r,i,o){if(t==n||i==o||e.charCodeAt(n-1)!=r.charCodeAt(o-1))return 0;let s=h3(n-t,o-i);for(let a=n,l=o;;){let o=a-s,u=l-s;if(o<t||u<i||e.slice(o,a)!=r.slice(u,l)){if(1==s)return n-a-!fu(e,a);s>>=1}else{if(o==t||u==i)return n-o;a=o,l=u}}}function h6(e,t,n,r,i,o,s,a){let l=r.slice(i,o),u=null;for(;;){if(u||s<a)return u;for(let a=t+s;;){!fu(e,a)&&a++;let c=a+s;if(fu(e,c)||(c+=c==a+1?1:-1),c>=n)break;let d=e.slice(a,c),h=-1;for(;-1!=(h=l.indexOf(d,h+1));){let s=h4(e,c,n,r,i+h+d.length,o),l=h8(e,t,a,r,i,i+h),f=d.length+s+l;(!u||u[2]<f)&&(u=[a-l,i+h-l,f])}a=c}if(a<0)return u;s>>=1}}function h7(e,t,n,r,i,o){let s;h0=!0;let a=n-t,l=o-i;if(a<l){let l=h6(r,i,o,e,t,n,Math.floor(a/6),50);s=l&&[l[1],l[0],l[2]]}else s=h6(e,t,n,r,i,o,Math.floor(l/6),50);if(!s)return[new hX(t,n,i,o)];let[u,c,d]=s;return hY(e,t,u,r,i,c).concat(hY(e,u+d,n,r,c+d,o))}function h9(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new hX(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}try{r=RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(e){}function fe(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function ft(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!fe(n):r?fa(n)&&t!=e.length-1?2*!!r.test(e.slice(t,t+2)):+!!r.test(String.fromCharCode(n)):0}function fn(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!fe(n):r?fl(n)&&1!=t?2*!!r.test(e.slice(t-2,t)):+!!r.test(String.fromCharCode(n)):0}function fr(e,t,n){if(t==e.length||!fn(e,t))return t;for(let r=t,i=t+n,o=0;o<8;o++){let t=ft(e,r);if(!t||r+t>i)return r;r+=t}return t}function fi(e,t,n){if(!t||!ft(e,t))return t;for(let r=t,i=t-n,o=0;o<8;o++){let t=fn(e,r);if(!t||r-t<i)return r;r-=t}return t}function fo(e,t,n){for(;t!=n;t--)if(10==e.charCodeAt(t-1))return t;return -1}function fs(e,t,n){for(;t!=n;t++)if(10==e.charCodeAt(t))return t;return -1}let fa=e=>e>=55296&&e<=56319,fl=e=>e>=56320&&e<=57343;function fu(e,t){return!t||t==e.length||!fa(e.charCodeAt(t-1))||!fl(e.charCodeAt(t))}function fc(e,t,n){var r;return function(e,t,n){for(let r=0,i=0;i<e.length;i++){let o=e[i],s=o.toA-o.fromA,a=o.toB-o.fromB;if(s&&a||s>3||a>3){let l=i==e.length-1?t.length:e[i+1].fromA,u=o.fromA-r,c=l-o.toA,d=fi(t,o.fromA,u),h=fr(t,o.toA,c),f=o.fromA-d,p=h-o.toA;if((!s||!a)&&f&&p){let u=Math.max(s,a),[c,g,m]=s?[t,o.fromA,o.toA]:[n,o.fromB,o.toB];u>f&&t.slice(d,o.fromA)==c.slice(m-f,m)?(d=(o=e[i]=new hX(d,d+s,o.fromB-f,o.toB-f)).fromA,h=fr(t,o.toA,l-o.toA)):u>p&&t.slice(o.toA,h)==c.slice(g,g+p)&&(h=(o=e[i]=new hX(h-s,h,o.fromB+p,o.toB+p)).toA,d=fi(t,o.fromA,o.fromA-r)),f=o.fromA-d,p=h-o.toA}if(f||p)o=e[i]=new hX(o.fromA-f,o.toA+p,o.fromB-f,o.toB+p);else if(s){if(!a){let n=fs(t,o.fromA,o.toA),r,s=n<0?-1:fo(t,o.toA,o.fromA);n>-1&&(r=n-o.fromA)<=c&&t.slice(o.fromA,n)==t.slice(o.toA,o.toA+r)?o=e[i]=o.offset(r):s>-1&&(r=o.toA-s)<=u&&t.slice(o.fromA-r,o.fromA)==t.slice(s,o.toA)&&(o=e[i]=o.offset(-r))}}else{let t=fs(n,o.fromB,o.toB),r,s=t<0?-1:fo(n,o.toB,o.fromB);t>-1&&(r=t-o.fromB)<=c&&n.slice(o.fromB,t)==n.slice(o.toB,o.toB+r)?o=e[i]=o.offset(r):s>-1&&(r=o.toB-s)<=u&&n.slice(o.fromB-r,o.fromB)==n.slice(s,o.toB)&&(o=e[i]=o.offset(-r))}}r=o.toA}return h9(e,3),e}((hZ=(null!=(r=null==n?void 0:n.scanLimit)?r:1e9)>>1,hJ=(null==n?void 0:n.timeout)?Date.now()+n.timeout:0,h0=!1,function(e,t,n){for(;;){h9(n,1);let r=!1;for(let i=0;i<n.length;i++){let o=n[i],s,a;(s=h4(e,o.fromA,o.toA,t,o.fromB,o.toB))&&(o=n[i]=new hX(o.fromA+s,o.toA,o.fromB+s,o.toB)),(a=h8(e,o.fromA,o.toA,t,o.fromB,o.toB))&&(o=n[i]=new hX(o.fromA,o.toA-a,o.fromB,o.toB-a));let l=o.toA-o.fromA,u=o.toB-o.fromB;if(l&&u)continue;let c=o.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-o.toA;if(!c||!d)continue;let h=l?e.slice(o.fromA,o.toA):t.slice(o.fromB,o.toB);c<=h.length&&e.slice(o.fromA-c,o.fromA)==h.slice(h.length-c)?(n[i]=new hX(o.fromA-c,o.toA-c,o.fromB-c,o.toB-c),r=!0):d<=h.length&&e.slice(o.toA,o.toA+d)==h.slice(0,d)&&(n[i]=new hX(o.fromA+d,o.toA+d,o.fromB+d,o.toB+d),r=!0)}if(!r)break}return n}(e,t,hY(e,0,e.length,t,0,t.length))),e,t)}let fd=eC.define({combine:e=>e[0]}),fh=eX.define(),ff=eC.define(),fp=eT.define({create:e=>null,update(e,t){for(let n of t.effects)n.is(fh)&&(e=n.value);for(let n of t.state.facet(ff))e=n(e,t);return e}});class fg{constructor(e,t,n,r,i,o=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=o}offset(e,t){return e||t?new fg(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return fy(fc(e.toString(),t.toString(),n),e,t,0,0,!h0)}static updateA(e,t,n,r,i){return fw(fx(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return fw(fx(e,r,!1,t.length),e,t,n,i)}}function fm(e,t,n,r){let i=n.lineAt(e),o=r.lineAt(t);return i.to==e&&o.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,o.from]}function fv(e,t,n,r){let i=n.lineAt(e),o=r.lineAt(t);return i.from==e&&o.from==t?[e,t]:[i.to+1,o.to+1]}function fy(e,t,n,r,i,o){let s=[];for(let a=0;a<e.length;a++){let l=e[a],[u,c]=fm(l.fromA+r,l.fromB+i,t,n),[d,h]=fv(l.toA+r,l.toB+i,t,n),f=[l.offset(-u+r,-c+i)];for(;a<e.length-1;){let o=e[a+1],[s,l]=fm(o.fromA+r,o.fromB+i,t,n);if(s>d+1&&l>h+1)break;f.push(o.offset(-u+r,-c+i)),[d,h]=fv(o.toA+r,o.toB+i,t,n),a++}s.push(new fg(f,u,Math.max(u,d),c,Math.max(c,h),o))}return s}function fb(e,t,n,r){let i=0,o=e.length;for(;;){if(i==o){let r=0,o=0;i&&({toA:r,toB:o}=e[i-1]);let s=t-(n?r:o);return[r+s,o+s]}let s=i+o>>1,a=e[s],[l,u]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(l>t)o=s;else{if(!(u<=t))return r?[a.fromA,a.fromB]:[a.toA,a.toB];i=s+1}}}function fx(e,t,n,r){let i=[];return t.iterChangedRanges((o,s,a,l)=>{let u=0,c=n?t.length:r,d=0,h=n?r:t.length;o>1e3&&([u,d]=fb(e,o-1e3,n,!0)),s<t.length-1e3&&([c,h]=fb(e,s+1e3,n,!1));let f=l-a-(s-o),p,[g,m]=n?[f,0]:[0,f];i.length&&(p=i[i.length-1]).toA>=u?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:c,toB:h,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:u,toA:c,fromB:d,toB:h,diffA:g,diffB:m})}),i}function fw(e,t,n,r,i){if(!e.length)return t;let o=[];for(let s=0,a=0,l=0,u=0;;s++){let c=s==e.length?null:e[s],d=c?c.fromA+a:n.length,h=c?c.fromB+l:r.length;for(;u<t.length;){let e=t[u];if(Math.min(n.length,e.toA+a)>d||Math.min(r.length,e.toB+l)>h)break;o.push(e.offset(a,l)),u++}if(!c)break;let f=c.toA+a+c.diffA,p=c.toB+l+c.diffB;for(let e of fy(fc(n.sliceString(d,f),r.sliceString(h,p),i),n,r,d,h,!h0))o.push(e);for(a+=c.diffA,l+=c.diffB;u<t.length;){let e=t[u];if(e.fromA+a>f&&e.fromB+l>p)break;u++}}return o}let f_={scanLimit:500},fk=nV.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=fP(e))}update(e){var t,n,r,i;(e.docChanged||e.viewportChanged||(t=e.startState,n=e.state,t.field(fp,!1)!=n.field(fp,!1))||(r=e.startState,i=e.state,r.facet(fd)!=i.facet(fd)))&&({deco:this.deco,gutter:this.gutter}=fP(e.view))}},{decorations:e=>e.deco}),fS=eI.low(oq({class:"cm-changeGutter",markers:e=>{var t;return(null==(t=e.plugin(fk))?void 0:t.gutter)||te.empty}})),fC=tU.line({class:"cm-changedLine"}),fO=tU.mark({class:"cm-changedText"}),fE=tU.mark({tagName:"ins",class:"cm-insertedLine"}),fM=tU.mark({tagName:"del",class:"cm-deletedLine"}),fA=new class extends oV{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function fP(e){let t=e.state.field(fp),{side:n,highlightChanges:r,markGutter:i,overrideChunk:o}=e.state.facet(fd),s="a"==n,a=new tt,l=i?new tt:null,{from:u,to:c}=e.viewport;for(let n of t){if((s?n.fromA:n.fromB)>=c)break;!((s?n.toA:n.toB)>u)||o&&o(e.state,n,a,l)||function(e,t,n,r,i,o){let s=n?e.fromA:e.fromB,a=n?e.toA:e.toB,l=0;if(s!=a){i.add(s,s,fC),i.add(s,a,n?fM:fE),o&&o.add(s,s,fA);for(let u=t.iterRange(s,a-1),c=s;!u.next().done;){if(u.lineBreak){c++,i.add(c,c,fC),o&&o.add(c,c,fA);continue}let t=c+u.value.length;if(r)for(;l<e.changes.length;){let r=e.changes[l],o=s+(n?r.fromA:r.fromB),a=s+(n?r.toA:r.toB),u=Math.max(c,o),d=Math.min(t,a);if(u<d&&i.add(u,d,fO),a<t)l++;else break}c=t}}}(n,e.state.doc,s,r,a,l)}return{deco:a.finish(),gutter:l&&l.finish()}}class fT extends t${constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}let fR=eX.define({map:(e,t)=>e.map(t)}),fI=eT.define({create:()=>tU.none,update:(e,t)=>{for(let e of t.effects)if(e.is(fR))return e.value;return e.map(t.changes)},provide:e=>iF.decorations.from(e)});function fD(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}let fL=eX.define({map:(e,t)=>t.mapPos(e)});class fj extends t${constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent=e.state.phrase("$ unchanged lines",this.lines),t.addEventListener("click",t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:fL.of(n)});let{side:r,sibling:i}=e.state.facet(fd);i&&i().dispatch({effects:fL.of(function(e,t,n){let r=0,i=0;for(let o=0;;o++){let s=o<t.length?t[o]:null;if(!s||(n?s.fromA:s.fromB)>=e)return i+(e-r);[r,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}(n,e.state.field(fp),"a"==r))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}let fN=eT.define({create:e=>tU.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))n.is(fL)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>iF.decorations.from(e)});function fF({margin:e=3,minSize:t=4}){return fN.init(n=>(function(e,t,n){let r=new tt,i="a"==e.facet(fd).side,o=e.field(fp),s=1;for(let a=0;;a++){let l=a<o.length?o[a]:null,u=a?s+t:1,c=l?e.doc.lineAt(i?l.fromA:l.fromB).number-1-t:e.doc.lines,d=c-u+1;if(d>=n&&r.add(e.doc.line(u).from,e.doc.line(c).to,tU.replace({widget:new fj(d),block:!0})),!l)break;s=e.doc.lineAt(Math.min(e.doc.length,i?l.toA:l.toB)).number}return r.finish()})(n,e,t))}let fB=iF.styleModule.of(new tv({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),fz=iF.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),fV=new eL,fH=new eL;class f${constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||f_;let t=[eI.low(fk),fz,fB,fI,iF.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(fR)))&&this.measure()})],n=[fd.of({side:"a",sibling:()=>this.b,highlightChanges:!1!==e.highlightChanges,markGutter:!1!==e.gutter})];!1!==e.gutter&&n.push(fS);let r=e3.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],iF.editorAttributes.of({class:"cm-merge-a"}),fH.of(n),t]}),i=[fd.of({side:"b",sibling:()=>this.a,highlightChanges:!1!==e.highlightChanges,markGutter:!1!==e.gutter})];!1!==e.gutter&&i.push(fS);let o=e3.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],iF.editorAttributes.of({class:"cm-merge-b"}),fH.of(i),t]});this.chunks=fg.build(r.doc,o.doc,this.diffConf);let s=[fp.init(()=>this.chunks),fV.of(e.collapseUnchanged?fF(e.collapseUnchanged):[])];r=r.update({effects:eX.appendConfig.of(s)}).state,o=o.update({effects:eX.appendConfig.of(s)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",l=document.createElement("div");l.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild("a-b"==a?l:u),this.editorDOM.appendChild("a-b"==a?u:l),this.a=new iF({state:r,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new iF({state:o,parent:u,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,"b-to-a"==e.revertControls,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),ep.empty(e[0].startState.doc.length));this.chunks=t==this.a?fg.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):fg.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:fh.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:fh.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let t="b-a"!=e.orientation;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;"revertControls"in e&&(t=!!e.revertControls,n="b-to-a"==e.revertControls),"renderRevertControl"in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t="highlightChanges"in e,n="gutter"in e,r="collapseUnchanged"in e;if(t||n||r){let i=[],o=[];if(t||n){let r=this.a.state.facet(fd),s=n?!1!==e.gutter:r.markGutter,a=t?!1!==e.highlightChanges:r.highlightChanges;i.push(fH.reconfigure([fd.of({side:"a",sibling:()=>this.b,highlightChanges:a,markGutter:s}),s?fS:[]])),o.push(fH.reconfigure([fd.of({side:"b",sibling:()=>this.a,highlightChanges:a,markGutter:s}),s?fS:[]]))}if(r){let t=fV.reconfigure(e.collapseUnchanged?fF(e.collapseUnchanged):[]);i.push(t),o.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:o})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",e=>this.revertClicked(e)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){!function(e,t,n){let r=new tt,i=new tt,o=e.state.field(fI).iter(),s=t.state.field(fI).iter(),a=0,l=0,u=0,c=0,d=e.viewport,h=t.viewport;for(let f=0;;f++){let p=f<n.length?n[f]:null,g=p?p.fromA:e.state.doc.length,m=p?p.fromB:t.state.doc.length;if(a<g){let n=e.lineBlockAt(a).top+u-(t.lineBlockAt(l).top+c);n<-.01?(u-=n,r.add(a,a,tU.widget({widget:new fT(-n),block:!0,side:-1}))):n>.01&&(c+=n,i.add(l,l,tU.widget({widget:new fT(n),block:!0,side:-1})))}if(g>a+1e3&&a<d.from&&g>d.from&&l<h.from&&m>h.from){let e=Math.min(d.from-a,h.from-l);a+=e,l+=e,f--}else if(p)a=p.toA,l=p.toB;else break;for(;o.value&&o.from<a;)u-=o.value.spec.widget.height,o.next();for(;s.value&&s.from<l;)c-=s.value.spec.widget.height,s.next()}for(;o.value;)u-=o.value.spec.widget.height,o.next();for(;s.value;)c-=s.value.spec.widget.height,s.next();let f=e.contentHeight+u-(t.contentHeight+c);f<.01?r.add(e.state.doc.length,e.state.doc.length,tU.widget({widget:new fT(-f),block:!0,side:1})):f>.01&&i.add(t.state.doc.length,t.state.doc.length,tU.widget({widget:new fT(f),block:!0,side:1}));let p=r.finish(),g=i.finish();fD(p,e.state.field(fI))||e.dispatch({effects:fR.of(p)}),fD(g,t.state.field(fI))||t.dispatch({effects:fR.of(g)})}(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let o=this.chunks[i];if(o.fromA>n.to||o.fromB>r.to)break;if(o.fromA<n.from||o.fromB<r.from)continue;let s=this.a.lineBlockAt(o.fromA).top+"px";for(;t&&+t.dataset.chunk<i;)t=fW(t);t&&t.dataset.chunk==String(i)?(t.style.top!=s&&(t.style.top=s),t=t.nextSibling):e.insertBefore(this.renderRevertButton(s,i),t)}for(;t;)t=fW(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement("button");let e=this.a.state.phrase("Revert this chunk");n.setAttribute("aria-label",e),n.setAttribute("title",e),n.textContent=this.revertToLeft?"⇜":"⇝"}return n.style.top=e,n.setAttribute("data-chunk",String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,o,s,a]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],l=t.state.sliceDoc(i,Math.max(i,o-1));i!=o&&a<=r.state.doc.length&&(l+=t.state.lineBreak),r.dispatch({changes:{from:s,to:Math.min(r.state.doc.length,a),insert:l},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function fW(e){let t=e.nextSibling;return e.remove(),t}let fU=new class extends oV{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},fq=eI.low(oq({class:"cm-changeGutter",markers:e=>{var t;return(null==(t=e.plugin(fk))?void 0:t.gutter)||te.empty},widgetMarker:(e,t)=>t instanceof fX?fU:null})),fQ=eX.define(),fK=eT.define({create:()=>Z.empty,update(e,t){for(let n of t.effects)n.is(fQ)&&(e=n.value.doc);return e}}),fG=new WeakMap;class fX extends t${constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function fY(e){let t=new tt;for(let n of e.field(fp)){let r=e.facet(fd).overrideChunk&&f0(e,n);t.add(n.fromB,n.fromB,function(e,t,n){let r=fG.get(t.changes);if(r)return r;let i=tU.widget({block:!0,side:-1,widget:new fX(r=>{let{highlightChanges:i,syntaxHighlightDeletions:o,syntaxHighlightDeletionsMaxLength:s,mergeControls:a}=e.facet(fd),l=document.createElement("div");if(l.className="cm-deletedChunk",a){let t=l.appendChild(document.createElement("div"));t.className="cm-chunkButtons";let n=e=>{e.preventDefault(),function(e,t){let{state:n}=e,r=null!=t?t:n.selection.main.head,i=e.state.field(fp).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return;let o=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=e.state.field(fK);i.fromB!=i.toB&&i.toA<=s.length&&(o+=e.state.lineBreak);let a=ep.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:o},s.length);e.dispatch({effects:fQ.of({doc:a.apply(s),changes:a}),userEvent:"accept"})}(r,r.posAtDOM(l))},i=e=>{e.preventDefault(),function(e,t){let{state:n}=e,r=null!=t?t:n.selection.main.head,i=n.field(fp).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return;let o=n.field(fK).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));i.fromA!=i.toA&&i.toB<=n.doc.length&&(o+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:o},userEvent:"revert"})}(r,r.posAtDOM(l))};if("function"==typeof a)t.appendChild(a("accept",n)),t.appendChild(a("reject",i));else{let r=t.appendChild(document.createElement("button"));r.name="accept",r.textContent=e.phrase("Accept"),r.onmousedown=n;let o=t.appendChild(document.createElement("button"));o.name="reject",o.textContent=e.phrase("Reject"),o.onmousedown=i}}if(n||t.fromA>=t.toA)return l;let u=r.state.field(fK).sliceString(t.fromA,t.endA),c=o&&e.facet(sV),d=g(),h=t.changes,f=0,p=!1;function g(){let e=l.appendChild(document.createElement("div"));return e.className="cm-deletedLine",e.appendChild(document.createElement("del"))}function m(e,t,n){for(let r=e;r<t;){if("\n"==u.charAt(r)){d.firstChild||d.appendChild(document.createElement("br")),d=g(),r++;continue}let e=t,o=n+(p?" cm-deletedText":""),s=!1,a=u.indexOf("\n",r);if(a>-1&&a<t&&(e=a),i&&f<h.length){let t=Math.max(0,p?h[f].toA:h[f].fromA);t<=e&&(e=t,p&&f++,s=!0)}if(e>r){let t=document.createTextNode(u.slice(r,e));if(o){let e=d.appendChild(document.createElement("span"));e.className=o,e.appendChild(t)}else d.appendChild(t);r=e}s&&(p=!p)}}if(c&&t.toA-t.fromA<=s){let t=c.parser.parse(u),n=0;su(t,{style:t=>(function(e,t,n){let r=am(e),i=null;if(r){for(let e of r)if(!e.scope){let n=e.style(t);n&&(i=i?i+" "+n:n)}}return i})(e,t)},(e,t,r)=>{e>n&&m(n,e,""),m(e,t,r),n=t}),m(n,u.length,"")}else m(0,u.length,"");return d.firstChild||d.appendChild(document.createElement("br")),l})});return fG.set(t.changes,i),i}(e,n,!!r))}return t.finish()}let fZ=eT.define({create:e=>fY(e),update:(e,t)=>t.state.field(fp,!1)!=t.startState.field(fp,!1)?fY(t.state):e,provide:e=>iF.decorations.from(e)}),fJ=new WeakMap;function f0(e,t){let n=fJ.get(t);if(void 0!==n)return n;n=null;let r=e.field(fK),i=e.doc,o=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,s=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;o:if(o==s&&o<10){let e=[],i=0,s=t.fromA,a=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(s+n.fromA,s+n.toA);if(/\n/.test(t))break o;e.push(tU.widget({widget:new f1(t),side:-1}).range(a+n.fromB))}n.fromB<n.toB&&e.push(fO.range(a+n.fromB,a+n.toB))}i<t.endA-t.fromA-2*o&&(n=e)}return fJ.set(t,n),n}class f1 extends t${constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement("del");return t.className="cm-deletedText",t.textContent=this.text,t}}let f2=new class extends oV{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},f5=tU.line({class:"cm-inlineChangedLine"});function f3(e,t,n,r){let i=f0(e,t),o=0;if(!i)return!1;for(let s=e.doc.lineAt(t.fromB);;){for(r&&r.add(s.from,s.from,f2),n.add(s.from,s.from,f5);o<i.length&&i[o].to<=s.to;){let e=i[o++];n.add(e.from,e.to,e.value)}if(s.to>=t.endB)break;s=e.doc.lineAt(s.to+1)}return!0}function f4({original:e,modified:t,language:n="sql",readOnly:r=!0,lineNumbers:i=!0,sideBySide:o=!0,height:s="100%",className:a="",theme:l="light",onModifiedChange:u}){let c=(0,u6.useRef)(null),d=(0,u6.useRef)(null),f=(0,u6.useMemo)(()=>{let e=[(e=>{switch(e){case"sql":default:return uE({dialect:uA});case"yaml":return new sH(uY)}})(n),"dark"===l?u4:u2];return i&&e.push(o6()),e},[n,l,i]);return(0,u6.useEffect)(()=>{if(c.current){if(d.current&&d.current.destroy(),o)d.current=new f$({a:{doc:e,extensions:[...f,iF.editable.of(!1),e3.readOnly.of(!0)]},b:{doc:t,extensions:[...f,iF.editable.of(!r),e3.readOnly.of(r),iF.updateListener.of(e=>{e.docChanged&&u&&u(e.state.doc.toString())})]},parent:c.current,revertControls:r?void 0:"a-to-b",highlightChanges:!0,gutter:i});else{var n,s;let o,a;d.current=new iF({doc:t,extensions:[...f,(o="string"==typeof(n={original:Z.of(e.split("\n")),allowInlineDiffs:!0,highlightChanges:!0,gutter:i,mergeControls:!1}).original?Z.of(n.original.split(/\r?\n/)):n.original,a=n.diffConfig||f_,[eI.low(fk),fZ,fz,iF.editorAttributes.of({class:"cm-merge-b"}),ff.of((e,t)=>{let n=t.effects.find(e=>e.is(fQ));return n&&(e=fg.updateA(e,n.value.doc,t.startState.doc,n.value.changes,a)),t.docChanged&&(e=fg.updateB(e,t.state.field(fK),t.newDoc,t.changes,a)),e}),fd.of({highlightChanges:!1!==n.highlightChanges,markGutter:!1!==n.gutter,syntaxHighlightDeletions:!1!==n.syntaxHighlightDeletions,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:null==(s=n.mergeControls)||s,overrideChunk:n.allowInlineDiffs?f3:void 0,side:"b"}),fK.init(()=>o),!1!==n.gutter?fq:[],n.collapseUnchanged?fF(n.collapseUnchanged):[],fp.init(e=>fg.build(o,e.doc,a))]),iF.editable.of(!r),e3.readOnly.of(r),iF.updateListener.of(e=>{e.docChanged&&u&&u(e.state.doc.toString())})],parent:c.current})}return()=>{d.current&&d.current.destroy()}}},[e,t,f,r,i,o,u]),(0,h.jsx)("div",{ref:c,className:`${a} no-track-pii-safe`,style:{height:s,overflow:"auto"}})}e.s(["DiffEditor",()=>f4],113145),e.s([],909139)},65086,e=>{"use strict";var t=e.i(955343);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3L280 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 204.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"},child:[]}]})(e)}e.s(["FaBookmark",()=>n,"FaChartSimple",()=>r,"FaCircleNodes",()=>i,"FaGauge",()=>o,"FaPlay",()=>s])},324557,328028,718292,315830,210721,621671,e=>{"use strict";e.i(316575);var t=e.i(187725),n=e.i(7284),r=e.i(778024);let i=t.createContext();var o=e.i(446547),s=e.i(73205),a=e.i(519273),l=e.i(435983),u=e.i(446519);function c(e){return(0,u.default)("MuiTable",e)}(0,l.default)("MuiTable",["root","stickyHeader"]);var d=e.i(19483);let h=(0,o.styled)("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})((0,s.default)(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),f="table",p=t.forwardRef(function(e,o){let s=(0,a.useDefaultProps)({props:e,name:"MuiTable"}),{className:l,component:u=f,padding:p="normal",size:g="medium",stickyHeader:m=!1,...v}=s,y={...s,component:u,padding:p,size:g,stickyHeader:m},b=(e=>{let{classes:t,stickyHeader:n}=e;return(0,r.default)({root:["root",n&&"stickyHeader"]},c,t)})(y),x=t.useMemo(()=>({padding:p,size:g,stickyHeader:m}),[p,g,m]);return(0,d.jsx)(i.Provider,{value:x,children:(0,d.jsx)(h,{as:u,role:u===f?null:"table",ref:o,className:(0,n.default)(b.root,l),ownerState:y,...v})})});e.s(["default",0,p],324557);let g=t.createContext();function m(e){return(0,u.default)("MuiTableBody",e)}(0,l.default)("MuiTableBody",["root"]);let v=(0,o.styled)("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),y={variant:"body"},b="tbody",x=t.forwardRef(function(e,t){let i=(0,a.useDefaultProps)({props:e,name:"MuiTableBody"}),{className:o,component:s=b,...l}=i,u={...i,component:s},c=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},m,t)})(u);return(0,d.jsx)(g.Provider,{value:y,children:(0,d.jsx)(v,{className:(0,n.default)(c.root,o),as:s,ref:t,role:s===b?null:"rowgroup",ownerState:u,...l})})});e.s(["default",0,x],328028);var w=e.i(578509);function _(e){return(0,u.default)("MuiTableCell",e)}let k=(0,l.default)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),S=(0,o.styled)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${(0,w.default)(n.size)}`],"normal"!==n.padding&&t[`padding${(0,w.default)(n.padding)}`],"inherit"!==n.align&&t[`align${(0,w.default)(n.align)}`],n.stickyHeader&&t.stickyHeader]}})((0,s.default)(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
5
+ ${"light"===e.palette.mode?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${k.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),C=t.forwardRef(function(e,o){let s,l=(0,a.useDefaultProps)({props:e,name:"MuiTableCell"}),{align:u="inherit",className:c,component:h,padding:f,scope:p,size:m,sortDirection:v,variant:y,...b}=l,x=t.useContext(i),k=t.useContext(g),C=k&&"head"===k.variant,O=p;"td"===(s=h||(C?"th":"td"))?O=void 0:!O&&C&&(O="col");let E=y||k&&k.variant,M={...l,align:u,component:s,padding:f||(x&&x.padding?x.padding:"normal"),size:m||(x&&x.size?x.size:"medium"),sortDirection:v,stickyHeader:"head"===E&&x&&x.stickyHeader,variant:E},A=(e=>{let{classes:t,variant:n,align:i,padding:o,size:s,stickyHeader:a}=e,l={root:["root",n,a&&"stickyHeader","inherit"!==i&&`align${(0,w.default)(i)}`,"normal"!==o&&`padding${(0,w.default)(o)}`,`size${(0,w.default)(s)}`]};return(0,r.default)(l,_,t)})(M),P=null;return v&&(P="asc"===v?"ascending":"descending"),(0,d.jsx)(S,{as:s,ref:o,className:(0,n.default)(A.root,c),"aria-sort":P,scope:O,ownerState:M,...b})});function O(e){return(0,u.default)("MuiTableContainer",e)}e.s(["default",0,C],718292),(0,l.default)("MuiTableContainer",["root"]);let E=(0,o.styled)("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),M=t.forwardRef(function(e,t){let i=(0,a.useDefaultProps)({props:e,name:"MuiTableContainer"}),{className:o,component:s="div",...l}=i,u={...i,component:s},c=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},O,t)})(u);return(0,d.jsx)(E,{ref:t,as:s,className:(0,n.default)(c.root,o),ownerState:u,...l})});function A(e){return(0,u.default)("MuiTableHead",e)}e.s(["default",0,M],315830),(0,l.default)("MuiTableHead",["root"]);let P=(0,o.styled)("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),T={variant:"head"},R="thead",I=t.forwardRef(function(e,t){let i=(0,a.useDefaultProps)({props:e,name:"MuiTableHead"}),{className:o,component:s=R,...l}=i,u={...i,component:s},c=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"]},A,t)})(u);return(0,d.jsx)(g.Provider,{value:T,children:(0,d.jsx)(P,{as:s,className:(0,n.default)(c.root,o),ref:t,role:s===R?null:"rowgroup",ownerState:u,...l})})});function D(e){return(0,u.default)("MuiTableRow",e)}e.s(["default",0,I],210721);let L=(0,l.default)("MuiTableRow",["root","selected","hover","head","footer"]),j=(0,o.styled)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})((0,s.default)(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${L.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${L.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),N=t.forwardRef(function(e,i){let o=(0,a.useDefaultProps)({props:e,name:"MuiTableRow"}),{className:s,component:l="tr",hover:u=!1,selected:c=!1,...h}=o,f=t.useContext(g),p={...o,component:l,hover:u,selected:c,head:f&&"head"===f.variant,footer:f&&"footer"===f.variant},m=(e=>{let{classes:t,selected:n,hover:i,head:o,footer:s}=e;return(0,r.default)({root:["root",n&&"selected",i&&"hover",o&&"head",s&&"footer"]},D,t)})(p);return(0,d.jsx)(j,{as:l,ref:i,className:(0,n.default)(m.root,s),role:"tr"===l?null:"row",ownerState:p,...h})});e.s(["default",0,N],621671)},868422,e=>{"use strict";var t=e.i(238153),n=e.i(492421),r=e.i(632713),i=e.i(539392),o=e.i(516467);function s(e,t){let n=(0,o.toDate)(e)-(0,o.toDate)(t);return n<0?-1:n>0?1:n}var a=e.i(511518);function l(e,l,u){var c;let d,h=(0,n.getDefaultOptions)(),f=u?.locale??h.locale??t.defaultLocale,p=s(e,l);if(isNaN(p))throw RangeError("Invalid time value");let g=Object.assign({},u,{addSuffix:u?.addSuffix,comparison:p}),[m,v]=(0,i.normalizeDates)(u?.in,...p>0?[l,e]:[e,l]),y=(c=void 0,e=>{let t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(((0,o.toDate)(v)-(0,o.toDate)(m))/1e3),b=Math.round((y-((0,r.getTimezoneOffsetInMilliseconds)(v)-(0,r.getTimezoneOffsetInMilliseconds)(m))/1e3)/60);if(b<2)if(u?.includeSeconds)if(y<5)return f.formatDistance("lessThanXSeconds",5,g);else if(y<10)return f.formatDistance("lessThanXSeconds",10,g);else if(y<20)return f.formatDistance("lessThanXSeconds",20,g);else if(y<40)return f.formatDistance("halfAMinute",0,g);else if(y<60)return f.formatDistance("lessThanXMinutes",1,g);else return f.formatDistance("xMinutes",1,g);else if(0===b)return f.formatDistance("lessThanXMinutes",1,g);else return f.formatDistance("xMinutes",b,g);if(b<45)return f.formatDistance("xMinutes",b,g);if(b<90)return f.formatDistance("aboutXHours",1,g);if(b<a.minutesInDay){let e=Math.round(b/60);return f.formatDistance("aboutXHours",e,g)}if(b<2520)return f.formatDistance("xDays",1,g);else if(b<a.minutesInMonth){let e=Math.round(b/a.minutesInDay);return f.formatDistance("xDays",e,g)}else if(b<2*a.minutesInMonth)return d=Math.round(b/a.minutesInMonth),f.formatDistance("aboutXMonths",d,g);if((d=function(e,t,n){var r,a;let l,u,c,d,[h,f,p]=(0,i.normalizeDates)(void 0,e,e,t),g=s(f,p),m=Math.abs(function(e,t,n){let[r,o]=(0,i.normalizeDates)(void 0,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}(f,p));if(m<1)return 0;1===f.getMonth()&&f.getDate()>27&&f.setDate(30),f.setMonth(f.getMonth()-g*m);let v=s(f,p)===-g;+(l=(0,o.toDate)(h,void 0),r=void 0,(u=(0,o.toDate)(l,r?.in)).setHours(23,59,59,999),u)==+(a=void 0,d=(c=(0,o.toDate)(l,a?.in)).getMonth(),c.setFullYear(c.getFullYear(),d+1,0),c.setHours(23,59,59,999),c)&&1===m&&1===s(h,p)&&(v=!1);let y=g*(m-v);return 0===y?0:y}(v,m))<12){let e=Math.round(b/a.minutesInMonth);return f.formatDistance("xMonths",e,g)}{let e=d%12,t=Math.trunc(d/12);return e<3?f.formatDistance("aboutXYears",t,g):e<9?f.formatDistance("overXYears",t,g):f.formatDistance("almostXYears",t+1,g)}}e.s(["formatDistance",()=>l],868422)},570795,(e,t,n)=>{var r=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},991915,(e,t,n)=>{t.exports=function(e,t){return function(n){return e(t(n))}}},642918,(e,t,n)=>{t.exports=e.r(991915)(Object.keys,Object)},603114,(e,t,n)=>{var r=e.r(570795),i=e.r(642918),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},363883,(e,t,n)=>{var r=e.r(423748),i=e.r(791606);t.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},656921,(e,t,n)=>{t.exports=e.r(818408)["__core-js_shared__"]},763803,(e,t,n)=>{var r,i=e.r(656921),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!o&&o in e}},395331,(e,t,n)=>{var r=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},732150,(e,t,n)=>{var r=e.r(363883),i=e.r(763803),o=e.r(791606),s=e.r(395331),a=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:a).test(s(e))}},861686,(e,t,n)=>{t.exports=function(e,t){return null==e?void 0:e[t]}},622280,(e,t,n)=>{var r=e.r(732150),i=e.r(861686);t.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},531751,(e,t,n)=>{t.exports=e.r(622280)(e.r(818408),"DataView")},74136,(e,t,n)=>{t.exports=e.r(622280)(e.r(818408),"Map")},31337,(e,t,n)=>{t.exports=e.r(622280)(e.r(818408),"Promise")},511524,(e,t,n)=>{t.exports=e.r(622280)(e.r(818408),"Set")},115942,(e,t,n)=>{t.exports=e.r(622280)(e.r(818408),"WeakMap")},626568,(e,t,n)=>{var r=e.r(531751),i=e.r(74136),o=e.r(31337),s=e.r(511524),a=e.r(115942),l=e.r(423748),u=e.r(395331),c="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",g=u(r),m=u(i),v=u(o),y=u(s),b=u(a),x=l;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=c||o&&x(o.resolve())!=d||s&&x(new s)!=h||a&&x(new a)!=f)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return p;case m:return c;case v:return d;case y:return h;case b:return f}return t}),t.exports=x},648313,(e,t,n)=>{var r=e.r(423748),i=e.r(819674);t.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},417288,(e,t,n)=>{var r=e.r(648313),i=e.r(819674),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable;t.exports=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")}},272098,(e,t,n)=>{t.exports=Array.isArray},145373,(e,t,n)=>{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},707850,(e,t,n)=>{var r=e.r(363883),i=e.r(145373);t.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},124019,(e,t,n)=>{t.exports=function(){return!1}},385370,(e,t,n)=>{var r=e.r(818408),i=e.r(124019),o=n&&!n.nodeType&&n,s=o&&t&&!t.nodeType&&t,a=s&&s.exports===o?r.Buffer:void 0;t.exports=(a?a.isBuffer:void 0)||i},719575,(e,t,n)=>{var r=e.r(423748),i=e.r(145373),o=e.r(819674),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},632900,(e,t,n)=>{t.exports=function(e){return function(t){return e(t)}}},845361,(e,t,n)=>{var r=e.r(472668),i=n&&!n.nodeType&&n,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i&&r.process;t.exports=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return s&&s.binding&&s.binding("util")}catch(e){}}()},713376,(e,t,n)=>{var r=e.r(719575),i=e.r(632900),o=e.r(845361),s=o&&o.isTypedArray;t.exports=s?i(s):r},820686,(e,t,n)=>{var r=e.r(603114),i=e.r(626568),o=e.r(417288),s=e.r(272098),a=e.r(707850),l=e.r(385370),u=e.r(570795),c=e.r(713376),d=Object.prototype.hasOwnProperty;t.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},65089,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(76130),i=e.i(468836),o=e.i(11321),s=e.i(772510),a=e.i(845209),l=e.i(610985),u=e.i(73371),c=e.i(939338),d=e.i(336277),h=e.i(324557),f=e.i(328028),p=e.i(718292),g=e.i(315830),m=e.i(210721),v=e.i(621671),y=e.i(197068),b=e.i(427938),x=e.i(230902),w=e.i(868422),_=e.i(511518),k=e.i(487122),S=e.i(516467);function C(e,t){let n,r,i=()=>(0,k.constructFrom)(t?.in,NaN),o=t?.additionalDigits??2,s=function(e){let t,n={},r=e.split(O);if(r.length>2)return n;if(/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],E.test(n.date)&&(n.date=e.split(E)[0],t=e.substr(n.date.length,e.length))),t){let e=M.exec(t);e?(n.time=t.replace(e[1],""),n.timezone=e[1]):n.time=t}return n}(e);if(s.date){let e=function(e,t){let n=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};let i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:e.slice((r[1]||r[2]).length)}}(s.date,o);n=function(e,t){var n,r,i,o,s,a,l,u,c,d;if(null===t)return new Date(NaN);let h=e.match(A);if(!h)return new Date(NaN);let f=!!h[4],p=R(h[1]),g=R(h[2])-1,m=R(h[3]),v=R(h[4]),y=R(h[5])-1;if(f){let e,a;return(n=v,r=y,n>=1&&n<=53&&r>=0&&r<=6)?(i=t,o=v,s=y,(e=new Date(0)).setUTCFullYear(i,0,4),a=e.getUTCDay()||7,e.setUTCDate(e.getUTCDate()+((o-1)*7+s+1-a)),e):new Date(NaN)}{let e=new Date(0);return(a=t,l=g,u=m,l>=0&&l<=11&&u>=1&&u<=(D[l]||(L(a)?29:28))&&(c=t,(d=p)>=1&&d<=(L(c)?366:365)))?(e.setUTCFullYear(t,g,Math.max(p,m)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!n||isNaN(+n))return i();let a=+n,l=0;if(s.time&&isNaN(l=function(e){var t,n,r;let i=e.match(P);if(!i)return NaN;let o=I(i[1]),s=I(i[2]),a=I(i[3]);return(t=o,n=s,r=a,24===t?0===n&&0===r:r>=0&&r<60&&n>=0&&n<60&&t>=0&&t<25)?o*_.millisecondsInHour+s*_.millisecondsInMinute+1e3*a:NaN}(s.time)))return i();if(s.timezone){if(isNaN(r=function(e){var t;if("Z"===e)return 0;let n=e.match(T);if(!n)return 0;let r="+"===n[1]?-1:1,i=parseInt(n[2]),o=n[3]&&parseInt(n[3])||0;return(t=o)>=0&&t<=59?r*(i*_.millisecondsInHour+o*_.millisecondsInMinute):NaN}(s.timezone)))return i()}else{let e=new Date(a+l),n=(0,S.toDate)(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return(0,S.toDate)(a+l+r,t?.in)}let O=/[T ]/,E=/[Z ]/i,M=/([Z+-].*)$/,A=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,P=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,T=/^([+-])(\d{2})(?::?(\d{2}))?$/;function R(e){return e?parseInt(e):1}function I(e){return e&&parseFloat(e.replace(",","."))||0}let D=[31,null,31,30,31,30,31,31,30,31,30,31];function L(e){return e%400==0||e%4==0&&e%100!=0}var j=e.i(820686),N=e.i(187725),F=e.i(603338),B=e.i(901407),z=e.i(203158),V=e.i(916955),H=e.i(272064);function $(e){let t=C(e);return(0,x.format)(t,"yyyy-MM-dd'T'HH:mm:ss")}function W(e){let t=C(e);return(0,w.formatDistance)(t,new Date,{addSuffix:!0})}function U(e){let t=new Set,n=new Set;if(e?.nodes)for(let r of Object.values(e.nodes))r.data.data.base?.schema&&t.add(r.data.data.base.schema),r.data.data.current?.schema&&n.add(r.data.data.current.schema);return[t,n]}function q(e){return Object.values(e).every(e=>null===e)?[(0,t.jsx)(n.default,{sx:{ml:"10px"},children:"No information"},"no info")]:Object.entries(e).filter(([e,t])=>"url"!==e&&null!=t).map(([e,n])=>(0,t.jsxs)("li",{style:{marginLeft:"10px"},children:[e,": ",n]},e))}function Q(){let{envInfo:e,reviewMode:x,lineageGraph:w}=(0,V.useLineageGraphContext)(),[_,k]=(0,N.useState)(!1),S=e?.git,C=e?.pullRequest,O={...S,...C},E=e?.dbt?.base,M=e?.dbt?.current,A=E?.generated_at?$(E.generated_at):"",P=M?.generated_at?$(M.generated_at):"",T="",R="";E&&(T=E.generated_at?W(E.generated_at):""),M&&(R=M.generated_at?W(M.generated_at):"");let[I,D]=U(w),L=(0,N.useRef)(!1);(0,N.useEffect)(()=>{if(!L.current&&e){let t,n,r,i,o;L.current=!0;let s=(t=e?.git,n=e?.pullRequest,r=e?.dbt?.base,i=e?.dbt?.current,o={review_mode:x||!1,adapter_type:e?.adapterType||null,has_git_info:!(0,j.default)(t),has_pr_info:!(0,j.default)(n)},e?.adapterType==="dbt"&&(o.base={schema_count:I.size,dbt_version:r?.dbt_version||null,timestamp:r?.generated_at||null},o.current={schema_count:D.size,dbt_version:i?.dbt_version||null,timestamp:i?.generated_at||null},o.schemas_match=I.size===D.size&&Array.from(I).every(e=>D.has(e))),e?.adapterType==="sqlmesh"&&(o.base={has_env:!!e.sqlmesh?.base_env},o.current={has_env:!!e.sqlmesh?.current_env}),o);(0,z.trackEnvironmentConfig)(s)}},[e,x,I,D]);let Q=()=>k(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.default,{title:"Environment Info",placement:"bottom-end",children:(0,t.jsxs)("div",{className:"flex items-center hover:cursor-pointer hover:text-black",onClick:()=>k(!0),children:[(0,t.jsxs)("div",{className:"hidden text-sm lg:flex lg:flex-col",children:[(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(b.default,{component:"span",sx:{color:"warning.main"},className:"no-track-pii-safe max-w-32 truncate",children:Array.from(I).join(", ")})," ","(",T,")"]}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(b.default,{component:"span",sx:{color:"primary.main"},className:"no-track-pii-safe max-w-32 truncate",children:Array.from(D).join(", ")})," ","(",R,")"]})]}),(0,t.jsx)(u.default,{size:"small","aria-label":"Environment Info",children:(0,t.jsx)(n.default,{component:H.IconInfo,sx:{fontSize:16,verticalAlign:"middle"}})})]})}),(0,t.jsxs)(i.default,{open:_,onClose:Q,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsxs)(a.default,{sx:{display:"flex",alignItems:"center"},children:["Environment Information",(0,t.jsx)(n.default,{sx:{flexGrow:1}}),(0,t.jsx)(u.default,{size:"small",onClick:Q,children:(0,t.jsx)(F.IoClose,{})})]}),(0,t.jsx)(s.default,{children:(0,t.jsxs)(d.default,{direction:"column",spacing:1,children:[x?(0,t.jsxs)(d.default,{direction:"column",spacing:.5,children:[(0,t.jsx)(b.default,{variant:"h6",sx:{fontSize:"1rem"},children:"Review Information"}),(0,t.jsxs)("ul",{style:{margin:0,paddingLeft:"20px"},children:[O.url&&(0,t.jsxs)("li",{style:{marginLeft:"10px"},children:["url:"," ",(0,t.jsxs)(c.default,{href:O.url,target:"_blank",sx:{color:"primary.main"},children:[O.url," ",(0,t.jsx)(B.LuExternalLink,{})]})]}),!(0,j.default)(O)&&q(O)]})]}):(0,t.jsxs)(d.default,{direction:"column",spacing:.5,children:[(0,t.jsx)(b.default,{variant:"h6",sx:{fontSize:"1rem"},children:"Dev Information"}),(0,t.jsx)("ul",{style:{margin:0,paddingLeft:"20px"},children:S&&q(S)})]}),(0,t.jsx)(l.default,{}),e?.adapterType==="dbt"&&(0,t.jsxs)(d.default,{direction:"column",spacing:.5,children:[(0,t.jsx)(b.default,{variant:"h6",sx:{fontSize:"1rem"},children:"DBT"}),(0,t.jsx)(g.default,{sx:{border:1,borderColor:"divider",maxHeight:"30rem"},children:(0,t.jsxs)(h.default,{size:"small",stickyHeader:!0,children:[(0,t.jsx)(m.default,{children:(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{}),(0,t.jsx)(p.default,{children:"base"}),(0,t.jsx)(p.default,{children:"current"})]})}),(0,t.jsxs)(f.default,{children:[(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{children:"schema"}),(0,t.jsx)(p.default,{className:"no-track-pii-safe",children:Array.from(I).map(e=>(0,t.jsx)(y.default,{title:e,placement:"bottom",children:(0,t.jsx)("div",{className:"max-w-72 truncate",children:e})},e))}),(0,t.jsx)(p.default,{className:"no-track-pii-safe",children:Array.from(D).map(e=>(0,t.jsx)(y.default,{title:e,placement:"bottom",children:(0,t.jsx)("div",{className:"max-w-72 truncate",children:e})},e))})]}),(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{children:"version"}),(0,t.jsx)(p.default,{children:E?.dbt_version}),(0,t.jsx)(p.default,{children:M?.dbt_version})]}),(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{children:"timestamp"}),(0,t.jsx)(p.default,{children:A}),(0,t.jsx)(p.default,{children:P})]})]})]})})]}),e?.adapterType==="sqlmesh"&&(0,t.jsxs)(d.default,{direction:"column",spacing:.5,children:[(0,t.jsx)(b.default,{variant:"h6",sx:{fontSize:"1rem"},children:"SQLMesh"}),(0,t.jsx)(g.default,{sx:{border:1,borderColor:"divider",maxHeight:"30rem"},children:(0,t.jsxs)(h.default,{stickyHeader:!0,children:[(0,t.jsx)(m.default,{children:(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{}),(0,t.jsx)(p.default,{children:"base"}),(0,t.jsx)(p.default,{children:"current"})]})}),(0,t.jsx)(f.default,{children:(0,t.jsxs)(v.default,{children:[(0,t.jsx)(p.default,{children:"Environment"}),(0,t.jsx)(p.default,{className:"no-track-pii-safe",children:e.sqlmesh?.base_env}),(0,t.jsx)(p.default,{className:"no-track-pii-safe",children:e.sqlmesh?.current_env})]})})]})})]})]})}),(0,t.jsx)(o.default,{children:(0,t.jsx)(r.default,{color:"iochmara",onClick:Q,children:"Close"})})]})]})}e.s(["EnvInfo",()=>Q,"extractSchemas",()=>U,"formatTimeToNow",()=>W,"formatTimestamp",()=>$],65089)},138848,e=>{"use strict";var t=e.i(19483),n=e.i(324066),r=e.i(76130),i=e.i(336277),o=e.i(427938),s=e.i(187725),a=e.i(65086),l=e.i(65089);e.i(909139);var u=e.i(750060),c=e.i(916955),d=e.i(912007);function h({value:e,onChange:c,onRun:h,onRunBase:f,onRunDiff:p,label:g,CustomEditor:m,options:v={},manifestData:y,schemas:b,...x}){let{featureToggles:w}=(0,d.useRecceInstanceContext)(),_="";y&&(_=y.generated_at?(0,l.formatTimeToNow)(y.generated_at):"");let k=(0,s.useMemo)(()=>{let e=[];return h&&e.push({key:"Mod-Enter",run:()=>(h(),!0)}),f&&e.push({key:"Alt-Enter",run:()=>(f(),!0)}),p&&e.push({key:"Mod-Shift-Enter",run:()=>(p(),!0)}),e},[h,f,p]);return(0,t.jsxs)(t.Fragment,{children:[(g??h??f)&&(0,t.jsxs)(i.default,{direction:"row",sx:{bgcolor:"#EDF2F880",height:"40px",minHeight:"40px",fontSize:"14px",alignItems:"center",m:0,p:"0px 16px",flex:"0 0 40px"},children:[(0,t.jsx)(o.default,{component:"strong",sx:{fontWeight:"bold"},className:"no-track-pii-safe",children:g?g.toUpperCase():""}),y&&(0,t.jsxs)("span",{className:"ml-1",children:["(",b&&(0,t.jsxs)("span",{className:"no-track-pii-safe",children:[b,", "]}),(0,t.jsx)("span",{children:_}),")"]}),(0,t.jsx)(n.default,{sx:{flexGrow:1}}),(h??f)&&(0,t.jsx)(r.default,{size:"xsmall",variant:"outlined",onClick:h??f,sx:{bgcolor:"white",p:"6px 12px"},disabled:w.disableDatabaseQuery,startIcon:(0,t.jsx)(a.FaPlay,{}),children:"Run Query"})]}),m??(0,t.jsx)(u.CodeEditor,{value:e,onChange:e=>{c&&c(e)},language:"sql",readOnly:v.readOnly??!1,lineNumbers:"off"!==v.lineNumbers,wordWrap:"off"!==v.wordWrap,fontSize:v.fontSize??16,keyBindings:k,className:"no-track-pii-safe max-h-dvh h-full"})]})}function f({value:e,baseValue:n,onChange:r,onChangeBase:o,onRun:s,onRunBase:a,onRunDiff:u,options:d={},labels:f,SetupGuide:p,...g}){let m,v,y=f?f[0]:"Base",b=f?f[1]:"Current",{envInfo:x,lineageGraph:w}=(0,c.useLineageGraphContext)();x?.dbt?.base&&x.dbt.current&&(m=x.dbt.base,v=x.dbt.current);let[_,k]=(0,l.extractSchemas)(w);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(i.default,{direction:"row",sx:{height:"100%",gap:0},children:[(0,t.jsx)(i.default,{sx:{height:"100%",width:"50%",gap:0,borderRight:"1px solid #D4DBE4"},children:(0,t.jsx)(h,{label:y,value:n??"",onChange:o,onRunBase:a,options:d,CustomEditor:p,manifestData:m??void 0,schemas:Array.from(_).join(", "),...g})}),(0,t.jsx)(i.default,{sx:{height:"100%",width:"50%",gap:0},children:(0,t.jsx)(h,{label:b,value:e,onChange:r,onRun:s,options:d,manifestData:v??void 0,schemas:Array.from(k).join(", "),...g})})]})})}e.s(["DualSqlEditor",()=>f,"default",0,h])}]);