nextjs-studio 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +3 -1
  2. package/dist/bin/nextjs-studio.js +286 -34
  3. package/dist/bin/nextjs-studio.js.map +1 -1
  4. package/dist/cli/ui/.next/BUILD_ID +1 -0
  5. package/dist/cli/ui/.next/app-path-routes-manifest.json +12 -0
  6. package/dist/cli/ui/.next/build-manifest.json +20 -0
  7. package/dist/cli/ui/.next/export-marker.json +6 -0
  8. package/dist/cli/ui/.next/images-manifest.json +67 -0
  9. package/dist/cli/ui/.next/next-minimal-server.js.nft.json +1 -0
  10. package/dist/cli/ui/.next/next-server.js.nft.json +1 -0
  11. package/dist/cli/ui/.next/package.json +1 -0
  12. package/dist/cli/ui/.next/prerender-manifest.json +61 -0
  13. package/dist/cli/ui/.next/react-loadable-manifest.json +286 -0
  14. package/dist/cli/ui/.next/required-server-files.js +338 -0
  15. package/dist/cli/ui/.next/required-server-files.json +338 -0
  16. package/dist/cli/ui/.next/routes-manifest.json +125 -0
  17. package/dist/cli/ui/.next/server/app/_global-error/page.js +3 -0
  18. package/dist/cli/ui/.next/server/app/_global-error/page.js.nft.json +1 -0
  19. package/dist/cli/ui/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
  20. package/dist/cli/ui/.next/server/app/_global-error.html +2 -0
  21. package/dist/cli/ui/.next/server/app/_global-error.meta +16 -0
  22. package/dist/cli/ui/.next/server/app/_global-error.rsc +12 -0
  23. package/dist/cli/ui/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  24. package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
  25. package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
  26. package/dist/cli/ui/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  27. package/dist/cli/ui/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  28. package/dist/cli/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  29. package/dist/cli/ui/.next/server/app/_not-found/page.js +2 -0
  30. package/dist/cli/ui/.next/server/app/_not-found/page.js.nft.json +1 -0
  31. package/dist/cli/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  32. package/dist/cli/ui/.next/server/app/_not-found.html +1 -0
  33. package/dist/cli/ui/.next/server/app/_not-found.meta +16 -0
  34. package/dist/cli/ui/.next/server/app/_not-found.rsc +15 -0
  35. package/dist/cli/ui/.next/server/app/_not-found.segments/_full.segment.rsc +15 -0
  36. package/dist/cli/ui/.next/server/app/_not-found.segments/_head.segment.rsc +5 -0
  37. package/dist/cli/ui/.next/server/app/_not-found.segments/_index.segment.rsc +7 -0
  38. package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  39. package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  40. package/dist/cli/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  41. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js +1 -0
  42. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js.nft.json +1 -0
  43. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route_client-reference-manifest.js +1 -0
  44. package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js +1 -0
  45. package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js.nft.json +1 -0
  46. package/dist/cli/ui/.next/server/app/api/media/[collection]/route_client-reference-manifest.js +1 -0
  47. package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js +1 -0
  48. package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js.nft.json +1 -0
  49. package/dist/cli/ui/.next/server/app/api/public/[...path]/route_client-reference-manifest.js +1 -0
  50. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js +1 -0
  51. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js.nft.json +1 -0
  52. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route_client-reference-manifest.js +1 -0
  53. package/dist/cli/ui/.next/server/app/api/watch/route.js +3 -0
  54. package/dist/cli/ui/.next/server/app/api/watch/route.js.nft.json +1 -0
  55. package/dist/cli/ui/.next/server/app/api/watch/route_client-reference-manifest.js +1 -0
  56. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js +99 -0
  57. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js.nft.json +1 -0
  58. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page_client-reference-manifest.js +1 -0
  59. package/dist/cli/ui/.next/server/app/collection/[name]/page.js +5 -0
  60. package/dist/cli/ui/.next/server/app/collection/[name]/page.js.nft.json +1 -0
  61. package/dist/cli/ui/.next/server/app/collection/[name]/page_client-reference-manifest.js +1 -0
  62. package/dist/cli/ui/.next/server/app/page.js +2 -0
  63. package/dist/cli/ui/.next/server/app/page.js.nft.json +1 -0
  64. package/dist/cli/ui/.next/server/app/page_client-reference-manifest.js +1 -0
  65. package/dist/cli/ui/.next/server/app-paths-manifest.json +12 -0
  66. package/dist/cli/ui/.next/server/chunks/1875.js +1 -0
  67. package/dist/cli/ui/.next/server/chunks/2198.js +1 -0
  68. package/dist/cli/ui/.next/server/chunks/2446.js +36 -0
  69. package/dist/cli/ui/.next/server/chunks/2474.js +148 -0
  70. package/dist/cli/ui/.next/server/chunks/2490.js +55 -0
  71. package/dist/cli/ui/.next/server/chunks/2717.js +56 -0
  72. package/dist/cli/ui/.next/server/chunks/2729.js +166 -0
  73. package/dist/cli/ui/.next/server/chunks/2774.js +1 -0
  74. package/dist/cli/ui/.next/server/chunks/2796.js +1 -0
  75. package/dist/cli/ui/.next/server/chunks/3145.js +1 -0
  76. package/dist/cli/ui/.next/server/chunks/3186.js +1 -0
  77. package/dist/cli/ui/.next/server/chunks/3494.js +24 -0
  78. package/dist/cli/ui/.next/server/chunks/3610.js +1 -0
  79. package/dist/cli/ui/.next/server/chunks/3659.js +93 -0
  80. package/dist/cli/ui/.next/server/chunks/3744.js +1 -0
  81. package/dist/cli/ui/.next/server/chunks/3806.js +136 -0
  82. package/dist/cli/ui/.next/server/chunks/408.js +1 -0
  83. package/dist/cli/ui/.next/server/chunks/4189.js +62 -0
  84. package/dist/cli/ui/.next/server/chunks/4293.js +1 -0
  85. package/dist/cli/ui/.next/server/chunks/4469.js +4 -0
  86. package/dist/cli/ui/.next/server/chunks/4484.js +1 -0
  87. package/dist/cli/ui/.next/server/chunks/449.js +82 -0
  88. package/dist/cli/ui/.next/server/chunks/4607.js +22 -0
  89. package/dist/cli/ui/.next/server/chunks/479.js +5 -0
  90. package/dist/cli/ui/.next/server/chunks/4931.js +63 -0
  91. package/dist/cli/ui/.next/server/chunks/528.js +1 -0
  92. package/dist/cli/ui/.next/server/chunks/5341.js +1 -0
  93. package/dist/cli/ui/.next/server/chunks/5585.js +29 -0
  94. package/dist/cli/ui/.next/server/chunks/5677.js +1 -0
  95. package/dist/cli/ui/.next/server/chunks/5724.js +1 -0
  96. package/dist/cli/ui/.next/server/chunks/5760.js +174 -0
  97. package/dist/cli/ui/.next/server/chunks/5784.js +24 -0
  98. package/dist/cli/ui/.next/server/chunks/6.js +262 -0
  99. package/dist/cli/ui/.next/server/chunks/6040.js +1 -0
  100. package/dist/cli/ui/.next/server/chunks/6067.js +13 -0
  101. package/dist/cli/ui/.next/server/chunks/6553.js +1 -0
  102. package/dist/cli/ui/.next/server/chunks/6656.js +201 -0
  103. package/dist/cli/ui/.next/server/chunks/6672.js +1 -0
  104. package/dist/cli/ui/.next/server/chunks/6872.js +1 -0
  105. package/dist/cli/ui/.next/server/chunks/7146.js +59 -0
  106. package/dist/cli/ui/.next/server/chunks/7354.js +1 -0
  107. package/dist/cli/ui/.next/server/chunks/7677.js +1 -0
  108. package/dist/cli/ui/.next/server/chunks/7781.js +1 -0
  109. package/dist/cli/ui/.next/server/chunks/8194.js +215 -0
  110. package/dist/cli/ui/.next/server/chunks/8231.js +1 -0
  111. package/dist/cli/ui/.next/server/chunks/8319.js +2 -0
  112. package/dist/cli/ui/.next/server/chunks/8339.js +1 -0
  113. package/dist/cli/ui/.next/server/chunks/8775.js +1 -0
  114. package/dist/cli/ui/.next/server/chunks/9503.js +43 -0
  115. package/dist/cli/ui/.next/server/chunks/958.js +131 -0
  116. package/dist/cli/ui/.next/server/chunks/9739.js +1 -0
  117. package/dist/cli/ui/.next/server/functions-config-manifest.json +4 -0
  118. package/dist/cli/ui/.next/server/interception-route-rewrite-manifest.js +1 -0
  119. package/dist/cli/ui/.next/server/middleware-build-manifest.js +1 -0
  120. package/dist/cli/ui/.next/server/middleware-manifest.json +6 -0
  121. package/dist/cli/ui/.next/server/middleware-react-loadable-manifest.js +1 -0
  122. package/dist/cli/ui/.next/server/next-font-manifest.js +1 -0
  123. package/dist/cli/ui/.next/server/next-font-manifest.json +1 -0
  124. package/dist/cli/ui/.next/server/pages/404.html +1 -0
  125. package/dist/cli/ui/.next/server/pages/500.html +2 -0
  126. package/dist/cli/ui/.next/server/pages-manifest.json +4 -0
  127. package/dist/cli/ui/.next/server/server-reference-manifest.js +1 -0
  128. package/dist/cli/ui/.next/server/server-reference-manifest.json +1 -0
  129. package/dist/cli/ui/.next/server/webpack-runtime.js +1 -0
  130. package/dist/cli/ui/.next/static/chunks/0937d497-2b220e2d0368e918.js +1 -0
  131. package/dist/cli/ui/.next/static/chunks/1013.5541c1c75688ef6e.js +1 -0
  132. package/dist/cli/ui/.next/static/chunks/1039.d26ef6a818f26d70.js +4 -0
  133. package/dist/cli/ui/.next/static/chunks/1325.cb67348b484ce7a0.js +24 -0
  134. package/dist/cli/ui/.next/static/chunks/1858-d10f8bead2218ad2.js +2 -0
  135. package/dist/cli/ui/.next/static/chunks/1882.05c68ab6bdcd8c31.js +1 -0
  136. package/dist/cli/ui/.next/static/chunks/2011.7e73842f1e8e2cde.js +1 -0
  137. package/dist/cli/ui/.next/static/chunks/2046.73486ea936c9afd2.js +1 -0
  138. package/dist/cli/ui/.next/static/chunks/2389.b73d3a1286a228d0.js +1 -0
  139. package/dist/cli/ui/.next/static/chunks/2430.08df5899978ebf26.js +43 -0
  140. package/dist/cli/ui/.next/static/chunks/2462-4255d8f51dc56f12.js +1 -0
  141. package/dist/cli/ui/.next/static/chunks/3098-4269da0468edc350.js +1 -0
  142. package/dist/cli/ui/.next/static/chunks/317.b4fcc40f219152b1.js +1 -0
  143. package/dist/cli/ui/.next/static/chunks/3197.d2f3398e552228e4.js +1 -0
  144. package/dist/cli/ui/.next/static/chunks/3212-1a9c9d110d15abab.js +4 -0
  145. package/dist/cli/ui/.next/static/chunks/3809.8df186de2ff997f8.js +1 -0
  146. package/dist/cli/ui/.next/static/chunks/3918.caaf4eb4f6450524.js +1 -0
  147. package/dist/cli/ui/.next/static/chunks/3987-6d3217e36ae5b4dc.js +1 -0
  148. package/dist/cli/ui/.next/static/chunks/3c774391-ec08594272867fd5.js +79 -0
  149. package/dist/cli/ui/.next/static/chunks/4075052f.9006147a6182ed95.js +1 -0
  150. package/dist/cli/ui/.next/static/chunks/4389.e7a3c58aa62118e3.js +82 -0
  151. package/dist/cli/ui/.next/static/chunks/46bdbe0e-f5103600b23143b8.js +1 -0
  152. package/dist/cli/ui/.next/static/chunks/4860.2ba51d1d81857c81.js +1 -0
  153. package/dist/cli/ui/.next/static/chunks/4882.794e2a9231f129e5.js +55 -0
  154. package/dist/cli/ui/.next/static/chunks/5149.8de9918b9ace58f5.js +166 -0
  155. package/dist/cli/ui/.next/static/chunks/5230.b7c87400f0d8516f.js +215 -0
  156. package/dist/cli/ui/.next/static/chunks/5263.7adc3ade53cd4ed3.js +24 -0
  157. package/dist/cli/ui/.next/static/chunks/5313.1dfcc2126f85a8f8.js +1 -0
  158. package/dist/cli/ui/.next/static/chunks/5350-17c792e27bf38c77.js +1 -0
  159. package/dist/cli/ui/.next/static/chunks/5638.e3a2119354708654.js +1 -0
  160. package/dist/cli/ui/.next/static/chunks/5758.33b45c6c407ecd94.js +1 -0
  161. package/dist/cli/ui/.next/static/chunks/589.019158de5d02c262.js +1 -0
  162. package/dist/cli/ui/.next/static/chunks/6013.e33e73569339afee.js +62 -0
  163. package/dist/cli/ui/.next/static/chunks/6084.7511ad4ebb4f9df5.js +1 -0
  164. package/dist/cli/ui/.next/static/chunks/612.d3aeebcaaaf06fb2.js +1 -0
  165. package/dist/cli/ui/.next/static/chunks/6239.6c0cd99ea36222b6.js +5 -0
  166. package/dist/cli/ui/.next/static/chunks/6299-79a74877b87acf9f.js +1 -0
  167. package/dist/cli/ui/.next/static/chunks/6484.d38aa531768c3452.js +148 -0
  168. package/dist/cli/ui/.next/static/chunks/6505.731f74c28b8980b3.js +1 -0
  169. package/dist/cli/ui/.next/static/chunks/6584.be94a55391bcdcce.js +262 -0
  170. package/dist/cli/ui/.next/static/chunks/6800.1066ad1f5add7c75.js +1 -0
  171. package/dist/cli/ui/.next/static/chunks/7052.89e2de773d10ac20.js +131 -0
  172. package/dist/cli/ui/.next/static/chunks/7127.360abfa43dc4427e.js +36 -0
  173. package/dist/cli/ui/.next/static/chunks/7430.2b247d9ac6ef694c.js +149 -0
  174. package/dist/cli/ui/.next/static/chunks/7444.66c4d6bbc19309b3.js +59 -0
  175. package/dist/cli/ui/.next/static/chunks/7546.4cb4db4685212384.js +63 -0
  176. package/dist/cli/ui/.next/static/chunks/7564.7b9271fcf06df80c.js +29 -0
  177. package/dist/cli/ui/.next/static/chunks/7664.8268c156d8988844.js +174 -0
  178. package/dist/cli/ui/.next/static/chunks/7722-04e64cc1b26cfa65.js +1 -0
  179. package/dist/cli/ui/.next/static/chunks/8701.3995b58a75e43147.js +56 -0
  180. package/dist/cli/ui/.next/static/chunks/8800.548c3da26cfebf06.js +1 -0
  181. package/dist/cli/ui/.next/static/chunks/8814-7b64110c79ce7209.js +15 -0
  182. package/dist/cli/ui/.next/static/chunks/9058.a195d15265251194.js +1 -0
  183. package/dist/cli/ui/.next/static/chunks/9211.91144a0d23e4cf6d.js +1 -0
  184. package/dist/cli/ui/.next/static/chunks/9690.c1f08c02a675b9ce.js +1 -0
  185. package/dist/cli/ui/.next/static/chunks/9919.1ccc9ca4a749d9b7.js +93 -0
  186. package/dist/cli/ui/.next/static/chunks/app/_global-error/page-ad53913b77389472.js +1 -0
  187. package/dist/cli/ui/.next/static/chunks/app/_not-found/page-202c1e16a4b86ac8.js +1 -0
  188. package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/[filename]/route-ad53913b77389472.js +1 -0
  189. package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/route-ad53913b77389472.js +1 -0
  190. package/dist/cli/ui/.next/static/chunks/app/api/public/[...path]/route-ad53913b77389472.js +1 -0
  191. package/dist/cli/ui/.next/static/chunks/app/api/sync/[collection]/route-ad53913b77389472.js +1 -0
  192. package/dist/cli/ui/.next/static/chunks/app/api/watch/route-ad53913b77389472.js +1 -0
  193. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/[slug]/page-7ea9eff252374845.js +6 -0
  194. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/loading-03fc0b653e7060ae.js +1 -0
  195. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/page-ad5976bebc9820cf.js +1 -0
  196. package/dist/cli/ui/.next/static/chunks/app/layout-74cd2ebe3fac00e7.js +1 -0
  197. package/dist/cli/ui/.next/static/chunks/app/page-ed5acadf20146966.js +1 -0
  198. package/dist/cli/ui/.next/static/chunks/b1767599.6a816b06e55b02a1.js +1 -0
  199. package/dist/cli/ui/.next/static/chunks/c6164070.3b9741bce302db0f.js +136 -0
  200. package/dist/cli/ui/.next/static/chunks/fb2ceba8.7fc23e46ca00cfd1.js +53 -0
  201. package/dist/cli/ui/.next/static/chunks/framework-ada624c9bf38edc6.js +1 -0
  202. package/dist/cli/ui/.next/static/chunks/main-0513ff42a7f2e1a0.js +5 -0
  203. package/dist/cli/ui/.next/static/chunks/main-app-b8d23dfb755744e8.js +1 -0
  204. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/app-error-ad53913b77389472.js +1 -0
  205. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/forbidden-ad53913b77389472.js +1 -0
  206. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/global-error-558ee1074f45044b.js +1 -0
  207. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/not-found-ad53913b77389472.js +1 -0
  208. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ad53913b77389472.js +1 -0
  209. package/dist/cli/ui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  210. package/dist/cli/ui/.next/static/chunks/webpack-acb903cd88aafa6f.js +1 -0
  211. package/dist/cli/ui/.next/static/css/e143949aa3f17880.css +3 -0
  212. package/dist/cli/ui/.next/static/media/034d78ad42e9620c-s.woff2 +0 -0
  213. package/dist/cli/ui/.next/static/media/0484562807a97172-s.p.woff2 +0 -0
  214. package/dist/cli/ui/.next/static/media/29a4aea02fdee119-s.woff2 +0 -0
  215. package/dist/cli/ui/.next/static/media/29e7bbdce9332268-s.woff2 +0 -0
  216. package/dist/cli/ui/.next/static/media/4c285fdca692ea22-s.p.woff2 +0 -0
  217. package/dist/cli/ui/.next/static/media/6c177e25b87fd9cd-s.woff2 +0 -0
  218. package/dist/cli/ui/.next/static/media/6c9a125e97d835e1-s.woff2 +0 -0
  219. package/dist/cli/ui/.next/static/media/8888a3826f4a3af4-s.p.woff2 +0 -0
  220. package/dist/cli/ui/.next/static/media/a1386beebedccca4-s.woff2 +0 -0
  221. package/dist/cli/ui/.next/static/media/b957ea75a84b6ea7-s.p.woff2 +0 -0
  222. package/dist/cli/ui/.next/static/media/c3bc380753a8436c-s.woff2 +0 -0
  223. package/dist/cli/ui/.next/static/media/db911767852bc875-s.woff2 +0 -0
  224. package/dist/cli/ui/.next/static/media/eafabf029ad39a43-s.p.woff2 +0 -0
  225. package/dist/cli/ui/.next/static/media/f10b8e9d91f3edcb-s.woff2 +0 -0
  226. package/dist/cli/ui/.next/static/media/fe0777f1195381cb-s.woff2 +0 -0
  227. package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_buildManifest.js +1 -0
  228. package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_ssgManifest.js +1 -0
  229. package/dist/cli/ui/next.config.js +1 -0
  230. package/dist/cli/ui/package.json +4 -0
  231. package/dist/core/index.d.ts +34 -391
  232. package/dist/core/index.js +112 -338
  233. package/dist/core/index.js.map +1 -1
  234. package/dist/core/server.d.ts +135 -0
  235. package/dist/core/server.js +707 -0
  236. package/dist/core/server.js.map +1 -0
  237. package/dist/query-builder-KXz9cPzF.d.ts +330 -0
  238. package/package.json +31 -10
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9058],{9058:(t,e,a)=>{a.d(e,{diagram:()=>K});var i,r=a(55230);a(32131),a(55702),a(1931),a(67766),a(1152),a(70768),a(17355),a(25521),a(17395);var d=a(24192),n=a(66638),s=a(3447),o=a(19859),g=a(70317),l=a(65843),p=(0,s.K2)(t=>t.append("circle").attr("class","start-state").attr("r",(0,n.D7)().state.sizeUnit).attr("cx",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit).attr("cy",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit),"drawStartState"),h=(0,s.K2)(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,n.D7)().state.textHeight).attr("class","divider").attr("x2",2*(0,n.D7)().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),c=(0,s.K2)((t,e)=>{let a=t.append("text").attr("x",2*(0,n.D7)().state.padding).attr("y",(0,n.D7)().state.textHeight+2*(0,n.D7)().state.padding).attr("font-size",(0,n.D7)().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,n.D7)().state.padding).attr("y",(0,n.D7)().state.padding).attr("width",i.width+2*(0,n.D7)().state.padding).attr("height",i.height+2*(0,n.D7)().state.padding).attr("rx",(0,n.D7)().state.radius),a},"drawSimpleState"),x=(0,s.K2)((t,e)=>{let a=(0,s.K2)(function(t,e,a){let i=t.append("tspan").attr("x",2*(0,n.D7)().state.padding).text(e);a||i.attr("dy",(0,n.D7)().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*(0,n.D7)().state.padding).attr("y",(0,n.D7)().state.textHeight+1.3*(0,n.D7)().state.padding).attr("font-size",(0,n.D7)().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),r=i.height,d=t.append("text").attr("x",(0,n.D7)().state.padding).attr("y",r+.4*(0,n.D7)().state.padding+(0,n.D7)().state.dividerMargin+(0,n.D7)().state.textHeight).attr("class","state-description"),o=!0,g=!0;e.descriptions.forEach(function(t){o||(a(d,t,g),g=!1),o=!1});let l=t.append("line").attr("x1",(0,n.D7)().state.padding).attr("y1",(0,n.D7)().state.padding+r+(0,n.D7)().state.dividerMargin/2).attr("y2",(0,n.D7)().state.padding+r+(0,n.D7)().state.dividerMargin/2).attr("class","descr-divider"),p=d.node().getBBox(),h=Math.max(p.width,i.width);return l.attr("x2",h+3*(0,n.D7)().state.padding),t.insert("rect",":first-child").attr("x",(0,n.D7)().state.padding).attr("y",(0,n.D7)().state.padding).attr("width",h+2*(0,n.D7)().state.padding).attr("height",p.height+r+2*(0,n.D7)().state.padding).attr("rx",(0,n.D7)().state.radius),t},"drawDescrState"),D=(0,s.K2)((t,e,a)=>{let i,r=(0,n.D7)().state.padding,d=2*(0,n.D7)().state.padding,s=t.node().getBBox(),o=s.width,g=s.x,l=t.append("text").attr("x",0).attr("y",(0,n.D7)().state.titleShift).attr("font-size",(0,n.D7)().state.fontSize).attr("class","state-title").text(e.id),p=l.node().getBBox().width+d,h=Math.max(p,o);h===o&&(h+=d);let c=t.node().getBBox();e.doc,i=g-r,p>o&&(i=(o-h)/2+r),Math.abs(g-c.x)<r&&p>o&&(i=g-(p-o)/2);let x=1-(0,n.D7)().state.textHeight;return t.insert("rect",":first-child").attr("x",i).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",c.height+(0,n.D7)().state.textHeight+(0,n.D7)().state.titleShift+1).attr("rx","0"),l.attr("x",i+r),p<=o&&l.attr("x",g+(h-d)/2-p/2+r),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.D7)().state.titleShift-(0,n.D7)().state.textHeight-(0,n.D7)().state.padding).attr("width",h).attr("height",3*(0,n.D7)().state.textHeight).attr("rx",(0,n.D7)().state.radius),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.D7)().state.titleShift-(0,n.D7)().state.textHeight-(0,n.D7)().state.padding).attr("width",h).attr("height",c.height+3+2*(0,n.D7)().state.textHeight).attr("rx",(0,n.D7)().state.radius),t},"addTitleAndBox"),u=(0,s.K2)(t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,n.D7)().state.sizeUnit+(0,n.D7)().state.miniPadding).attr("cx",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit+(0,n.D7)().state.miniPadding).attr("cy",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit+(0,n.D7)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,n.D7)().state.sizeUnit).attr("cx",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit+2).attr("cy",(0,n.D7)().state.padding+(0,n.D7)().state.sizeUnit+2)),"drawEndState"),f=(0,s.K2)((t,e)=>{let a=(0,n.D7)().state.forkWidth,i=(0,n.D7)().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",(0,n.D7)().state.padding).attr("y",(0,n.D7)().state.padding)},"drawForkJoinState"),y=(0,s.K2)((t,e,a,i)=>{let r=0,d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>"),o=(s=s.replace(/\n/g,"<br/>")).split(n.Y2.lineBreakRegex),g=1.25*(0,n.D7)().state.noteMargin;for(let t of o){let i=t.trim();if(i.length>0){let t=d.append("tspan");t.text(i),0===g&&(g+=t.node().getBBox().height),r+=g,t.attr("x",e+(0,n.D7)().state.noteMargin),t.attr("y",a+r+1.25*(0,n.D7)().state.noteMargin)}}return{textWidth:d.node().getBBox().width,textHeight:r}},"_drawLongText"),w=(0,s.K2)((t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,n.D7)().state.padding),{textWidth:i,textHeight:r}=y(t,0,0,e.append("g"));return a.attr("height",r+2*(0,n.D7)().state.noteMargin),a.attr("width",i+2*(0,n.D7)().state.noteMargin),a},"drawNote"),m=(0,s.K2)(function(t,e){let a=e.id,i={id:a,label:e.id,width:0,height:0},r=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&p(r),"end"===e.type&&u(r),("fork"===e.type||"join"===e.type)&&f(r,e),"note"===e.type&&w(e.note.text,r),"divider"===e.type&&h(r),"default"===e.type&&0===e.descriptions.length&&c(r,e),"default"===e.type&&e.descriptions.length>0&&x(r,e);let d=r.node().getBBox();return i.width=d.width+2*(0,n.D7)().state.padding,i.height=d.height+2*(0,n.D7)().state.padding,i},"drawState"),b=0,B=(0,s.K2)(function(t,e,a){let i=(0,s.K2)(function(t){switch(t){case r.u4.relationType.AGGREGATION:return"aggregation";case r.u4.relationType.EXTENSION:return"extension";case r.u4.relationType.COMPOSITION:return"composition";case r.u4.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));let g=e.points,l=(0,o.n8j)().x(function(t){return t.x}).y(function(t){return t.y}).curve(o.qrM),p=t.append("path").attr("d",l(g)).attr("id","edge"+b).attr("class","transition"),h="";if((0,n.D7)().state.arrowMarkerAbsolute&&(h=(0,n.ID)(!0)),p.attr("marker-end","url("+h+"#"+i(r.u4.relationType.DEPENDENCY)+"End)"),void 0!==a.title){let i=t.append("g").attr("class","stateLabel"),{x:r,y:o}=d._K.calcLabelPosition(e.points),g=n.Y2.getRows(a.title),l=0,p=[],h=0,c=0;for(let t=0;t<=g.length;t++){let e=i.append("text").attr("text-anchor","middle").text(g[t]).attr("x",r).attr("y",o+l),a=e.node().getBBox();h=Math.max(h,a.width),c=Math.min(c,a.x),s.Rm.info(a.x,r,o+l),0===l&&(l=e.node().getBBox().height,s.Rm.info("Title height",l,o)),p.push(e)}let x=l*g.length;if(g.length>1){let t=(g.length-1)*l*.5;p.forEach((e,a)=>e.attr("y",o+a*l-t)),x=l*g.length}let D=i.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",r-h/2-(0,n.D7)().state.padding/2).attr("y",o-x/2-(0,n.D7)().state.padding/2-3.5).attr("width",h+(0,n.D7)().state.padding).attr("height",x+(0,n.D7)().state.padding),s.Rm.info(D)}b++},"drawEdge"),k={},N=(0,s.K2)(function(){},"setConf"),E=(0,s.K2)(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),S=(0,s.K2)(function(t,e,a,r){let d;i=(0,n.D7)().state;let g=(0,n.D7)().securityLevel;"sandbox"===g&&(d=(0,o.Ltv)("#i"+e));let l="sandbox"===g?(0,o.Ltv)(d.nodes()[0].contentDocument.body):(0,o.Ltv)("body"),p="sandbox"===g?d.nodes()[0].contentDocument:document;s.Rm.debug("Rendering diagram "+t);let h=l.select(`[id='${e}']`);E(h),v(r.db.getRootDoc(),h,void 0,!1,l,p,r);let c=i.padding,x=h.node().getBBox(),D=x.width+2*c,u=x.height+2*c;(0,n.a$)(h,u,1.75*D,i.useMaxWidth),h.attr("viewBox",`${x.x-i.padding} ${x.y-i.padding} `+D+" "+u)},"draw"),M=(0,s.K2)(t=>t?t.length*i.fontSizeFactor:1,"getLabelWidth"),v=(0,s.K2)((t,e,a,r,d,o,p)=>{let h,c=new l.T({compound:!0,multigraph:!0}),x=!0;for(h=0;h<t.length;h++)if("relation"===t[h].stmt){x=!1;break}a?c.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:i.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):c.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:i.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),c.setDefaultEdgeLabel(function(){return{}});let u=p.db.getStates(),f=p.db.getRelations();for(let t of Object.keys(u)){let n,s=u[t];if(a&&(s.parentId=a),s.doc){let t=e.append("g").attr("id",s.id).attr("class","stateGroup");n=v(s.doc,t,s.id,!r,d,o,p);{let e=(t=D(t,s,r)).node().getBBox();n.width=e.width,n.height=e.height+i.padding/2,k[s.id]={y:i.compositTitleSize}}}else n=m(e,s,c);if(s.note){let t=m(e,{descriptions:[],id:s.id+"-note",note:s.note,type:"note"},c);"left of"===s.note.position?(c.setNode(n.id+"-note",t),c.setNode(n.id,n)):(c.setNode(n.id,n),c.setNode(n.id+"-note",t)),c.setParent(n.id,n.id+"-group"),c.setParent(n.id+"-note",n.id+"-group")}else c.setNode(n.id,n)}s.Rm.debug("Count=",c.nodeCount(),c);let y=0;f.forEach(function(t){y++,s.Rm.debug("Setting edge",t),c.setEdge(t.id1,t.id2,{relation:t,width:M(t.title),height:i.labelHeight*n.Y2.getRows(t.title).length,labelpos:"c"},"id"+y)}),(0,g.Zp)(c),s.Rm.debug("Graph after layout",c.nodes());let w=e.node();c.nodes().forEach(function(t){void 0!==t&&void 0!==c.node(t)?(s.Rm.warn("Node "+t+": "+JSON.stringify(c.node(t))),d.select("#"+w.id+" #"+t).attr("transform","translate("+(c.node(t).x-c.node(t).width/2)+","+(c.node(t).y+(k[t]?k[t].y:0)-c.node(t).height/2)+" )"),d.select("#"+w.id+" #"+t).attr("data-x-shift",c.node(t).x-c.node(t).width/2),o.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach(t=>{let e=t.parentElement,a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(i=parseInt(e.getAttribute("data-x-shift"),10))&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)})):s.Rm.debug("No Node "+t+": "+JSON.stringify(c.node(t)))});let b=w.getBBox();c.edges().forEach(function(t){void 0!==t&&void 0!==c.edge(t)&&(s.Rm.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(c.edge(t))),B(e,c.edge(t),c.edge(t).relation))});let N={id:a||"root",label:a||"root",width:0,height:0};return N.width=(b=w.getBBox()).width+2*i.padding,N.height=b.height+2*i.padding,s.Rm.debug("Doc rendered",N,c),N},"renderDoc"),K={parser:r.Zk,get db(){return new r.u4(1)},renderer:{setConf:N,draw:S},styles:r.tM,init:(0,s.K2)(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9211],{69211:(t,i,e)=>{e.d(i,{diagram:()=>ti});var s,a=e(29756),n=e(17395),h=e(24192),o=e(66638),r=e(3447),l=e(19859),c=function(){var t=(0,r.K2)(function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],n=[1,6],h=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],c=[1,26],g=[1,28],u=[1,29],x=[1,30],d=[1,31],p=[1,32],f=[1,33],y=[1,34],m=[1,35],b=[1,36],A=[1,37],S=[1,43],w=[1,42],C=[1,47],k=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],T=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],L={trace:(0,r.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:(0,r.K2)(function(t,i,e,s,a,n,h){var o=n.length-1;switch(a){case 5:s.setOrientation(n[o]);break;case 9:s.setDiagramTitle(n[o].text.trim());break;case 12:s.setLineData({text:"",type:"text"},n[o]);break;case 13:s.setLineData(n[o-1],n[o]);break;case 14:s.setBarData({text:"",type:"text"},n[o]);break;case 15:s.setBarData(n[o-1],n[o]);break;case 16:this.$=n[o].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=n[o].trim(),s.setAccDescription(this.$);break;case 19:case 27:this.$=n[o-1];break;case 20:this.$=[Number(n[o-2]),...n[o]];break;case 21:this.$=[Number(n[o])];break;case 22:s.setXAxisTitle(n[o]);break;case 23:s.setXAxisTitle(n[o-1]);break;case 24:s.setXAxisTitle({type:"text",text:""});break;case 25:s.setXAxisBand(n[o]);break;case 26:s.setXAxisRangeData(Number(n[o-2]),Number(n[o]));break;case 28:this.$=[n[o-2],...n[o]];break;case 29:this.$=[n[o]];break;case 30:s.setYAxisTitle(n[o]);break;case 31:s.setYAxisTitle(n[o-1]);break;case 32:s.setYAxisTitle({type:"text",text:""});break;case 33:s.setYAxisRangeData(Number(n[o-2]),Number(n[o]));break;case 37:case 38:this.$={text:n[o],type:"text"};break;case 39:this.$={text:n[o],type:"markdown"};break;case 40:this.$=n[o];break;case 41:this.$=n[o-1]+""+n[o]}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:a,35:n,36:h}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:a,35:n,36:h}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:n,36:h}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:a,35:n,36:h}),{1:[2,3]},t(o,[2,5]),t(i,[2,7],{4:22,34:a,35:n,36:h}),{11:23,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},{11:39,13:38,24:S,27:w,29:40,30:41,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},{11:45,15:44,27:C,33:46,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},{11:49,17:48,24:k,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},{11:52,17:51,24:k,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(T,[2,37],{40:55,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A}),t(T,[2,38]),t(T,[2,39]),t(R,[2,40]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:S,27:w}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},t(_,[2,11]),t(_,[2,30],{33:60,27:C}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:k},{25:63,27:D},t(_,[2,14]),{17:65,24:k},t(_,[2,16]),t(_,[2,17]),t(R,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:c,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:y,48:m,49:b,50:A},t(_,[2,33]),t(_,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:(0,r.K2)(function(t,i){if(i.recoverable)this.trace(t);else{var e=Error(t);throw e.hash=i,e}},"parseError"),parse:(0,r.K2)(function(t){var i=this,e=[0],s=[],a=[null],n=[],h=this.table,o="",l=0,c=0,g=0,u=n.slice.call(arguments,1),x=Object.create(this.lexer),d={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d[p]=this.yy[p]);x.setInput(t,d),d.lexer=x,d.parser=this,void 0===x.yylloc&&(x.yylloc={});var f=x.yylloc;n.push(f);var y=x.options&&x.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||x.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof d.parseError?this.parseError=d.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K2)(function(t){e.length=e.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),(0,r.K2)(m,"lex");for(var b,A,S,w,C,k,_,T,R,D={};;){if(S=e[e.length-1],this.defaultActions[S]?w=this.defaultActions[S]:(null==b&&(b=m()),w=h[S]&&h[S][b]),void 0===w||!w.length||!w[0]){var L="";for(k in R=[],h[S])this.terminals_[k]&&k>2&&R.push("'"+this.terminals_[k]+"'");L=x.showPosition?"Parse error on line "+(l+1)+":\n"+x.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(L,{text:x.match,token:this.terminals_[b]||b,line:x.yylineno,loc:f,expected:R})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+S+", token: "+b);switch(w[0]){case 1:e.push(b),a.push(x.yytext),n.push(x.yylloc),e.push(w[1]),b=null,A?(b=A,A=null):(c=x.yyleng,o=x.yytext,l=x.yylineno,f=x.yylloc,g>0&&g--);break;case 2:if(_=this.productions_[w[1]][1],D.$=a[a.length-_],D._$={first_line:n[n.length-(_||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(_||1)].first_column,last_column:n[n.length-1].last_column},y&&(D._$.range=[n[n.length-(_||1)].range[0],n[n.length-1].range[1]]),void 0!==(C=this.performAction.apply(D,[o,c,l,d,w[1],a,n].concat(u))))return C;_&&(e=e.slice(0,-1*_*2),a=a.slice(0,-1*_),n=n.slice(0,-1*_)),e.push(this.productions_[w[1]][0]),a.push(D.$),n.push(D._$),T=h[e[e.length-2]][e[e.length-1]],e.push(T);break;case 3:return!0}}return!0},"parse")};function P(){this.yy={}}return L.lexer={EOF:1,parseError:(0,r.K2)(function(t,i){if(this.yy.parser)this.yy.parser.parseError(t,i);else throw Error(t)},"parseError"),setInput:(0,r.K2)(function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,r.K2)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,r.K2)(function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K2)(function(){return this._more=!0,this},"more"),reject:(0,r.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,r.K2)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K2)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,r.K2)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,r.K2)(function(){var t=this.pastInput(),i=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:(0,r.K2)(function(t,i){var e,s,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack)for(var n in a)this[n]=a[n];return!1},"test_match"),next:(0,r.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,i,e,s,a=this._currentRules(),n=0;n<a.length;n++)if((e=this._input.match(this.rules[a[n]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,a[n])))return t;if(!this._backtrack)return!1;i=!1;continue}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,a[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,r.K2)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K2)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,r.K2)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K2)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K2)(function(t,i,e,s){switch(e){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}},(0,r.K2)(P,"Parser"),P.prototype=L,L.Parser=P,new P}();function g(t){return"bar"===t.type}function u(t){return"band"===t.type}function x(t){return"linear"===t.type}c.parser=c,(0,r.K2)(g,"isBarPlot"),(0,r.K2)(u,"isBandAxisData"),(0,r.K2)(x,"isLinearAxisData");var d=class{constructor(t){this.parentGroup=t}static{(0,r.K2)(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};let e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of t){let t=(0,n.W6)(s,1,a),h=t?t.width:a.length*i,o=t?t.height:i;e.width=Math.max(e.width,h),e.height=Math.max(e.height,o)}return s.remove(),e}},p=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{(0,r.K2)(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){let t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let e=this.getLabelDimension(),s=.2*t.width;this.outerPadding=Math.min(e.width/2,s);let a=e.height+2*this.axisConfig.labelPadding;this.labelTextHeight=e.height,a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let e=this.getLabelDimension(),s=.2*t.height;this.outerPadding=Math.min(e.height/2,s);let a=e.width+2*this.axisConfig.labelPadding;a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},f=class extends p{static{(0,r.K2)(this,"BandAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.categories=e,this.scale=(0,l.WH)().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=(0,l.WH)().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),r.Rm.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},y=class extends p{static{(0,r.K2)(this,"LinearAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.domain=e,this.scale=(0,l.m4Y)().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=(0,l.m4Y)().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function m(t,i,e,s){let a=new d(s);return u(t)?new f(i,e,t.categories,t.title,a):new y(i,e,[t.min,t.max],t.title,a)}(0,r.K2)(m,"getAxis");var b=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{(0,r.K2)(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function A(t,i,e,s){return new b(new d(s),t,i,e)}(0,r.K2)(A,"getChartTitleComponent");var S=class{constructor(t,i,e,s,a){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=a}static{(0,r.K2)(this,"LinePlot")}getDrawableElement(){let t,i=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);return(t="horizontal"===this.orientation?(0,l.n8j)().y(t=>t[0]).x(t=>t[1])(i):(0,l.n8j)().x(t=>t[0]).y(t=>t[1])(i))?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},w=class{constructor(t,i,e,s,a,n){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=n}static{(0,r.K2)(this,"BarPlot")}getDrawableElement(){let t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),e=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-e,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-e,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},C=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{(0,r.K2)(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let t=[];for(let[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{let s=new S(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{let s=new w(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}}return t}};function k(t,i,e){return new C(t,i,e)}(0,r.K2)(k,"getPlotComponent");var _=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:A(t,i,e,s),plot:k(t,i,e),xAxis:m(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:m(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{(0,r.K2)(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),n=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:a,height:n});t-=h.width,i-=h.height,s=(h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i})).height,i-=h.height,this.componentStore.xAxis.setAxisPosition("bottom"),h=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=h.height,this.componentStore.yAxis.setAxisPosition("left"),e=(h=this.componentStore.yAxis.calculateSpace({width:t,height:i})).width,(t-=h.width)>0&&(a+=t,t=0),i>0&&(n+=i,i=0),this.componentStore.plot.calculateSpace({width:a,height:n}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+a]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+n}),this.componentStore.yAxis.setRange([s,s+n]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(t=>g(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),h=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:n,height:h});t-=o.width,i-=o.height,e=(o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i})).height,i-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=o.width,s=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=o.height,a=e+o.height,t>0&&(n+=t,t=0),i>0&&(h+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:h}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.yAxis.setRange([s,s+n]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([a,a+h]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(t=>g(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let t=[];for(let i of(this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis),Object.values(this.componentStore)))t.push(...i.getDrawableElements());return t}},T=class{static{(0,r.K2)(this,"XYChartBuilder")}static build(t,i,e,s){return new _(t,i,e,s).getDrawableElement()}},R=0,D=$(),L=I(),P=M(),E=L.plotColorPalette.split(",").map(t=>t.trim()),K=!1,v=!1;function I(){let t=(0,o.P$)(),i=(0,o.zj)();return(0,h.$t)(t.xyChart,i.themeVariables.xyChart)}function $(){let t=(0,o.zj)();return(0,h.$t)(o.UI.xyChart,t.xyChart)}function M(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function z(t){let i=(0,o.zj)();return(0,o.jZ)(t.trim(),i)}function B(t){s=t}function W(t){"horizontal"===t?D.chartOrientation="horizontal":D.chartOrientation="vertical"}function O(t){P.xAxis.title=z(t.text)}function F(t,i){P.xAxis={type:"linear",title:P.xAxis.title,min:t,max:i},K=!0}function N(t){P.xAxis={type:"band",title:P.xAxis.title,categories:t.map(t=>z(t.text))},K=!0}function V(t){P.yAxis.title=z(t.text)}function X(t,i){P.yAxis={type:"linear",title:P.yAxis.title,min:t,max:i},v=!0}function Y(t){let i=Math.min(...t),e=Math.max(...t),s=x(P.yAxis)?P.yAxis.min:1/0,a=x(P.yAxis)?P.yAxis.max:-1/0;P.yAxis={type:"linear",title:P.yAxis.title,min:Math.min(s,i),max:Math.max(a,e)}}function H(t){let i=[];if(0===t.length)return i;if(K||F(Math.min(x(P.xAxis)?P.xAxis.min:1/0,1),Math.max(x(P.xAxis)?P.xAxis.max:-1/0,t.length)),v||Y(t),u(P.xAxis)&&(i=P.xAxis.categories.map((i,e)=>[i,t[e]])),x(P.xAxis)){let e=P.xAxis.min,s=P.xAxis.max,a=(s-e)/(t.length-1),n=[];for(let t=e;t<=s;t+=a)n.push(`${t}`);i=n.map((i,e)=>[i,t[e]])}return i}function U(t){return E[0===t?0:t%E.length]}function j(t,i){let e=H(i);P.plots.push({type:"line",strokeFill:U(R),strokeWidth:2,data:e}),R++}function G(t,i){let e=H(i);P.plots.push({type:"bar",fill:U(R),data:e}),R++}function Q(){if(0===P.plots.length)throw Error("No Plot to render, please provide a plot with some data");return P.title=(0,o.ab)(),T.build(D,P,L,s)}function Z(){return L}function q(){return D}function J(){return P}(0,r.K2)(I,"getChartDefaultThemeConfig"),(0,r.K2)($,"getChartDefaultConfig"),(0,r.K2)(M,"getChartDefaultData"),(0,r.K2)(z,"textSanitizer"),(0,r.K2)(B,"setTmpSVGG"),(0,r.K2)(W,"setOrientation"),(0,r.K2)(O,"setXAxisTitle"),(0,r.K2)(F,"setXAxisRangeData"),(0,r.K2)(N,"setXAxisBand"),(0,r.K2)(V,"setYAxisTitle"),(0,r.K2)(X,"setYAxisRangeData"),(0,r.K2)(Y,"setYAxisRangeFromPlotData"),(0,r.K2)(H,"transformDataWithoutCategory"),(0,r.K2)(U,"getPlotColorFromPalette"),(0,r.K2)(j,"setLineData"),(0,r.K2)(G,"setBarData"),(0,r.K2)(Q,"getDrawableElem"),(0,r.K2)(Z,"getChartThemeConfig"),(0,r.K2)(q,"getChartConfig"),(0,r.K2)(J,"getXYChartData");var tt={getDrawableElem:Q,clear:(0,r.K2)(function(){(0,o.IU)(),R=0,D=$(),P=M(),E=(L=I()).plotColorPalette.split(",").map(t=>t.trim()),K=!1,v=!1},"clear"),setAccTitle:o.SV,getAccTitle:o.iN,setDiagramTitle:o.ke,getDiagramTitle:o.ab,getAccDescription:o.m7,setAccDescription:o.EI,setOrientation:W,setXAxisTitle:O,setXAxisRangeData:F,setXAxisBand:N,setYAxisTitle:V,setYAxisRangeData:X,setLineData:j,setBarData:G,setTmpSVGG:B,getChartThemeConfig:Z,getChartConfig:q,getXYChartData:J},ti={parser:c,db:tt,renderer:{draw:(0,r.K2)((t,i,e,s)=>{let n=s.db,h=n.getChartThemeConfig(),l=n.getChartConfig(),c=n.getXYChartData().plots[0].data.map(t=>t[1]);function g(t){return"top"===t?"text-before-edge":"middle"}function u(t){return"left"===t?"start":"right"===t?"end":"middle"}function x(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}(0,r.K2)(g,"getDominantBaseLine"),(0,r.K2)(u,"getTextAnchor"),(0,r.K2)(x,"getTextTransformation"),r.Rm.debug("Rendering xychart chart\n"+t);let d=(0,a.D)(i),p=d.append("g").attr("class","main"),f=p.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");(0,o.a$)(d,l.height,l.width,!0),d.attr("viewBox",`0 0 ${l.width} ${l.height}`),f.attr("fill",h.backgroundColor),n.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));let y=n.getDrawableElem(),m={};function b(t){let i=p,e="";for(let[s]of t.entries()){let a=p;s>0&&m[e]&&(a=m[e]),e+=t[s],(i=m[e])||(i=m[e]=a.append("g").attr("class",t[s]))}return i}for(let t of((0,r.K2)(b,"getGroup"),y)){if(0===t.data.length)continue;let i=b(t.groupTexts);switch(t.type){case"rect":if(i.selectAll("rect").data(t.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),l.showDataLabel)if("horizontal"===l.chartOrientation){let e=function(t,i){let{data:e,label:a}=t;return i*a.length*s<=e.width-10};(0,r.K2)(e,"fitsHorizontally");let s=.7,a=t.data.map((t,i)=>({data:t,label:c[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),n=Math.floor(Math.min(...a.map(t=>{let{data:i}=t,s=.7*i.height;for(;!e(t,s)&&s>0;)s-=1;return s})));i.selectAll("text").data(a).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${n}px`).text(t=>t.label)}else{let e=function(t,i,e){let{data:s,label:a}=t,n=i*a.length*.7,h=s.x+s.width/2,o=h-n/2,r=h+n/2,l=o>=s.x&&r<=s.x+s.width,c=s.y+e+i<=s.y+s.height;return l&&c};(0,r.K2)(e,"fitsInBar");let s=t.data.map((t,i)=>({data:t,label:c[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),a=Math.floor(Math.min(...s.map(t=>{let{data:i,label:s}=t,a=i.width/(.7*s.length);for(;!e(t,a,10)&&a>0;)a-=1;return a})));i.selectAll("text").data(s).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+10).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${a}px`).text(t=>t.label)}break;case"text":i.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>g(t.verticalPos)).attr("text-anchor",t=>u(t.horizontalPos)).attr("transform",t=>x(t)).text(t=>t.text);break;case"path":i.selectAll("path").data(t.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9690],{99690:(r,e,s)=>{s.d(e,{diagram:()=>l});var a=s(57664);s(75711),s(32131),s(55702),s(1931),s(67766),s(1152),s(70768),s(17355),s(25521),s(17395),s(24192),s(66638);var t=s(3447),l={parser:a._$,get db(){return new a.NM},renderer:a.Lh,styles:a.tM,init:(0,t.K2)(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")}}}]);
@@ -0,0 +1,93 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9919],{9919:(t,e,i)=>{i.d(e,{diagram:()=>A});var n=i(29756),s=i(75711),r=i(83423),o=i(70768);i(17355),i(25521),i(17395),i(24192);var a=i(66638),l=i(3447),c=i(58830),h=i(19697),u=i(74961),g=function(){var t=(0,l.K2)(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),e=[1,4],i=[1,13],n=[1,12],s=[1,15],r=[1,16],o=[1,20],a=[1,19],c=[6,7,8],h=[1,26],u=[1,24],g=[1,25],d=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],b=[1,36],_=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:(0,l.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:(0,l.K2)(function(t,e,i,n,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",r[a-1].id),n.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:n.getLogger().info("Node: ",r[a].id),n.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:n.getLogger().trace("Icon: ",r[a]),n.decorateNode({icon:r[a]});break;case 18:case 23:n.decorateNode({class:r[a]});break;case 19:n.getLogger().trace("SPACELIST");break;case 20:n.getLogger().trace("Node: ",r[a-1].id),n.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:n.getLogger().trace("Node: ",r[a].id),n.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:n.decorateNode({icon:r[a]});break;case 27:n.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:n.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:n.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:n.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:n,14:14,16:s,17:r,18:17,19:18,20:o,23:a},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:i,12:21,13:n,14:14,16:s,17:r,18:17,19:18,20:o,23:a},{6:i,9:22,12:11,13:n,14:14,16:s,17:r,18:17,19:18,20:o,23:a},{6:h,7:u,10:23,11:g},t(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:a}),t(d,[2,19]),t(d,[2,21],{15:30,24:p}),t(d,[2,22]),t(d,[2,23]),t(y,[2,25]),t(y,[2,26]),t(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:g},{1:[2,7],6:i,12:21,13:n,14:14,16:s,17:r,18:17,19:18,20:o,23:a},t(f,[2,14],{7:m,11:b}),t(_,[2,8]),t(_,[2,9]),t(_,[2,10]),t(d,[2,16],{15:37,24:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,20],{24:k}),t(y,[2,31]),{21:[1,39]},{22:[1,40]},t(f,[2,13],{7:m,11:b}),t(_,[2,11]),t(_,[2,12]),t(d,[2,15],{24:k}),t(y,[2,30]),{22:[1,41]},t(y,[2,27]),t(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,l.K2)(function(t,e){if(e.recoverable)this.trace(t);else{var i=Error(t);throw i.hash=e,i}},"parseError"),parse:(0,l.K2)(function(t){var e=this,i=[0],n=[],s=[null],r=[],o=this.table,a="",c=0,h=0,u=0,g=r.slice.call(arguments,1),d=Object.create(this.lexer),p={};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p[y]=this.yy[y]);d.setInput(t,p),p.lexer=d,p.parser=this,void 0===d.yylloc&&(d.yylloc={});var f=d.yylloc;r.push(f);var m=d.options&&d.options.ranges;function b(){var t;return"number"!=typeof(t=n.pop()||d.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.parseError?this.parseError=p.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,l.K2)(function(t){i.length=i.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),(0,l.K2)(b,"lex");for(var _,k,E,S,N,x,D,L,I,v={};;){if(E=i[i.length-1],this.defaultActions[E]?S=this.defaultActions[E]:(null==_&&(_=b()),S=o[E]&&o[E][_]),void 0===S||!S.length||!S[0]){var C="";for(x in I=[],o[E])this.terminals_[x]&&x>2&&I.push("'"+this.terminals_[x]+"'");C=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:f,expected:I})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+E+", token: "+_);switch(S[0]){case 1:i.push(_),s.push(d.yytext),r.push(d.yylloc),i.push(S[1]),_=null,k?(_=k,k=null):(h=d.yyleng,a=d.yytext,c=d.yylineno,f=d.yylloc,u>0&&u--);break;case 2:if(D=this.productions_[S[1]][1],v.$=s[s.length-D],v._$={first_line:r[r.length-(D||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(D||1)].first_column,last_column:r[r.length-1].last_column},m&&(v._$.range=[r[r.length-(D||1)].range[0],r[r.length-1].range[1]]),void 0!==(N=this.performAction.apply(v,[a,h,c,p,S[1],s,r].concat(g))))return N;D&&(i=i.slice(0,-1*D*2),s=s.slice(0,-1*D),r=r.slice(0,-1*D)),i.push(this.productions_[S[1]][0]),s.push(v.$),r.push(v._$),L=o[i[i.length-2]][i[i.length-1]],i.push(L);break;case 3:return!0}}return!0},"parse")};function S(){this.yy={}}return E.lexer={EOF:1,parseError:(0,l.K2)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,l.K2)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,l.K2)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,l.K2)(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,l.K2)(function(){return this._more=!0,this},"more"),reject:(0,l.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,l.K2)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,l.K2)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,l.K2)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,l.K2)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,l.K2)(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack)for(var r in s)this[r]=s[r];return!1},"test_match"),next:(0,l.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,i,n,s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,l.K2)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,l.K2)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,l.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,l.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,l.K2)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,l.K2)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,l.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,l.K2)(function(t,e,i,n){switch(i){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:return e.yytext=e.yytext.replace(/\n\s*/g,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}},(0,l.K2)(S,"Parser"),S.prototype=E,E.Parser=S,new S}();g.parser=g;var d=[],p=[],y=0,f={},m=(0,l.K2)(()=>{d=[],p=[],y=0,f={}},"clear"),b=(0,l.K2)(t=>{if(0===d.length)return null;let e=d[0].level,i=null;for(let t=d.length-1;t>=0;t--)if(d[t].level!==e||i||(i=d[t]),d[t].level<e)throw Error('Items without section detected, found section ("'+d[t].label+'")');return t===i?.level?null:i},"getSection"),_=(0,l.K2)(function(){return p},"getSections"),k=(0,l.K2)(function(){let t=[],e=_(),i=(0,a.D7)();for(let n of e){let e={id:n.id,label:(0,a.jZ)(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};for(let s of(t.push(e),d.filter(t=>t.parentId===n.id))){let e={id:s.id,parentId:n.id,label:(0,a.jZ)(s.label??"",i),isGroup:!1,ticket:s?.ticket,priority:s?.priority,assigned:s?.assigned,icon:s?.icon,shape:"kanbanItem",level:s.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:(0,a.D7)()}},"getData"),E=(0,l.K2)((t,e,i,n,s)=>{let o=(0,a.D7)(),l=o.mindmap?.padding??a.UI.mindmap.padding;switch(n){case S.ROUNDED_RECT:case S.RECT:case S.HEXAGON:l*=2}let c={id:(0,a.jZ)(e,o)||"kbn"+y++,level:t,label:(0,a.jZ)(i,o),width:o.mindmap?.maxNodeWidth??a.UI.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}";let e=(0,r.H)(t,{schema:r.r});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(c.shape=e?.shape),e?.label&&(c.label=e?.label),e?.icon&&(c.icon=e?.icon.toString()),e?.assigned&&(c.assigned=e?.assigned.toString()),e?.ticket&&(c.ticket=e?.ticket.toString()),e?.priority&&(c.priority=e?.priority)}let h=b(t);h?c.parentId=h.id||"kbn"+y++:p.push(c),d.push(c)},"addNode"),S={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},N=(0,l.K2)((t,e)=>{switch(l.Rm.debug("In get type",t,e),t){case"[":return S.RECT;case"(":return")"===e?S.ROUNDED_RECT:S.CLOUD;case"((":return S.CIRCLE;case")":return S.CLOUD;case"))":return S.BANG;case"{{":return S.HEXAGON;default:return S.DEFAULT}},"getType"),x=(0,l.K2)((t,e)=>{f[t]=e},"setElementForId"),D=(0,l.K2)(t=>{if(!t)return;let e=(0,a.D7)(),i=d[d.length-1];t.icon&&(i.icon=(0,a.jZ)(t.icon,e)),t.class&&(i.cssClasses=(0,a.jZ)(t.class,e))},"decorateNode"),L=(0,l.K2)(t=>{switch(t){case S.DEFAULT:return"no-border";case S.RECT:return"rect";case S.ROUNDED_RECT:return"rounded-rect";case S.CIRCLE:return"circle";case S.CLOUD:return"cloud";case S.BANG:return"bang";case S.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),I=(0,l.K2)(()=>l.Rm,"getLogger"),v=(0,l.K2)(t=>f[t],"getElementById"),C=(0,l.K2)(async(t,e,i,s)=>{l.Rm.debug("Rendering kanban diagram\n"+t);let r=s.db.getData(),c=(0,a.D7)();c.htmlLabels=!1;let h=(0,n.D)(e),u=h.append("g");u.attr("class","sections");let g=h.append("g");g.attr("class","items");let d=r.nodes.filter(t=>t.isGroup),p=0,y=[],f=25;for(let t of d){let e=c?.kanban?.sectionWidth||200;t.x=e*(p+=1)+(p-1)*10/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+p;let i=await (0,o.U)(u,t);f=Math.max(f,i?.labelBBox?.height),y.push(i)}let m=0;for(let t of d){let e=y[m];m+=1;let i=c?.kanban?.sectionWidth||200,n=-(3*i)/2+f,s=n;for(let e of r.nodes.filter(e=>e.parentId===t.id)){if(e.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=i-15;let n=(await (0,o.on)(g,e,{config:c})).node().getBBox();e.y=s+n.height/2,await (0,o.U_)(e),s=e.y+n.height/2+5}let a=e.cluster.select("rect"),l=Math.max(s-n+30,50)+(f-25);a.attr("height",l)}(0,a.ot)(void 0,h,c.mindmap?.padding??a.UI.kanban.padding,c.mindmap?.useMaxWidth??a.UI.kanban.useMaxWidth)},"draw"),O=(0,l.K2)(t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],(0,c.A)(t["lineColor"+e])?t["lineColor"+e]=(0,h.A)(t["lineColor"+e],20):t["lineColor"+e]=(0,u.A)(t["lineColor"+e],20);let i=(0,l.K2)((e,i)=>t.darkMode?(0,u.A)(e,i):(0,h.A)(e,i),"adjuster");for(let n=0;n<t.THEME_COLOR_LIMIT;n++){let s=""+(17-3*n);e+=`
2
+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
3
+ fill: ${i(t["cScale"+n],10)};
4
+ stroke: ${i(t["cScale"+n],10)};
5
+
6
+ }
7
+ .section-${n-1} text {
8
+ fill: ${t["cScaleLabel"+n]};
9
+ }
10
+ .node-icon-${n-1} {
11
+ font-size: 40px;
12
+ color: ${t["cScaleLabel"+n]};
13
+ }
14
+ .section-edge-${n-1}{
15
+ stroke: ${t["cScale"+n]};
16
+ }
17
+ .edge-depth-${n-1}{
18
+ stroke-width: ${s};
19
+ }
20
+ .section-${n-1} line {
21
+ stroke: ${t["cScaleInv"+n]} ;
22
+ stroke-width: 3;
23
+ }
24
+
25
+ .disabled, .disabled circle, .disabled text {
26
+ fill: lightgray;
27
+ }
28
+ .disabled text {
29
+ fill: #efefef;
30
+ }
31
+
32
+ .node rect,
33
+ .node circle,
34
+ .node ellipse,
35
+ .node polygon,
36
+ .node path {
37
+ fill: ${t.background};
38
+ stroke: ${t.nodeBorder};
39
+ stroke-width: 1px;
40
+ }
41
+
42
+ .kanban-ticket-link {
43
+ fill: ${t.background};
44
+ stroke: ${t.nodeBorder};
45
+ text-decoration: underline;
46
+ }
47
+ `}return e},"genSections"),A={db:{clear:m,addNode:E,getSections:_,getData:k,nodeType:S,getType:N,setElementForId:x,decorateNode:D,type2Str:L,getLogger:I,getElementById:v},renderer:{draw:C},parser:g,styles:(0,l.K2)(t=>`
48
+ .edge {
49
+ stroke-width: 3;
50
+ }
51
+ ${O(t)}
52
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
53
+ fill: ${t.git0};
54
+ }
55
+ .section-root text {
56
+ fill: ${t.gitBranchLabel0};
57
+ }
58
+ .icon-container {
59
+ height:100%;
60
+ display: flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ }
64
+ .edge {
65
+ fill: none;
66
+ }
67
+ .cluster-label, .label {
68
+ color: ${t.textColor};
69
+ fill: ${t.textColor};
70
+ }
71
+ .kanban-label {
72
+ dy: 1em;
73
+ alignment-baseline: middle;
74
+ text-anchor: middle;
75
+ dominant-baseline: middle;
76
+ text-align: center;
77
+ }
78
+ ${(0,s.o)()}
79
+ `,"getStyles")}},75711:(t,e,i)=>{i.d(e,{o:()=>n});var n=(0,i(3447).K2)(()=>`
80
+ /* Font Awesome icon styling - consolidated */
81
+ .label-icon {
82
+ display: inline-block;
83
+ height: 1em;
84
+ overflow: visible;
85
+ vertical-align: -0.125em;
86
+ }
87
+
88
+ .node .label-icon path {
89
+ fill: currentColor;
90
+ stroke: revert;
91
+ stroke-width: revert;
92
+ }
93
+ `,"getIconStyles")}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{43211:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(94799),n=l(92774);function o({status:e,message:t}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:`${e}: ${t}`}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:e}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:t})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53895:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(94799),n=l(43211),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68289:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(53895)}])},92774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[7408,1858,7358],()=>e(e.s=68289)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581,4181,4896,5563,6255,6819,6988,7714,7851,8167],{83093:()=>{}},_=>{_.O(0,[7408,1858,7358],()=>_(_.s=83093)),_N_E=_.O()}]);
@@ -0,0 +1,6 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2091],{3777:(e,t,n)=>{"use strict";n.d(t,{ScrollArea:()=>s});var r=n(94799),a=n(34023),l=n(8249);let s=a.forwardRef(({className:e,children:t,...n},a)=>(0,r.jsx)("div",{ref:a,className:(0,l.cn)("relative overflow-auto",e),...n,children:t}));s.displayName="ScrollArea"},8249:(e,t,n)=>{"use strict";n.d(t,{cn:()=>l,m:()=>o,z:()=>i});var r=n(35176),a=n(34404);function l(...e){return(0,a.QP)((0,r.$)(e))}let s="studio:sidebar-collections";function i(){try{let e=localStorage.getItem(s);if(!e)return[];return JSON.parse(e)}catch{return[]}}function o(e){try{localStorage.setItem(s,JSON.stringify(e))}catch{}}},18349:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,68202,23)),Promise.resolve().then(n.bind(n,52917)),Promise.resolve().then(n.bind(n,3777)),Promise.resolve().then(n.bind(n,38217)),Promise.resolve().then(n.bind(n,42939))},25471:(e,t,n)=>{"use strict";n.d(t,{Toaster:()=>x,o:()=>m});var r=n(94799),a=n(34023),l=n(8249),s=n(20704);let i=[],o=new Set;function c(e){return o.add(e),()=>o.delete(e)}function d(){return i}function u(){for(let e of(i=[...i],o))e()}function m(e,t="default"){let n=Math.random().toString(36).slice(2);i=[...i,{id:n,message:e,variant:t}],u(),setTimeout(()=>{i=i.filter(e=>e.id!==n),u()},4e3)}function x(){let e=(0,a.useSyncExternalStore)(c,d,d);return 0===e.length?null:(0,r.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>(0,r.jsxs)("div",{className:(0,l.cn)("flex items-center gap-2 rounded-lg border bg-background px-4 py-3 shadow-lg animate-in slide-in-from-bottom-2","error"===e.variant&&"border-destructive/50 text-destructive","success"===e.variant&&"border-green-500/50"),children:[(0,r.jsx)("span",{className:"text-sm",children:e.message}),(0,r.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void(i=i.filter(e=>e.id!==t),u())},className:"ml-2 rounded-sm p-0.5 hover:bg-accent",children:(0,r.jsx)(s.A,{className:"h-3 w-3"})})]},e.id))})}},31507:(e,t,n)=>{"use strict";n.d(t,{J:()=>i});var r=n(94799),a=n(34023),l=n(99946),s=n(8249);let i=a.forwardRef(({className:e,...t},n)=>(0,r.jsx)(l.b,{ref:n,className:(0,s.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));i.displayName="Label"},32115:(e,t,n)=>{"use strict";function r(e){var t;return(t={name:e}).label?t.label:t.name.replace(/[-_](.)/g,(e,t)=>` ${t.toUpperCase()}`).replace(/([A-Z])/g," $1").trim().replace(/\b\w/g,e=>e.toUpperCase())}n.d(t,{w:()=>r})},38217:(e,t,n)=>{"use strict";n.d(t,{MdxEditor:()=>eZ});var r=n(94799),a=n(34023);let l=(0,n(80916).v)(e=>({isDirty:!1,collectionName:"",slug:"",filePath:"",frontmatter:{},body:"",renderedHtml:"",selectedComponent:null,init:(t,n,r,a,l)=>e({collectionName:t,slug:n,filePath:r,frontmatter:a,body:l,isDirty:!1,selectedComponent:null}),updateFrontmatter:(t,n)=>e(e=>({frontmatter:{...e.frontmatter,[t]:n},isDirty:!0})),updateBody:t=>e({body:t,isDirty:!0}),updateRenderedHtml:t=>e({renderedHtml:t}),setSelectedComponent:t=>e({selectedComponent:t}),updateComponentProp:(t,n)=>e(e=>{if(!e.selectedComponent)return e;let r={...e.selectedComponent.props,[t]:n};return e.selectedComponent.updateAttributes?.({props:r}),{selectedComponent:{...e.selectedComponent,props:r},isDirty:!0}}),markClean:()=>e({isDirty:!1})}));var s=n(39074),i=n(82058),o=n(56742),c=n(20704);function d({open:e,onClose:t}){let n=l(e=>e.renderedHtml),s=l(e=>e.slug);return((0,a.useEffect)(()=>{if(!e)return;let n=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,t]),e)?(0,o.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:(0,r.jsxs)("div",{className:"relative flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg border bg-background shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-4",children:[(0,r.jsxs)("span",{className:"text-sm font-semibold",children:[s,".mdx — Preview"]}),(0,r.jsx)("button",{type:"button",onClick:t,className:"rounded-sm p-1 hover:bg-accent",children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"overflow-y-auto px-10 py-8",children:(0,r.jsx)("div",{className:"tiptap",dangerouslySetInnerHTML:{__html:n}})})]})}),document.body):null}var u=n(1727),m=n(81268),x=n(35973);function h({collectionName:e,slug:t,currentLocale:n,locales:a}){let l=(0,u.useRouter)();return a.length<=1?null:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(x.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)(m.m,{value:n,onChange:n=>{let r="default"===n?"":`?locale=${n}`;l.push(`/collection/${e}/${t}${r}`)},options:a.map(e=>({label:e.locale.toUpperCase(),value:e.locale})),className:"h-6 w-auto min-w-16 px-1.5 text-xs"})]})}var p=n(74988),g=n(44033),f=n(69360),b=n(25471);function v({locales:e,currentLocale:t}){let n=l(e=>e.isDirty),o=l(e=>e.slug),c=l(e=>e.collectionName),u=l(e=>e.filePath),m=l(e=>e.frontmatter),x=l(e=>e.body),v=l(e=>e.markClean),[j,y]=(0,a.useTransition)(),[w,N]=(0,a.useState)(!1),k=(0,a.useCallback)(()=>{n&&!j&&y(async()=>{let e=await (0,s.Z)([{filePath:u,frontmatter:m,body:x}]);e.success?(v(),(0,b.o)("Saved successfully","success")):(0,b.o)(e.error??"Save failed","error")})},[n,j,u,m,x,v,y]);return(0,f.K)({onSave:k}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"studio-topbar",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[14px]",children:[(0,r.jsx)("span",{className:"capitalize text-muted-foreground",children:c}),(0,r.jsx)(p.A,{className:"h-3.5 w-3.5 text-muted-foreground/40"}),(0,r.jsxs)("span",{className:"font-bold tracking-tight",children:[o,".mdx"]}),n&&(0,r.jsx)("span",{className:"ml-0.5 h-1.5 w-1.5 rounded-full bg-foreground/40"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[e&&t&&(0,r.jsx)(h,{collectionName:c,slug:o,currentLocale:t,locales:e}),(0,r.jsxs)(i.$,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:()=>N(!0),children:[(0,r.jsx)(g.A,{className:"h-3.5 w-3.5"}),"Preview"]}),(0,r.jsx)(i.$,{size:"sm",className:"h-7 px-3 text-xs",onClick:k,disabled:!n||j,children:j?"Saving…":"Save"})]})]}),(0,r.jsx)(d,{open:w,onClose:()=>N(!1)})]})}var j=n(57997),y=n(31507),w=n(54994);function N({fields:e}){let t=l(e=>e.frontmatter),n=l(e=>e.updateFrontmatter),a=new Map;if(e)for(let t of e)a.set(t.name,t);return(0,r.jsxs)("div",{className:"border-b bg-muted/20 px-6 py-4",children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Frontmatter"}),(0,r.jsx)("div",{className:"flex flex-col gap-3",children:Object.entries(t).map(([e,t])=>(0,r.jsx)(S,{fieldKey:e,value:t,schema:a.get(e),onChange:t=>n(e,t)},e))})]})}let k=/^\d{4}-\d{2}-\d{2}$/,C=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/;function S({fieldKey:e,value:t,schema:n,onChange:a}){return n?(0,r.jsx)(A,{fieldKey:e,value:t,schema:n,onChange:a}):(0,r.jsx)(E,{fieldKey:e,value:t,onChange:a})}function A({fieldKey:e,value:t,schema:n,onChange:a}){let l="label"in n&&n.label?String(n.label):e;switch(n.type){case"boolean":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(w.d,{checked:!!t,onCheckedChange:a})});case"select":{let e=n.options??[];return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(m.m,{value:String(t??""),onChange:a,options:[{label:"—",value:""},...e]})})}case"multi-select":{let e=n.options??[],s=Array.isArray(t)?t:[];return(0,r.jsx)(L,{label:l,children:(0,r.jsx)($,{options:e,selected:s,onChange:a})})}case"long-text":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)("textarea",{className:"flex min-h-20 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:String(t??""),onChange:e=>a(e.target.value),rows:3})});case"date":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"string"==typeof t&&k.test(t)?"date":"text",value:String(t??""),onChange:e=>a(e.target.value)})});case"number":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"number",value:String(t??""),onChange:e=>a(Number(e.target.value)||0)})});case"url":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"url",value:String(t??""),onChange:e=>a(e.target.value)})});case"email":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"email",value:String(t??""),onChange:e=>a(e.target.value)})});case"status":{let e=n.options??[];return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(R,{value:String(t??""),options:e,onChange:a})})}case"media":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"text",value:String(t??""),onChange:e=>a(e.target.value),placeholder:"Path or URL to media file"})});case"slug":{let e=n.from;return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"text",value:String(t??""),onChange:e=>a(e.target.value),placeholder:e?`Generated from "${e}"`:"slug"})})}case"relation":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"text",value:String(t??""),onChange:e=>a(e.target.value),placeholder:`Slug from "${n.collection}"`})});case"array":{let e=Array.isArray(t)?t:[],s=n.itemFields;if(0===s.length||1===s.length&&s[0]?.type==="text")return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{value:e.map(String).join(", "),onChange:e=>a(e.target.value.split(",").map(e=>e.trim()).filter(Boolean)),placeholder:"comma-separated"})});return(0,r.jsx)(L,{label:l,children:(0,r.jsxs)("span",{className:"text-sm text-muted-foreground",children:[e.length," item",1!==e.length?"s":""]})})}case"id":case"created-time":case"updated-time":case"formula":return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"text",value:String(t??""),readOnly:!0,className:"opacity-60"})});default:return(0,r.jsx)(L,{label:l,children:(0,r.jsx)(j.p,{type:"text",value:String(t??""),onChange:e=>a(e.target.value)})})}}function E({fieldKey:e,value:t,onChange:n}){if("boolean"==typeof t)return(0,r.jsx)(L,{label:e,children:(0,r.jsx)(w.d,{checked:t,onCheckedChange:n})});if(Array.isArray(t))return(0,r.jsx)(L,{label:e,children:(0,r.jsx)(j.p,{value:t.join(", "),onChange:e=>n(e.target.value.split(",").map(e=>e.trim())),placeholder:"comma-separated"})});if("string"==typeof t){if(C.test(t)&&!k.test(t))return(0,r.jsx)(L,{label:e,children:(0,r.jsx)(j.p,{type:"datetime-local",value:t,onChange:e=>n(e.target.value)})});if(k.test(t))return(0,r.jsx)(L,{label:e,children:(0,r.jsx)(j.p,{type:"date",value:t,onChange:e=>n(e.target.value)})})}return(0,r.jsx)(L,{label:e,children:(0,r.jsx)(j.p,{type:"number"==typeof t?"number":"text",value:String(t??""),onChange:e=>{if("number"==typeof t){let t=Number(e.target.value);n(Number.isNaN(t)?0:t)}else n(e.target.value)}})})}function L({label:e,children:t}){return(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(y.J,{className:"w-36 shrink-0 text-sm text-muted-foreground",children:e}),t]})}let M={gray:"bg-neutral-200 text-neutral-800",red:"bg-red-100 text-red-800",yellow:"bg-yellow-100 text-yellow-800",green:"bg-green-100 text-green-800",blue:"bg-blue-100 text-blue-800",purple:"bg-purple-100 text-purple-800"};function R({value:e,options:t,onChange:n}){return(0,r.jsx)("div",{className:"flex items-center gap-1.5",children:t.map(t=>{let a=e===t.value,l=M[t.color??"gray"]??M.gray;return(0,r.jsx)("button",{type:"button",onClick:()=>n(t.value),className:`rounded-full px-2.5 py-0.5 text-xs font-medium transition-opacity ${l} ${a?"opacity-100 ring-1 ring-foreground/30":"opacity-40 hover:opacity-70"}`,children:t.label},t.value)})})}function $({options:e,selected:t,onChange:n}){return(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>{let a=t.includes(e.value);return(0,r.jsx)("button",{type:"button",onClick:()=>{a?n(t.filter(t=>t!==e.value)):n([...t,e.value])},className:`rounded-md border px-2 py-0.5 text-xs transition-colors ${a?"border-foreground bg-foreground text-background":"border-input bg-transparent text-muted-foreground hover:text-foreground"}`,children:e.label},e.value)})})}var P=n(57089),I=n(74569),H=n(25815),B=n(87627),z=n(26944),T=n(7031),O=n(32815),D=n(82778);let U=[{value:"",label:"None"},{value:"bash",label:"Bash"},{value:"c",label:"C"},{value:"cpp",label:"C++"},{value:"csharp",label:"C#"},{value:"css",label:"CSS"},{value:"diff",label:"Diff"},{value:"go",label:"Go"},{value:"graphql",label:"GraphQL"},{value:"html",label:"HTML"},{value:"ini",label:"INI"},{value:"java",label:"Java"},{value:"javascript",label:"JavaScript"},{value:"json",label:"JSON"},{value:"kotlin",label:"Kotlin"},{value:"lua",label:"Lua"},{value:"makefile",label:"Makefile"},{value:"markdown",label:"Markdown"},{value:"objectivec",label:"Objective-C"},{value:"perl",label:"Perl"},{value:"php",label:"PHP"},{value:"python",label:"Python"},{value:"r",label:"R"},{value:"ruby",label:"Ruby"},{value:"rust",label:"Rust"},{value:"scss",label:"SCSS"},{value:"shell",label:"Shell"},{value:"sql",label:"SQL"},{value:"swift",label:"Swift"},{value:"typescript",label:"TypeScript"},{value:"xml",label:"XML"},{value:"yaml",label:"YAML"}];function _({node:e,updateAttributes:t,extension:n}){let a=e.attrs.language??"";return(0,r.jsxs)(P.VR,{className:"relative my-2",children:[(0,r.jsx)("div",{className:"absolute right-2 top-2 z-10",contentEditable:!1,children:(0,r.jsx)("select",{value:a,onChange:e=>t({language:e.target.value}),className:"h-6 rounded border border-border bg-muted/80 px-1.5 text-[10px] font-medium text-muted-foreground outline-none backdrop-blur-sm hover:bg-muted",children:U.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,r.jsx)("pre",{children:(0,r.jsx)("code",{children:(0,r.jsx)(P.$p,{})})})]})}var J=n(39335),W=n(14321),K=n(91097),F=n(46565),V=n(52563),Z=n(66084);async function q(e){let t=await fetch(`/api/media/${e}`);return t.ok?t.json():[]}async function Y(e,t){let n=new FormData;n.append("file",e);try{let e=await fetch(`/api/media/${t}`,{method:"POST",body:n});if(!e.ok)return null;return e.json()}catch{return null}}var G=n(84692),Q=n(54250),X=n(8249);let ee=(0,a.forwardRef)(({items:e,onSelect:t},n)=>{let[l,s]=(0,a.useState)(0);return((0,a.useImperativeHandle)(n,()=>({onKeyDown:({event:n})=>{if("ArrowUp"===n.key)return s(t=>(t+e.length-1)%e.length),!0;if("ArrowDown"===n.key)return s(t=>(t+1)%e.length),!0;if("Enter"===n.key){let n=e[l];return n&&t(n),!0}return!1}})),(0,a.useEffect)(()=>s(0),[e]),0===e.length)?(0,r.jsx)("div",{className:"z-50 w-56 overflow-hidden rounded-lg border bg-popover p-2 shadow-lg",children:(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"No results"})}):(0,r.jsxs)("div",{className:"z-50 w-64 overflow-hidden rounded-lg border bg-popover p-1.5 shadow-lg",children:[(0,r.jsx)("p",{className:"mb-1 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"Insert"}),(0,r.jsx)("div",{className:"flex flex-col gap-px",children:e.map((e,n)=>{let a=n===l;return(0,r.jsxs)("button",{className:(0,X.cn)("flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent text-accent-foreground"),onClick:()=>t(e),children:[(0,r.jsx)("div",{className:(0,X.cn)("flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-md border transition-colors",a?"border-border bg-background/80 text-foreground":"border-border bg-background text-foreground/60"),children:e.icon}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-[13px] font-medium leading-none",children:e.title}),(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:e.description})]})]},e.title)})})]})});ee.displayName="SlashCommandList";var et=n(88e3);function en(e){let t=e.toLowerCase();return et.O.filter(e=>e.title.toLowerCase().includes(t))}let er=I.YY.create({name:"slashCommand",addOptions:()=>({suggestion:{char:"/",command:({editor:e,range:t,props:n})=>{n.slashExec(e,t)},render:()=>{let e,t;return{onStart(n){e=new P.NV(ee,{props:{items:en(n.query),onSelect:e=>n.command(e)},editor:n.editor}),t=(0,Q.Ay)("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){e.updateProps({items:en(n.query),onSelect:e=>n.command(e)}),t[0]?.setProps({getReferenceClientRect:n.clientRect})},onKeyDown:n=>"Escape"===n.event.key?(t[0]?.hide(),!0):e.ref?.onKeyDown(n)??!1,onExit(){t[0]?.destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[(0,G.Ay)({editor:this.editor,...this.options.suggestion})]}});function ea({node:e}){let[t,l]=(0,a.useState)(""),[s,i]=(0,a.useState)(""),o=(0,a.useRef)(`mermaid-${Math.random().toString(36).slice(2)}`);return(0,a.useEffect)(()=>{let t=e.textContent.trim();if(!t){l(""),i("");return}let r=!1;return Promise.all([n.e(6288),n.e(3987),n.e(7430)]).then(n.bind(n,27430)).then(({default:e})=>{e.initialize({startOnLoad:!1,theme:"neutral"}),e.render(o.current,t).then(({svg:e})=>{r||(l(e),i(""),o.current=`mermaid-${Math.random().toString(36).slice(2)}`)}).catch(e=>{r||(i(e instanceof Error?e.message:String(e)),l(""))})}),()=>{r=!0}},[e.textContent]),(0,r.jsxs)(P.VR,{className:"my-4 rounded-xl border bg-muted/40",children:[(0,r.jsxs)("div",{className:"relative px-4 pt-3 pb-2",children:[(0,r.jsx)("span",{className:"absolute right-3 top-2 select-none text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"mermaid"}),(0,r.jsx)(P.$p,{as:"div",className:"font-mono text-sm leading-relaxed text-foreground outline-none"})]}),(0,r.jsxs)("div",{className:(0,X.cn)("border-t px-4 py-4",s&&"bg-destructive/5"),contentEditable:!1,children:[t&&(0,r.jsx)("div",{className:"flex justify-center [&_svg]:max-w-full [&_svg]:h-auto",dangerouslySetInnerHTML:{__html:t}}),s&&(0,r.jsx)("pre",{className:"text-xs text-destructive whitespace-pre-wrap",children:s}),!t&&!s&&(0,r.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:"Start typing a diagram…"})]})]})}let el=I.bP.create({name:"mermaidBlock",group:"block",content:"text*",marks:"",code:!0,defining:!0,isolating:!0,parseHTML:()=>[{tag:'pre[data-type="mermaid"]'}],renderHTML:({HTMLAttributes:e})=>["pre",(0,I.KV)(e,{"data-type":"mermaid"}),["code",0]],addStorage:()=>({markdown:{serialize(e,t){e.write("```mermaid\n"),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)}}}),addProseMirrorPlugins:()=>[new H.k_({appendTransaction(e,t,n){let{schema:r,doc:a,tr:l}=n,s=r.nodes.mermaidBlock;if(!s)return null;let i=[];if(a.descendants((e,t)=>{"codeBlock"===e.type.name&&"mermaid"===e.attrs.language&&i.push({from:t,to:t+e.nodeSize,content:e.content})}),0===i.length)return null;for(let e=i.length-1;e>=0;e--){let{from:t,to:n,content:r}=i[e];l.replaceWith(t,n,s.create(null,r))}return l}})],addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.insertContentAt(this.editor.state.selection.to+1,{type:"paragraph"})}},addNodeView:()=>(0,P.gu)(ea)});var es=n(25173);function ei(e){if("object"==typeof e&&null!==e&&!Array.isArray(e))return e;if("string"==typeof e)try{return JSON.parse(e)}catch{}return{}}function eo({node:e,updateAttributes:t}){let n=e.attrs.tagName??"Component",a=ei(e.attrs.props),s=l(e=>e.setSelectedComponent),i=Object.keys(a).length>0?Object.entries(a).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(", "):"";return(0,r.jsx)(P.VR,{className:"my-2",children:(0,r.jsxs)("div",{className:"flex cursor-pointer items-center gap-2 rounded-lg border-2 border-dashed border-border bg-muted/30 px-4 py-3 transition-colors hover:border-foreground/20",onClick:()=>s?.({tagName:n,props:a,updateAttributes:t}),contentEditable:!1,children:[(0,r.jsx)(es.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,r.jsxs)("span",{className:"text-sm font-medium text-muted-foreground",children:["<",n," />"]}),i&&(0,r.jsx)("span",{className:"truncate text-xs text-muted-foreground/60",children:i}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground/50",children:"Click to edit props"})]})})}let ec=I.bP.create({name:"componentBlock",group:"block",atom:!0,addAttributes:()=>({tagName:{default:"Component",parseHTML:e=>e.getAttribute("tagname")??"Component",renderHTML:e=>({tagname:e.tagName})},props:{default:{},parseHTML:e=>{let t=e.getAttribute("data-props");if(!t)return{};try{return JSON.parse(t)}catch{return{}}},renderHTML:e=>({"data-props":JSON.stringify(e.props??{})})}}),parseHTML:()=>[{tag:"component-block"}],renderHTML:({HTMLAttributes:e})=>["component-block",(0,I.KV)(e)],addStorage:()=>({markdown:{serialize(e,t){let n=t.attrs.tagName??"Component",r=Object.entries(ei(t.attrs.props)).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>"string"==typeof t?`${e}="${t}"`:"boolean"==typeof t?t?e:"":`${e}={${JSON.stringify(t)}}`).filter(Boolean).join(" "),a=r?`<${n} ${r} />`:`<${n} />`;e.write(a),e.closeBlock(t)}}}),addNodeView:()=>(0,P.gu)(eo)});var ed=n(33574),eu=n(86196),em=n(47820),ex=n(92335),eh=n(36440),ep=n(75027),eg=n(80645),ef=n(87460),eb=n(83660),ev=n(79964),ej=n(75962),ey=n(83693);function ew({onClick:e,active:t,title:n,children:a}){return(0,r.jsx)("button",{type:"button",onClick:e,title:n,className:(0,X.cn)("flex h-7 w-7 items-center justify-center rounded-md transition-colors","text-foreground/60 hover:bg-accent hover:text-accent-foreground",t&&"bg-accent text-accent-foreground"),children:a})}function eN(){return(0,r.jsx)("div",{className:"mx-1.5 h-4.5 w-px shrink-0 bg-border"})}function ek({editor:e}){let[,t]=(0,a.useState)(0);(0,a.useEffect)(()=>{let n=()=>t(e=>e+1);return e.on("selectionUpdate",n),e.on("update",n),()=>{e.off("selectionUpdate",n),e.off("update",n)}},[e]);let n=et.O.filter(e=>e.toolbarExec&&e.isActive);return(0,r.jsx)("div",{className:"sticky top-0 z-10 px-6 pt-4",children:(0,r.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-px rounded-xl border bg-card px-3",children:[(0,r.jsx)(ew,{onClick:()=>e.chain().focus().undo().run(),active:!1,title:"Undo",children:(0,r.jsx)(ed.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().redo().run(),active:!1,title:"Redo",children:(0,r.jsx)(eu.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(eN,{}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().setParagraph().run(),active:e.isActive("paragraph")&&!e.isActive("heading"),title:"Normal text",children:(0,r.jsx)(em.A,{className:"h-3.5 w-3.5"})}),n.map(t=>(0,r.jsx)(ew,{onClick:()=>t.toolbarExec(e),active:t.isActive(e),title:t.title,children:t.icon},t.title)),(0,r.jsx)(eN,{}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().toggleBold().run(),active:e.isActive("bold"),title:"Bold",children:(0,r.jsx)(ex.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().toggleItalic().run(),active:e.isActive("italic"),title:"Italic",children:(0,r.jsx)(eh.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().toggleStrike().run(),active:e.isActive("strike"),title:"Strikethrough",children:(0,r.jsx)(ep.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(ew,{onClick:()=>e.chain().focus().toggleCode().run(),active:e.isActive("code"),title:"Inline code",children:(0,r.jsx)(eg.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(eN,{}),(0,r.jsx)(ew,{onClick:function(){let t=e.getAttributes("link").href,n=window.prompt("URL",t??"");null!==n&&(""===n?e.chain().focus().unsetLink().run():e.chain().focus().setLink({href:n}).run())},active:e.isActive("link"),title:"Link",children:(0,r.jsx)(ef.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(eN,{}),(0,r.jsx)(ew,{onClick:()=>{ey.B.getState().openPicker("any",(t,n,r)=>{eA(e,t,n,r)})},active:!1,title:"Insert media",children:(0,r.jsx)(eb.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)(eC,{editor:e})]})})}function eC({editor:e}){let[t,n]=(0,a.useState)(!1),l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(t)return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e);function e(e){l.current?.contains(e.target)||n(!1)}},[t]),(0,r.jsxs)("div",{ref:l,className:"relative",children:[(0,r.jsxs)("button",{type:"button",title:"Export",onClick:()=>n(e=>!e),className:(0,X.cn)("flex h-7 items-center gap-1 rounded px-2 text-xs font-medium transition-colors","text-foreground/60 hover:bg-accent hover:text-accent-foreground",t&&"bg-accent text-accent-foreground"),children:[(0,r.jsx)(ev.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)(ej.A,{className:"h-3 w-3"})]}),t&&(0,r.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 w-40 overflow-hidden rounded-lg border bg-popover shadow-lg",children:[(0,r.jsx)("button",{type:"button",onClick:function(){eE(e.storage.markdown.getMarkdown(),"content.md","text/markdown"),n(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-accent",children:"Export as Markdown"}),(0,r.jsx)("button",{type:"button",onClick:function(){eE(`<!doctype html>
2
+ <html>
3
+ <body>
4
+ ${e.getHTML()}
5
+ </body>
6
+ </html>`,"content.html","text/html"),n(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-accent",children:"Export as HTML"})]})]})}function eS({editor:e}){let[t,n]=(0,a.useState)(null);(0,a.useEffect)(()=>{let t=()=>{if(e.state.selection.empty)return void n(null);let t=window.getSelection();if(!t?.rangeCount)return void n(null);let r=t.getRangeAt(0).getBoundingClientRect();n({top:r.top-48,left:r.left+r.width/2})};return e.on("selectionUpdate",t),e.on("blur",()=>n(null)),()=>{e.off("selectionUpdate",t),e.off("blur",()=>n(null))}},[e]);let l=et.O.filter(e=>e.toolbarExec&&e.isActive);return t?(0,o.createPortal)((0,r.jsxs)("div",{style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%)",zIndex:50},onMouseDown:e=>e.preventDefault(),className:"flex items-center gap-px rounded-lg border bg-popover/95 p-1 shadow-xl backdrop-blur-sm",children:[[{exec:()=>e.chain().focus().toggleBold().run(),active:e.isActive("bold"),title:"Bold",Icon:ex.A},{exec:()=>e.chain().focus().toggleItalic().run(),active:e.isActive("italic"),title:"Italic",Icon:eh.A},{exec:()=>e.chain().focus().toggleStrike().run(),active:e.isActive("strike"),title:"Strikethrough",Icon:ep.A},{exec:()=>e.chain().focus().toggleCode().run(),active:e.isActive("code"),title:"Inline code",Icon:eg.A}].map(({exec:e,active:t,title:n,Icon:a})=>(0,r.jsx)(ew,{onClick:e,active:t,title:n,children:(0,r.jsx)(a,{className:"h-3.5 w-3.5"})},n)),(0,r.jsx)("div",{className:"mx-1 h-4 w-px bg-border"}),l.map(t=>(0,r.jsx)(ew,{onClick:()=>t.toolbarExec(e),active:t.isActive(e),title:t.title,children:t.icon},t.title)),(0,r.jsx)("div",{className:"mx-1 h-4 w-px bg-border"}),(0,r.jsx)(ew,{onClick:()=>{let t=e.getAttributes("link").href,n=window.prompt("URL",t??"");null!==n&&(""===n?e.chain().focus().unsetLink().run():e.chain().focus().setLink({href:n}).run())},active:e.isActive("link"),title:"Link",children:(0,r.jsx)(ef.A,{className:"h-3.5 w-3.5"})})]}),document.body):null}function eA(e,t,n,r){r.startsWith("image/")||r.startsWith("video/")||r.startsWith("audio/")?e.chain().focus().setImage({src:t,alt:n}).run():e.chain().focus().insertContent(`<a href="${t}">${n}</a>`).run()}function eE(e,t,n){let r=new Blob([e],{type:n}),a=URL.createObjectURL(r),l=document.createElement("a");l.href=a,l.download=t,l.click(),URL.revokeObjectURL(a)}let eL=(0,K.$)(F.l);function eM(e){return e.replace(/<([A-Z][a-zA-Z0-9.]*)([^>]*?)\s*\/>/g,(e,t,n)=>{let r=JSON.stringify(function(e){let t={},n=e.trim(),r=0;for(;r<n.length;){for(;r<n.length&&/\s/.test(n[r]);)r++;if(r>=n.length)break;if(!/[a-zA-Z_$]/.test(n[r])){r++;continue}let e=r;for(;r<n.length&&/[a-zA-Z0-9_$]/.test(n[r]);)r++;let a=n.slice(e,r);for(;r<n.length&&/\s/.test(n[r]);)r++;if(r>=n.length||"="!==n[r]){t[a]=!0;continue}for(r++;r<n.length&&/\s/.test(n[r]);)r++;if(r>=n.length)break;let l=n[r];if('"'===l||"'"===l){let e=++r;for(;r<n.length&&n[r]!==l;)r++;t[a]=n.slice(e,r),r++}else if("{"===l){let e=1,l=++r;for(;r<n.length&&e>0;)"{"===n[r]?e++:"}"===n[r]&&e--,r++;let s=n.slice(l,r-1);try{t[a]=JSON.parse(s)}catch{t[a]=s}}}return t}(n??"")).replace(/'/g,"&#39;");return`<component-block tagname="${t}" data-props='${r}'></component-block>`})}let eR=new H.hs("frontmatterHighlight"),e$=/\{frontmatter\.[a-zA-Z0-9_.]+\}/g,eP=I.YY.create({name:"frontmatterHighlight",addProseMirrorPlugins:()=>[new H.k_({key:eR,props:{decorations(e){let t=[];return e.doc.descendants((e,n)=>{let r;if(!e.isText||!e.text)return;let a=RegExp(e$.source,"g");for(;null!==(r=a.exec(e.text));)t.push(B.NZ.inline(n+r.index,n+r.index+r[0].length,{class:"frontmatter-token"}))}),B.zF.create(e.doc,t)}}})]}),eI=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif","video/mp4","video/webm","video/ogg","audio/mpeg","audio/ogg","audio/wav","audio/webm","audio/aac","audio/flac"];function eH(e){let{state:t}=e,n=t.schema.nodes.mermaidBlock;if(!n)return;let r=[];if(t.doc.descendants((e,t)=>{"codeBlock"===e.type.name&&"mermaid"===e.attrs.language&&r.push({from:t,to:t+e.nodeSize,content:e.content})}),0===r.length)return;let a=t.tr;for(let e=r.length-1;e>=0;e--){let{from:t,to:l,content:s}=r[e];a.replaceWith(t,l,n.create(null,s))}e.view.dispatch(a)}function eB(){let e=l(e=>e.slug),t=l(e=>e.updateBody),n=l(e=>e.updateRenderedHtml),s=(0,P.hG)({immediatelyRender:!1,extensions:[z.A.configure({codeBlock:!1}),T.Ay.configure({openOnClick:!1}),O.A.configure({placeholder:'Start writing, or type "/" for commands…'}),D.A.extend({addNodeView:()=>(0,P.gu)(_)}).configure({lowlight:eL}),J.Ay.configure({inline:!1}),W.Ay.configure({allowedMimeTypes:eI,onDrop(e,t){let n=l.getState().collectionName;for(let r of t)Y(r,n).then(t=>{t&&eA(e,t.url,t.name,t.mimeType)})},onPaste(e,t){let n=l.getState().collectionName;for(let r of t)Y(r,n).then(t=>{t&&eA(e,t.url,t.name,t.mimeType)})}}),V.o.configure({transformPastedText:!0}),Z.A,el,ec,er,eP],content:eM(l.getState().body),onCreate({editor:e}){eH(e)},onUpdate({editor:e}){t(e.storage.markdown.getMarkdown()),n(e.getHTML())}});return(0,a.useEffect)(()=>{s&&!s.isDestroyed&&(s.commands.setContent(eM(l.getState().body)),eH(s))},[e,s]),(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)(ek,{editor:s}),s&&(0,r.jsx)(eS,{editor:s}),(0,r.jsx)(P.$Z,{editor:s,className:"px-6 py-8 md:px-8 [&_.tiptap]:min-h-[65vh]"})]})}var ez=n(25533),eT=n(79226),eO=n(87075),eD=n(66393),eU=n(54114);function e_({imageUrl:e,imageName:t,onCrop:n,onClose:l}){let s=(0,a.useRef)(null),d=(0,a.useRef)(null),[u,m]=(0,a.useState)(!1),[x,h]=(0,a.useState)({x:0,y:0,width:0,height:0}),[p,g]=(0,a.useState)(!1),[f,b]=(0,a.useState)({x:0,y:0});(0,a.useEffect)(()=>{let t=new Image;t.crossOrigin="anonymous",t.onload=()=>{d.current=t,h({x:Math.round(.1*t.naturalWidth),y:Math.round(.1*t.naturalHeight),width:Math.round(.8*t.naturalWidth),height:Math.round(.8*t.naturalHeight)}),m(!0)},t.src=e},[e]);let v=(0,a.useCallback)(()=>{let e=s.current,t=d.current;if(!e||!t||!u)return;let n=e.getContext("2d");if(!n)return;let r=e.clientWidth,a=e.clientHeight;e.width=r,e.height=a;let l=Math.min(r/t.naturalWidth,a/t.naturalHeight),i=t.naturalWidth*l,o=t.naturalHeight*l,c=(r-i)/2,m=(a-o)/2;n.drawImage(t,c,m,i,o),n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,0,r,a);let h=c+x.x*l,p=m+x.y*l,g=x.width*l,f=x.height*l;n.clearRect(h,p,g,f),n.drawImage(t,x.x,x.y,x.width,x.height,h,p,g,f),n.strokeStyle="white",n.lineWidth=2,n.strokeRect(h,p,g,f)},[x,u]);function j(e){let t=s.current,n=d.current;if(!t||!n)return{x:0,y:0};let r=t.getBoundingClientRect(),a=t.clientWidth,l=t.clientHeight,i=Math.min(a/n.naturalWidth,l/n.naturalHeight),o=(a-n.naturalWidth*i)/2,c=(l-n.naturalHeight*i)/2;return{x:Math.round((e.clientX-r.left-o)/i),y:Math.round((e.clientY-r.top-c)/i)}}function y(){g(!1)}return(0,a.useEffect)(()=>{v()},[v]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]),(0,o.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60",onClick:l,children:(0,r.jsxs)("div",{className:"relative flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-xl border bg-background shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-4",children:[(0,r.jsx)("span",{className:"text-sm font-semibold",children:"Crop Image"}),(0,r.jsx)("button",{type:"button",onClick:l,className:"rounded-sm p-1 hover:bg-accent",children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden p-4",children:(0,r.jsx)("canvas",{ref:s,className:"h-[60vh] w-full cursor-crosshair rounded border bg-muted",onMouseDown:function(e){let t=j(e);g(!0),b(t),h({x:t.x,y:t.y,width:0,height:0})},onMouseMove:function(e){if(!p||!d.current)return;let t=j(e),n=d.current,r=Math.max(0,Math.min(f.x,t.x)),a=Math.max(0,Math.min(f.y,t.y)),l=Math.min(Math.abs(t.x-f.x),n.naturalWidth-r),s=Math.min(Math.abs(t.y-f.y),n.naturalHeight-a);h({x:r,y:a,width:l,height:s})},onMouseUp:y,onMouseLeave:y})}),(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-t px-4",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:x.width>0&&x.height>0?`${x.width} \xd7 ${x.height}px`:"Draw a selection on the image"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:l,children:"Cancel"}),(0,r.jsx)(i.$,{size:"sm",className:"h-7 text-xs",disabled:x.width<1||x.height<1,onClick:function(){let e=d.current;if(!e||x.width<1||x.height<1)return;let r=document.createElement("canvas");r.width=x.width,r.height=x.height;let a=r.getContext("2d");a&&(a.drawImage(e,x.x,x.y,x.width,x.height,0,0,x.width,x.height),r.toBlob(e=>{if(e){let r=t.split(".").pop()??"png",a=t.replace(/\.[^.]+$/,"");n(e,`${a}-cropped.${r}`)}},"image/png"))},children:"Crop & Upload"})]})]})]})}),document.body)}function eJ(){let e=(0,ey.B)(e=>e.open),t=(0,ey.B)(e=>e.insertType),n=(0,ey.B)(e=>e.onInsert),s=(0,ey.B)(e=>e.closePicker),i=l(e=>e.collectionName),[d,u]=(0,a.useState)([]),[m,x]=(0,a.useState)(null),[h,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),[b,v]=(0,a.useState)(null),j=(0,a.useRef)(null),y=(0,a.useCallback)(async()=>{if(i){f(!0);try{let e=await q(i),n="any"===t?e:e.filter(e=>e.kind===t);u(n)}finally{f(!1)}}},[i,t]);async function w(e){if(e?.length&&i){p(!0);try{for(let t of Array.from(e)){let e=await Y(t,i);e&&(u(t=>{let n=t.filter(t=>t.name!==e.name);return[e,...n]}),x(e))}}finally{p(!1)}}}async function N(e,t){if(!i)return;let n=new File([e],t,{type:e.type}),r=await Y(n,i);r&&(u(e=>[r,...e.filter(e=>e.name!==r.name)]),x(r)),v(null)}return(0,a.useEffect)(()=>{e&&(x(null),y())},[e,y]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,s]),e?(0,r.jsxs)(r.Fragment,{children:[(0,o.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:s,children:(0,r.jsxs)("div",{className:"relative flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border bg-background shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-4",children:[(0,r.jsx)("span",{className:"text-sm font-semibold",children:"image"===t?"Insert Image":"video"===t?"Insert Video":"audio"===t?"Insert Audio":"Insert Media"}),(0,r.jsx)("button",{type:"button",onClick:s,className:"rounded-sm p-1 hover:bg-accent",children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"mx-4 mt-4 flex cursor-pointer items-center justify-center rounded-lg border-2 border-dashed border-border py-5 transition-colors hover:border-foreground/30 hover:bg-accent/30",onClick:()=>j.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),w(e.dataTransfer.files)},children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)(ez.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{className:"text-xs",children:h?"Uploading…":"Drop files here or click to upload"})]}),(0,r.jsx)("input",{ref:j,type:"file",className:"hidden",accept:"image"===t?"image/*":"video"===t?"video/*":"audio"===t?"audio/*":"*/*",multiple:!0,onChange:e=>w(e.target.files)})]}),(0,r.jsx)("div",{className:"mt-3 min-h-0 flex-1 overflow-y-auto px-4 pb-4",children:g?(0,r.jsx)("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):0===d.length?(0,r.jsx)("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"No media found. Upload a file to get started."}):(0,r.jsx)("div",{className:"grid grid-cols-4 gap-2 pt-1 sm:grid-cols-5",children:d.map(e=>(0,r.jsx)(eW,{asset:e,isSelected:m?.path===e.path,onSelect:()=>x(e),onDoubleClick:()=>{x(e),n&&(n(e.url,e.name,e.mimeType),s())}},e.path))})}),(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-t px-4",children:[(0,r.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:m?m.name:"No file selected"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:s,className:"h-7 rounded px-3 text-xs hover:bg-accent",children:"Cancel"}),m?.kind==="image"&&(0,r.jsxs)("button",{type:"button",onClick:()=>v(m),className:"flex h-7 items-center gap-1.5 rounded border px-3 text-xs hover:bg-accent",children:[(0,r.jsx)(eT.A,{className:"h-3 w-3"}),"Crop"]}),(0,r.jsx)("button",{type:"button",disabled:!m,onClick:function(){m&&n&&(n(m.url,m.name,m.mimeType),s())},className:(0,X.cn)("h-7 rounded bg-foreground px-3 text-xs text-background transition-opacity",!m&&"cursor-not-allowed opacity-40"),children:"Insert"})]})]})]})}),document.body),b&&(0,r.jsx)(e_,{imageUrl:b.url,imageName:b.name,onCrop:N,onClose:()=>v(null)},b.path)]}):null}function eW({asset:e,isSelected:t,onSelect:n,onDoubleClick:a}){return(0,r.jsxs)("button",{type:"button",onClick:n,onDoubleClick:a,className:(0,X.cn)("group flex flex-col items-center gap-1 rounded-lg border p-1.5 text-left transition-colors",t?"border-foreground bg-accent":"border-transparent hover:border-border hover:bg-accent/50"),children:[(0,r.jsx)("div",{className:"flex h-16 w-full items-center justify-center overflow-hidden rounded bg-muted",children:"image"===e.kind?(0,r.jsx)("img",{src:e.url,alt:e.name,className:"h-full w-full object-cover"}):"video"===e.kind?(0,r.jsx)(eO.A,{className:"h-6 w-6 text-muted-foreground"}):"audio"===e.kind?(0,r.jsx)(eD.A,{className:"h-6 w-6 text-muted-foreground"}):(0,r.jsx)(eU.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,r.jsx)("span",{className:"w-full truncate text-center text-[10px] text-muted-foreground",children:e.name})]})}var eK=n(59256),eF=n(32115);function eV({registry:e}){let t=l(e=>e.selectedComponent),n=l(e=>e.setSelectedComponent),s=l(e=>e.updateComponentProp),[o,d]=(0,a.useState)("");if(!t)return null;let{tagName:u,props:x}=t,h=e.find(e=>e.tagName===u);function p(){let e=o.trim();e&&(s(e,""),d(""))}let g=h?.props??Object.keys(x).map(e=>({name:e,type:"boolean"==typeof x[e]?"boolean":"number"==typeof x[e]?"number":"text"}));return(0,r.jsxs)("div",{className:"w-72 shrink-0 border-l bg-muted/20",children:[(0,r.jsxs)("div",{className:"flex h-10 items-center justify-between border-b px-4",children:[(0,r.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wide text-foreground/80",children:[h?.name??u," Props"]}),(0,r.jsx)(i.$,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>n(null),children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(y.J,{className:"text-xs text-muted-foreground",children:"Tag Name"}),h?(0,r.jsxs)("span",{className:"text-sm font-medium",children:["<",u," />"]}):(0,r.jsx)(j.p,{type:"text",value:u,onChange:e=>{let r=e.target.value;t.updateAttributes?.({tagName:r}),n({...t,tagName:r})},className:"h-7 text-sm",placeholder:"ComponentName"})]})}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 px-4 py-3",children:[g.map(e=>{let t=x[e.name],n="label"in e&&e.label?String(e.label):(0,eF.w)(String(e.name));if("boolean"===e.type)return(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(y.J,{className:"text-xs text-muted-foreground",children:n}),(0,r.jsx)(w.d,{checked:!!t,onCheckedChange:t=>s(e.name,t)})]},e.name);if("number"===e.type)return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(y.J,{className:"text-xs text-muted-foreground",children:n}),(0,r.jsx)(j.p,{type:"number",value:String(t??""),onChange:t=>s(e.name,Number(t.target.value)),className:"h-7 text-sm"})]},e.name);if("select"===e.type&&"options"in e){let a=e.options??[];return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(y.J,{className:"text-xs text-muted-foreground",children:n}),(0,r.jsx)(m.m,{value:String(t??""),onChange:t=>s(e.name,t),options:[{label:"—",value:""},...a],className:"h-7 px-2"})]},e.name)}return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(y.J,{className:"text-xs text-muted-foreground",children:n}),(0,r.jsx)(j.p,{type:"url"===e.type?"url":"text",value:String(t??""),onChange:t=>s(e.name,t.target.value),className:"h-7 text-sm",placeholder:("placeholder"in e?e.placeholder:void 0)??""})]},e.name)}),!h&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 pt-2 border-t",children:[(0,r.jsx)(j.p,{type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&p(),className:"h-7 flex-1 text-sm",placeholder:"New prop name"}),(0,r.jsx)(i.$,{variant:"outline",size:"icon",className:"h-7 w-7 shrink-0",onClick:p,disabled:!o.trim(),children:(0,r.jsx)(eK.A,{className:"h-3.5 w-3.5"})})]})]})]})}function eZ({collectionName:e,slug:t,filePath:n,frontmatter:s,body:i,registry:o=[],locales:c,currentLocale:d,fields:u}){let m=l(e=>e.init);return(0,a.useEffect)(()=>{m(e,t,n,s,i)},[e,t,n,s,i,m]),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,r.jsx)(v,{locales:c,currentLocale:d}),(0,r.jsx)("div",{className:"studio-canvas overflow-y-auto",children:(0,r.jsx)("div",{className:"min-h-full px-4 py-4",children:(0,r.jsxs)("div",{className:"studio-surface flex min-h-full flex-col",children:[(0,r.jsx)(N,{fields:u}),(0,r.jsx)(eB,{})]})})}),(0,r.jsx)(eJ,{})]}),(0,r.jsx)(eV,{registry:o})]})}},39074:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3581);let a=(0,r.createServerReference)("401d4fc3f2e4c29611b3858f484ba729bf121b3d1a",r.callServer,void 0,r.findSourceMapURL,"saveMdxFrontmatter")},42939:(e,t,n)=>{"use strict";n.d(t,{SidebarCacheWriter:()=>l,z:()=>a.z});var r=n(34023),a=n(8249);function l({collections:e}){return(0,r.useEffect)(()=>{(0,a.m)(e)},[e]),null}},52917:(e,t,n)=>{"use strict";n.d(t,{ThemeToggle:()=>c});var r=n(94799),a=n(86846),l=n(34023),s=n(8802),i=n(6933),o=n(82058);function c(){let{theme:e,setTheme:t}=(0,a.D)(),[n,c]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{c(!0)},[]),n)?(0,r.jsxs)(o.$,{variant:"ghost",size:"icon",onClick:()=>t("dark"===e?"light":"dark"),children:["dark"===e?(0,r.jsx)(s.A,{className:"h-4 w-4"}):(0,r.jsx)(i.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle theme"})]}):(0,r.jsx)(o.$,{variant:"ghost",size:"icon",disabled:!0,children:(0,r.jsx)(s.A,{className:"h-4 w-4"})})}},54994:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(94799),a=n(34023),l=n(41353),s=n(8249);let i=a.forwardRef(({className:e,...t},n)=>(0,r.jsx)(l.bL,{className:(0,s.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:(0,r.jsx)(l.zi,{className:(0,s.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));i.displayName="Switch"},57997:(e,t,n)=>{"use strict";n.d(t,{p:()=>s});var r=n(94799),a=n(34023),l=n(8249);let s=a.forwardRef(({className:e,type:t,...n},a)=>(0,r.jsx)("input",{type:t,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));s.displayName="Input"},69360:(e,t,n)=>{"use strict";n.d(t,{K:()=>a});var r=n(34023);function a({onSave:e,onEscape:t}){(0,r.useEffect)(()=>{function n(n){(n.ctrlKey||n.metaKey)&&"s"===n.key&&(n.preventDefault(),e?.()),"Escape"===n.key&&t?.()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,t])}},81268:(e,t,n)=>{"use strict";n.d(t,{m:()=>l});var r=n(94799),a=n(8249);function l({value:e,onChange:t,options:n,className:l}){return(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:(0,a.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",l),children:n.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})}},82058:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var r=n(94799),a=n(34023),l=n(10086),s=n(8249);let i=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=a.forwardRef(({className:e,variant:t,size:n,...a},l)=>(0,r.jsx)("button",{className:(0,s.cn)(i({variant:t,size:n,className:e})),ref:l,...a}));o.displayName="Button"},83693:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});let r=(0,n(80916).v)(e=>({open:!1,insertType:"any",onInsert:null,openPicker:(t,n)=>e({open:!0,insertType:t,onInsert:n}),closePicker:()=>e({open:!1,onInsert:null})}))},88e3:(e,t,n)=>{"use strict";n.d(t,{O:()=>v});var r=n(94799),a=n(36360),l=n(12673),s=n(41094),i=n(78416),o=n(46148),c=n(7536),d=n(80137),u=n(25968),m=n(13959),x=n(55645),h=n(87075),p=n(66393),g=n(25173),f=n(83693);let b="h-3.5 w-3.5",v=[{title:"Heading 1",description:"Large heading",icon:(0,r.jsx)(a.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:1}).run(),toolbarExec:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1})},{title:"Heading 2",description:"Medium heading",icon:(0,r.jsx)(l.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:2}).run(),toolbarExec:e=>e.chain().focus().toggleHeading({level:2}).run(),isActive:e=>e.isActive("heading",{level:2})},{title:"Heading 3",description:"Small heading",icon:(0,r.jsx)(s.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).setHeading({level:3}).run(),toolbarExec:e=>e.chain().focus().toggleHeading({level:3}).run(),isActive:e=>e.isActive("heading",{level:3})},{title:"Bullet List",description:"Unordered list",icon:(0,r.jsx)(i.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).toggleBulletList().run()},{title:"Ordered List",description:"Numbered list",icon:(0,r.jsx)(o.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).toggleOrderedList().run()},{title:"Blockquote",description:"Quote block",icon:(0,r.jsx)(c.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).toggleBlockquote().run()},{title:"Code Block",description:"Code with syntax highlight",icon:(0,r.jsx)(d.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).toggleCodeBlock().run()},{title:"Divider",description:"Horizontal rule",icon:(0,r.jsx)(u.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).setHorizontalRule().run()},{title:"Mermaid Diagram",description:"Flowchart, sequence, or graph",icon:(0,r.jsx)(m.A,{className:b}),slashExec:(e,t)=>e.chain().focus().deleteRange(t).insertContent({type:"mermaidBlock",content:[]}).run()},{title:"Image",description:"Insert an image from media",icon:(0,r.jsx)(x.A,{className:b}),slashExec:(e,t)=>{e.chain().focus().deleteRange(t).run(),f.B.getState().openPicker("image",(t,n)=>{e.chain().focus().setImage({src:t,alt:n}).run()})}},{title:"Video",description:"Insert a video from media",icon:(0,r.jsx)(h.A,{className:b}),slashExec:(e,t)=>{e.chain().focus().deleteRange(t).run(),f.B.getState().openPicker("video",(t,n)=>{e.chain().focus().setImage({src:t,alt:n}).run()})}},{title:"Audio",description:"Insert an audio file from media",icon:(0,r.jsx)(p.A,{className:b}),slashExec:(e,t)=>{e.chain().focus().deleteRange(t).run(),f.B.getState().openPicker("audio",(t,n)=>{e.chain().focus().setImage({src:t,alt:n}).run()})}},{title:"Component",description:"Insert a custom component block",icon:(0,r.jsx)(g.A,{className:b}),slashExec:(e,t)=>{e.chain().focus().deleteRange(t).insertContent({type:"componentBlock",attrs:{tagName:"Component",props:{}}}).run()}}]}},e=>{e.O(0,[4841,5942,2462,7722,8814,6299,5350,7408,1858,7358],()=>e(e.s=18349)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1944],{6933:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=(0,t(47743).A)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]])},8249:(e,r,t)=>{"use strict";t.d(r,{cn:()=>n,m:()=>d,z:()=>l});var s=t(35176),a=t(34404);function n(...e){return(0,a.QP)((0,s.$)(e))}let i="studio:sidebar-collections";function l(){try{let e=localStorage.getItem(i);if(!e)return[];return JSON.parse(e)}catch{return[]}}function d(e){try{localStorage.setItem(i,JSON.stringify(e))}catch{}}},8802:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=(0,t(47743).A)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},10086:(e,r,t)=>{"use strict";t.d(r,{F:()=>i});var s=t(35176);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,i=(e,r)=>t=>{var s;if((null==r?void 0:r.variants)==null)return n(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:i,defaultVariants:l}=r,d=Object.keys(i).map(e=>{let r=null==t?void 0:t[e],s=null==l?void 0:l[e];if(null===r)return null;let n=a(r)||a(s);return i[e][n]}),o=t&&Object.entries(t).reduce((e,r)=>{let[t,s]=r;return void 0===s||(e[t]=s),e},{});return n(e,d,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:s,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...l,...o}[r]):({...l,...o})[r]===t})?[...e,t,s]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},10439:(e,r,t)=>{Promise.resolve().then(t.bind(t,61467))},42939:(e,r,t)=>{"use strict";t.d(r,{SidebarCacheWriter:()=>n,z:()=>a.z});var s=t(34023),a=t(8249);function n({collections:e}){return(0,s.useEffect)(()=>{(0,a.m)(e)},[e]),null}},52917:(e,r,t)=>{"use strict";t.d(r,{ThemeToggle:()=>o});var s=t(94799),a=t(86846),n=t(34023),i=t(8802),l=t(6933),d=t(82058);function o(){let{theme:e,setTheme:r}=(0,a.D)(),[t,o]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{o(!0)},[]),t)?(0,s.jsxs)(d.$,{variant:"ghost",size:"icon",onClick:()=>r("dark"===e?"light":"dark"),children:["dark"===e?(0,s.jsx)(i.A,{className:"h-4 w-4"}):(0,s.jsx)(l.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]}):(0,s.jsx)(d.$,{variant:"ghost",size:"icon",disabled:!0,children:(0,s.jsx)(i.A,{className:"h-4 w-4"})})}},61467:(e,r,t)=>{"use strict";t.d(r,{AppSidebarSkeleton:()=>o});var s=t(94799),a=t(34023);let n=(0,t(47743).A)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var i=t(52917),l=t(42939);let d=[72,56,88,64];function o(){let e=(0,a.useMemo)(()=>(0,l.z)(),[]),r=e.length>0?e:d.map(()=>null);return(0,s.jsxs)("aside",{className:"flex h-full w-64 shrink-0 flex-col border-r border-sidebar-border bg-sidebar-background",children:[(0,s.jsxs)("div",{className:"flex h-14.5 shrink-0 items-center gap-3 border-b border-sidebar-border px-5",children:[(0,s.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-sidebar-accent",children:(0,s.jsx)(n,{className:"h-4 w-4 text-sidebar-primary"})}),(0,s.jsx)("span",{className:"text-[14px] font-semibold tracking-tight text-sidebar-foreground",children:"Nextjs Studio"})]}),(0,s.jsxs)("div",{className:"flex-1 py-5",children:[(0,s.jsx)("p",{className:"mb-2 px-5 text-[10px] font-semibold uppercase tracking-[0.14em] text-sidebar-foreground/40",children:"Content"}),(0,s.jsx)("div",{className:"flex flex-col gap-1 px-3",children:r.map((e,r)=>(0,s.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg px-3 py-2",children:[(0,s.jsx)("div",{className:"h-3.5 w-3.5 shrink-0 rounded bg-sidebar-foreground/10"}),e?(0,s.jsx)("span",{className:"truncate text-[13px] capitalize text-sidebar-foreground/20",children:e.name}):(0,s.jsx)("div",{className:"h-3 rounded bg-sidebar-foreground/10",style:{width:d[r%d.length]}})]},r))})]}),(0,s.jsx)("div",{className:"shrink-0 border-t border-sidebar-border px-4 py-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-sidebar-foreground/30",children:"v1.0"}),(0,s.jsx)(i.ThemeToggle,{})]})})]})}},82058:(e,r,t)=>{"use strict";t.d(r,{$:()=>d});var s=t(94799),a=t(34023),n=t(10086),i=t(8249);let l=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(({className:e,variant:r,size:t,...a},n)=>(0,s.jsx)("button",{className:(0,i.cn)(l({variant:r,size:t,className:e})),ref:n,...a}));d.displayName="Button"}},e=>{e.O(0,[2462,7408,1858,7358],()=>e(e.s=10439)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3221],{3777:(e,t,s)=>{"use strict";s.d(t,{ScrollArea:()=>n});var r=s(94799),l=s(34023),a=s(8249);let n=l.forwardRef(({className:e,children:t,...s},l)=>(0,r.jsx)("div",{ref:l,className:(0,a.cn)("relative overflow-auto",e),...s,children:t}));n.displayName="ScrollArea"},8249:(e,t,s)=>{"use strict";s.d(t,{cn:()=>a,m:()=>o,z:()=>i});var r=s(35176),l=s(34404);function a(...e){return(0,l.QP)((0,r.$)(e))}let n="studio:sidebar-collections";function i(){try{let e=localStorage.getItem(n);if(!e)return[];return JSON.parse(e)}catch{return[]}}function o(e){try{localStorage.setItem(n,JSON.stringify(e))}catch{}}},14756:(e,t,s)=>{"use strict";s.d(t,{JsonFormEditor:()=>K});var r=s(94799),l=s(34023),a=s(38014),n=s(22149),i=s(82058),o=s(15968),d=s(69360),c=s(25471);function u({collectionName:e,hasSync:t}){let s=(0,a.U)(e=>e.isDirty),u=(0,a.U)(e=>e.filePath),m=(0,a.U)(e=>e.getSerializedJson),x=(0,a.U)(e=>e.markClean),[f,h]=(0,l.useTransition)(),p=(0,l.useCallback)(()=>{s&&!f&&h(async()=>{let e=m(),t=await (0,n.q)(u,e);t.success?(x(),(0,c.o)("Saved successfully","success")):(0,c.o)(t.error??"Save failed","error")})},[s,f,u,m,x,h]),[g,b]=(0,l.useState)(!1),v=(0,l.useCallback)(async()=>{if(!g){b(!0);try{let t=await fetch(`/api/sync/${e}`,{method:"POST"}),s=await t.json();t.ok&&s.success?((0,c.o)("Sync completed","success"),window.location.reload()):(0,c.o)(s.error??"Sync failed","error")}catch{(0,c.o)("Sync failed","error")}finally{b(!1)}}},[e,g]);return(0,d.K)({onSave:p}),(0,r.jsxs)("div",{className:"studio-topbar",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[14px]",children:[(0,r.jsx)("span",{className:"font-bold capitalize tracking-tight",children:e}),s&&(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-foreground/40"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[t&&(0,r.jsxs)(i.$,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:v,disabled:g,children:[(0,r.jsx)(o.A,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`}),g?"Syncing…":"Sync"]}),(0,r.jsx)(i.$,{size:"sm",className:"h-7 px-3 text-xs",onClick:p,disabled:!s||f,children:f?"Saving…":"Save"})]})]})}var m=s(1248);let x=m.bL,f=m.R6,h=m.Ke;var p=s(8249);let g=l.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...l},a)=>(0,r.jsx)("div",{ref:a,role:s?"none":"separator","aria-orientation":s?void 0:t,className:(0,p.cn)("shrink-0 bg-border","horizontal"===t?"h-[1px] w-full":"h-full w-[1px]",e),...l}));g.displayName="Separator";var b=s(74988),v=s(68679),j=s(75962);function y({title:e,sectionKey:t,defaultOpen:s=!1,children:a,footer:n,onMoveUp:i,onMoveDown:o}){let[d,c]=(0,l.useState)(s);return(0,r.jsxs)(x,{open:d,onOpenChange:c,children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(f,{className:"flex flex-1 items-center gap-2 py-2",children:[(0,r.jsx)(b.A,{className:(0,p.cn)("h-4 w-4 text-muted-foreground transition-transform",d&&"rotate-90")}),(0,r.jsx)("span",{className:"text-base font-bold tracking-tight",children:e})]}),(void 0!==i||void 0!==o)&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),i?.()},disabled:!i,title:"Move section up",className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-30",children:(0,r.jsx)(v.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),o?.()},disabled:!o,title:"Move section down",className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-30",children:(0,r.jsx)(j.A,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)(g,{}),(0,r.jsx)(h,{children:(0,r.jsxs)("div",{className:"py-4",children:[a,n&&(0,r.jsx)("div",{className:"mt-4 border-t border-dashed pt-4",children:n})]})})]})}var w=s(54916),N=s(57997),S=s(31507),k=s(54994),C=s(81268),A=s(32115),U=s(20301);function D({path:e,showFieldControls:t}){let s=(0,a.U)(e=>e.deleteField),l=(0,a.U)(e=>e.reorderField);return t?(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover/tree:opacity-100 hover:opacity-100 focus-within:opacity-100",children:[(0,r.jsx)("button",{type:"button",onClick:()=>l(e,"up"),title:"Move up",className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:(0,r.jsx)(v.A,{className:"h-3 w-3"})}),(0,r.jsx)("button",{type:"button",onClick:()=>l(e,"down"),title:"Move down",className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:(0,r.jsx)(j.A,{className:"h-3 w-3"})}),(0,r.jsx)("button",{type:"button",onClick:()=>s(e),title:"Delete field",className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive",children:(0,r.jsx)(U.A,{className:"h-3 w-3"})})]}):null}function R({label:e,path:t,data:s,depth:a=0}){let[n,i]=(0,l.useState)(a<2),o=Object.entries(s);return(0,r.jsxs)(x,{open:n,onOpenChange:i,children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(f,{className:"flex flex-1 items-center gap-2 py-1",children:[(0,r.jsx)(b.A,{className:(0,p.cn)("h-3.5 w-3.5 text-muted-foreground transition-transform",n&&"rotate-90")}),(0,r.jsx)(S.J,{className:"cursor-pointer text-sm text-muted-foreground",children:e}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.length," field",1!==o.length?"s":"",")"]})]}),(0,r.jsx)(D,{path:t})]}),(0,r.jsx)(h,{children:(0,r.jsx)("div",{className:"ml-4 flex flex-col gap-3 border-l pl-4 pt-2",children:o.map(([e,s])=>{let l=`${t}.${e}`;return"object"!=typeof s||null===s||Array.isArray(s)?(0,r.jsxs)("div",{className:"flex items-start gap-1",children:[(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(_,{fieldKey:e,path:l,value:s})}),(0,r.jsx)(D,{path:l,showFieldControls:!0})]},e):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(R,{label:(0,A.w)(e),path:l,data:s,depth:a+1}),(0,r.jsx)(D,{path:l,showFieldControls:!0})]},e)})})})]})}let $=(0,w.default)(()=>Promise.all([s.e(4841),s.e(5942),s.e(8814),s.e(8800)]).then(s.bind(s,28800)).then(e=>e.RichTextField),{loadableGenerated:{webpack:()=>[28800]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"h-[200px] animate-pulse rounded-md border bg-muted/30"})});function O({label:e,children:t}){return(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsx)(S.J,{className:"w-36 shrink-0 pt-2 text-sm text-muted-foreground",children:e}),(0,r.jsx)("div",{className:"flex-1",children:t})]})}let _=(0,l.memo)(function({fieldKey:e,path:t,value:s,isRichText:l}){let n=(0,a.U)(e=>e.updateField),i=(0,a.U)(e=>e.fieldDefs)[t.split(".").at(-1)??e],o=i?.label??(0,A.w)(e),d=i?.type;if(l&&"string"==typeof s)return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(S.J,{className:"text-sm text-muted-foreground",children:o}),(0,r.jsx)($,{value:s,onChange:e=>n(t,e),placeholder:"Start writing..."})]});if("boolean"===d||!d&&"boolean"==typeof s)return(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(S.J,{className:"w-36 shrink-0 text-sm text-muted-foreground",children:o}),(0,r.jsx)(k.d,{checked:!!s,onCheckedChange:e=>n(t,e)})]});if("number"===d||!d&&"number"==typeof s)return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"number",value:s,onChange:e=>{let s=Number(e.target.value);n(t,Number.isNaN(s)?0:s)}})});if("date"===d){let e=i.includeTime;return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:e?"datetime-local":"date",value:String(s??""),onChange:e=>n(t,e.target.value)})})}if("created-time"===d||"updated-time"===d)return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"text",value:String(s??""),readOnly:!0,className:"cursor-default opacity-60"})});if("email"===d)return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"email",value:String(s??""),onChange:e=>n(t,e.target.value),placeholder:i.placeholder})});if("url"===d)return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"url",value:String(s??""),onChange:e=>n(t,e.target.value),placeholder:i.placeholder})});if("select"===d){let e=i.options??[];return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(C.m,{value:String(s??""),onChange:e=>n(t,e),options:[{label:"—",value:""},...e]})})}if("multi-select"===d){let e=i.options??[],l=Array.isArray(s)?s:[];return(0,r.jsx)(O,{label:o,children:(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.map(e=>{let s=l.includes(e.value);return(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-sm",children:[(0,r.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{n(t,s?l.filter(t=>t!==e.value):[...l,e.value])},className:"h-3.5 w-3.5 rounded border-input accent-foreground"}),e.label]},e.value)}),0===e.length&&(0,r.jsx)(N.p,{type:"text",value:l.join(", "),onChange:e=>n(t,e.target.value.split(",").map(e=>e.trim()).filter(Boolean)),placeholder:"comma-separated values"})]})})}if("status"===d){let e=i.options??[];return(0,r.jsx)(O,{label:o,children:(0,r.jsx)(C.m,{value:String(s??""),onChange:e=>n(t,e),options:[{label:"—",value:""},...e]})})}if("long-text"===d){let e=i.rows??3;return(0,r.jsx)(O,{label:o,children:(0,r.jsx)("textarea",{rows:e,value:String(s??""),onChange:e=>n(t,e.target.value),placeholder:i.placeholder,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})})}return"media"===d?(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"text",value:String(s??""),onChange:e=>n(t,e.target.value),placeholder:"Media path or URL"})}):"id"===d||"slug"===d?(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"text",value:String(s??""),onChange:e=>n(t,e.target.value)})}):"object"!=typeof s||null===s||Array.isArray(s)||"array"===d?"array"===d||Array.isArray(s)?(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"text",value:Array.isArray(s)?s.join(", "):String(s??""),onChange:e=>{n(t,e.target.value.split(",").map(e=>e.trim()))},placeholder:"comma-separated values"})}):(0,r.jsx)(O,{label:o,children:(0,r.jsx)(N.p,{type:"text",value:String(s??""),onChange:e=>n(t,e.target.value),placeholder:i?.placeholder})}):(0,r.jsx)(R,{label:o,path:t,data:s})});var J=s(59256),z=s(20704);let P={string:"",number:0,boolean:!1};function F({path:e=""}){let t=(0,a.U)(e=>e.addField),[s,n]=(0,l.useState)(!1),[i,o]=(0,l.useState)(""),[d,c]=(0,l.useState)("string");function u(){i.trim()&&(t(e,i.trim(),P[d]??""),o(""),c("string"),n(!1))}return s?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(N.p,{placeholder:"Field name",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&u(),"Escape"===e.key&&n(!1)},className:"h-8 w-44",autoFocus:!0}),(0,r.jsxs)("select",{value:d,onChange:e=>c(e.target.value),className:"h-8 rounded-md border border-input bg-background px-2 text-xs",children:[(0,r.jsx)("option",{value:"string",children:"String"}),(0,r.jsx)("option",{value:"number",children:"Number"}),(0,r.jsx)("option",{value:"boolean",children:"Boolean"})]}),(0,r.jsx)("button",{type:"button",onClick:u,className:"h-8 rounded-md border px-3 text-xs hover:bg-accent",children:"Add"}),(0,r.jsx)("button",{type:"button",onClick:()=>n(!1),className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent",children:(0,r.jsx)(z.A,{className:"h-3.5 w-3.5"})})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>n(!0),className:(0,p.cn)("flex w-fit items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5","text-xs text-muted-foreground transition-colors","hover:border-foreground/30 hover:text-foreground"),children:[(0,r.jsx)(J.A,{className:"h-3.5 w-3.5"}),"Add field"]})}var M=s(19801);function E(){let e=(0,a.U)(e=>e.addField),[t,s]=(0,l.useState)(!1),[n,o]=(0,l.useState)("");function d(){let t=n.trim();t&&(e("",t,{}),o(""),s(!1))}return t?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(N.p,{placeholder:"Section name",value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&d(),"Escape"===e.key&&s(!1)},className:"h-8 w-44",autoFocus:!0}),(0,r.jsx)(i.$,{size:"sm",variant:"outline",className:"h-8",onClick:d,children:"Add"}),(0,r.jsx)(i.$,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>s(!1),children:(0,r.jsx)(z.A,{className:"h-4 w-4"})})]}):(0,r.jsxs)(i.$,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>s(!0),children:[(0,r.jsx)(M.A,{className:"h-4 w-4"}),"Add section"]})}var T=s(3777);let I=["description","descriptions","text","content"];function K({collection:e,data:t,filePath:s,hasSync:n}){let i=(0,a.U)(e=>e.initForm),o=(0,a.U)(e=>e.formData),d=(0,a.U)(e=>e.fieldDefs),c=(0,a.U)(e=>e.reorderSection);(0,l.useEffect)(()=>{i(e.name,s,t,e.fields)},[e.name,s,t,e.fields,i]);let m=function(e){let t=[],s=[];for(let[r,l]of Object.entries(e))"object"!=typeof l||null===l||Array.isArray(l)?s.push([r,l]):(s.length>0&&(t.push({kind:"flat",entries:s}),s=[]),t.push({kind:"object",key:r,data:l}));return s.length>0&&t.push({kind:"flat",entries:s}),t}(o),x=function(e,t){let s=Object.entries(e).filter(([,e])=>"string"==typeof e).map(([e])=>e);for(let e of I)if(s.includes(e))return e;for(let e of s)if(t[e]?.type==="long-text")return e;for(let t of s){let s=e[t];if(s.length>200||s.includes("\n"))return t}return null}(o,d);return(0,r.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,r.jsx)(u,{collectionName:e.name,hasSync:n}),(0,r.jsx)(T.ScrollArea,{className:"studio-canvas",children:(0,r.jsx)("div",{className:"h-full w-full px-4 py-4 md:px-6",children:(0,r.jsxs)("div",{className:"studio-surface flex min-h-full flex-col gap-6 p-6",children:[m.map((e,t)=>{let s=t>0?()=>c("flat"===e.kind?"__flat__":e.key,"up"):void 0,l=t<m.length-1?()=>c("flat"===e.kind?"__flat__":e.key,"down"):void 0;return"flat"===e.kind?(0,r.jsx)(y,{title:"General",sectionKey:"__flat__",defaultOpen:!0,footer:(0,r.jsx)(F,{path:""}),onMoveUp:s,onMoveDown:l,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:e.entries.map(([e,t])=>(0,r.jsx)(_,{fieldKey:e,path:e,value:t,isRichText:e===x},e))})},"__flat__"):(0,r.jsx)(y,{title:(0,A.w)(e.key),sectionKey:e.key,defaultOpen:!0,footer:(0,r.jsx)(F,{path:e.key}),onMoveUp:s,onMoveDown:l,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(e.data).map(([t,s])=>(0,r.jsx)(_,{fieldKey:t,path:`${e.key}.${t}`,value:s},t))})},e.key)}),(0,r.jsx)(E,{})]})})})]})}},22149:(e,t,s)=>{"use strict";s.d(t,{q:()=>l});var r=s(3581);let l=(0,r.createServerReference)("604f4e90a3fde422e932bcfb8973298550fd47add9",r.callServer,void 0,r.findSourceMapURL,"saveCollectionJson")},25471:(e,t,s)=>{"use strict";s.d(t,{Toaster:()=>x,o:()=>m});var r=s(94799),l=s(34023),a=s(8249),n=s(20704);let i=[],o=new Set;function d(e){return o.add(e),()=>o.delete(e)}function c(){return i}function u(){for(let e of(i=[...i],o))e()}function m(e,t="default"){let s=Math.random().toString(36).slice(2);i=[...i,{id:s,message:e,variant:t}],u(),setTimeout(()=>{i=i.filter(e=>e.id!==s),u()},4e3)}function x(){let e=(0,l.useSyncExternalStore)(d,c,c);return 0===e.length?null:(0,r.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-2 rounded-lg border bg-background px-4 py-3 shadow-lg animate-in slide-in-from-bottom-2","error"===e.variant&&"border-destructive/50 text-destructive","success"===e.variant&&"border-green-500/50"),children:[(0,r.jsx)("span",{className:"text-sm",children:e.message}),(0,r.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void(i=i.filter(e=>e.id!==t),u())},className:"ml-2 rounded-sm p-0.5 hover:bg-accent",children:(0,r.jsx)(n.A,{className:"h-3 w-3"})})]},e.id))})}},31507:(e,t,s)=>{"use strict";s.d(t,{J:()=>i});var r=s(94799),l=s(34023),a=s(99946),n=s(8249);let i=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)(a.b,{ref:s,className:(0,n.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));i.displayName="Label"},32115:(e,t,s)=>{"use strict";function r(e){var t;return(t={name:e}).label?t.label:t.name.replace(/[-_](.)/g,(e,t)=>` ${t.toUpperCase()}`).replace(/([A-Z])/g," $1").trim().replace(/\b\w/g,e=>e.toUpperCase())}s.d(t,{w:()=>r})},38014:(e,t,s)=>{"use strict";s.d(t,{U:()=>a});var r=s(80916),l=s(78789);let a=(0,r.v)((e,t)=>({isDirty:!1,isSaving:!1,collectionName:"",filePath:"",editorType:null,fieldDefs:{},rows:[],selectedRowIndex:null,sortColumn:null,sortDirection:"asc",visibleColumns:new Set,hasCustomVisibility:!1,isMdx:!1,rowFilePaths:[],rowBodies:[],rowSlugs:[],formData:{},expandedSections:[],initSheet:(t,s,r,l,a)=>{let n=new Set,i=!1;try{let e=localStorage.getItem(`studio:columns:${t}`);e&&(n=new Set(JSON.parse(e)),i=!0)}catch{}e({editorType:"sheet",collectionName:t,filePath:s,rows:r,isMdx:!!l,rowFilePaths:l?.map(e=>e.filePath)??[],rowBodies:l?.map(e=>e.body)??[],rowSlugs:l?.map(e=>e.slug)??[],isDirty:!1,isSaving:!1,selectedRowIndex:null,sortColumn:null,sortDirection:"asc",fieldDefs:Object.fromEntries((a??[]).map(e=>[e.name,e])),visibleColumns:n,hasCustomVisibility:i})},initForm:(t,s,r,l)=>{let a=Object.entries(r).filter(([,e])=>"object"==typeof e&&null!==e&&!Array.isArray(e)).map(([e])=>e);e({editorType:"form",collectionName:t,filePath:s,formData:r,expandedSections:a,isDirty:!1,isSaving:!1,fieldDefs:Object.fromEntries((l??[]).map(e=>[e.name,e]))})},updateCell:(t,s,r)=>e(e=>{let l=[...e.rows];return l[t]={...l[t],[s]:r},{rows:l,isDirty:!0}}),addRow:()=>e(e=>{let t={};if(e.rows.length>0)for(let s of Object.keys(e.rows[0])){let r=e.rows[0][s];"boolean"==typeof r?t[s]=!1:"number"==typeof r?t[s]=0:t[s]=""}return{rows:[...e.rows,t],isDirty:!0}}),deleteRow:t=>e(e=>({rows:e.rows.filter((e,s)=>s!==t),rowFilePaths:e.rowFilePaths.filter((e,s)=>s!==t),rowBodies:e.rowBodies.filter((e,s)=>s!==t),rowSlugs:e.rowSlugs.filter((e,s)=>s!==t),selectedRowIndex:e.selectedRowIndex===t?null:e.selectedRowIndex,isDirty:!0})),selectRow:t=>e({selectedRowIndex:t}),sortBy:t=>e(e=>{let s=e.sortColumn===t&&"asc"===e.sortDirection?"desc":"asc",r=e.rows.map((t,s)=>({row:t,filePath:e.rowFilePaths[s]??"",body:e.rowBodies[s]??"",slug:e.rowSlugs[s]??""})),a=(0,l.A)(r,[e=>e.row[t]],[s]);return{rows:a.map(e=>e.row),rowFilePaths:a.map(e=>e.filePath),rowBodies:a.map(e=>e.body),rowSlugs:a.map(e=>e.slug),sortColumn:t,sortDirection:s,selectedRowIndex:null}}),updateField:(t,s)=>e(e=>{let r=structuredClone(e.formData),l=t.split("."),a=r;for(let e=0;e<l.length-1;e++)("object"!=typeof a[l[e]]||null===a[l[e]])&&(a[l[e]]={}),a=a[l[e]];return a[l[l.length-1]]=s,{formData:r,isDirty:!0}}),addField:(t,s,r)=>e(e=>{let l=structuredClone(e.formData);if(t){let e=t.split("."),a=l;for(let t of e)a=a[t];a[s]=r}else l[s]=r;return{formData:l,isDirty:!0}}),toggleSection:t=>e(e=>({expandedSections:e.expandedSections.includes(t)?e.expandedSections.filter(e=>e!==t):[...e.expandedSections,t]})),reorderSection:(t,s)=>e(e=>{let r=Object.entries(e.formData),l=[],a=[];for(let e=0;e<r.length;e++){let t=r[e][1];"object"!=typeof t||null===t||Array.isArray(t)?a.push(e):(a.length>0&&(l.push(a),a=[]),l.push([e]))}a.length>0&&l.push(a);let n=l.findIndex(e=>"__flat__"===t?e.some(e=>{let t=r[e][1];return!("object"==typeof t&&null!==t&&!Array.isArray(t))}):e.some(e=>r[e][0]===t));if(-1===n)return{};let i="up"===s?n-1:n+1;if(i<0||i>=l.length)return{};let o=[...l];return[o[n],o[i]]=[o[i],o[n]],{formData:Object.fromEntries(o.flat().map(e=>r[e])),isDirty:!0}}),deleteField:t=>e(e=>{let s=structuredClone(e.formData),r=t.split("."),l=r.pop(),a=s;for(let e of r){if("object"!=typeof a[e]||null===a[e])return{};a=a[e]}return delete a[l],{formData:s,isDirty:!0}}),reorderField:(t,s)=>e(e=>{let r=structuredClone(e.formData),l=t.split("."),a=l.pop(),n=r;for(let e of l){if("object"!=typeof n[e]||null===n[e])return{};n=n[e]}let i=Object.entries(n),o=i.findIndex(([e])=>e===a);if(-1===o)return{};let d="up"===s?o-1:o+1;if(d<0||d>=i.length)return{};[i[o],i[d]]=[i[d],i[o]];let c=Object.fromEntries(i);if(0===l.length)return{formData:c,isDirty:!0};let u=r;for(let e=0;e<l.length-1;e++)u=u[l[e]];return u[l[l.length-1]]=c,{formData:r,isDirty:!0}}),toggleColumnVisibility:t=>e(e=>{if(!e.hasCustomVisibility){let s=new Set;for(let t of e.rows)for(let e of Object.keys(t))s.add(e);let r=new Set(Array.from(s).slice(0,5));r.has(t)?r.delete(t):r.add(t);try{localStorage.setItem(`studio:columns:${e.collectionName}`,JSON.stringify([...r]))}catch{}return{visibleColumns:r,hasCustomVisibility:!0}}let s=new Set(e.visibleColumns);s.has(t)?s.delete(t):s.add(t);try{localStorage.setItem(`studio:columns:${e.collectionName}`,JSON.stringify([...s]))}catch{}return{visibleColumns:s}}),resetColumnVisibility:()=>e(e=>{try{localStorage.removeItem(`studio:columns:${e.collectionName}`)}catch{}return{visibleColumns:new Set,hasCustomVisibility:!1}}),isColumnVisible:(e,s)=>{let r=t();if(!r.hasCustomVisibility){let t=s.indexOf(e);return t>=0&&t<5}return r.visibleColumns.has(e)},markClean:()=>e({isDirty:!1,isSaving:!1}),getSerializedJson:()=>{let e=t();return"sheet"===e.editorType?JSON.stringify(e.rows,null,2):JSON.stringify(e.formData,null,2)},getMdxSources:()=>{let e=t();return e.rows.map((t,s)=>({filePath:e.rowFilePaths[s]??"",frontmatter:t,body:e.rowBodies[s]??""}))}}))},39074:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var r=s(3581);let l=(0,r.createServerReference)("401d4fc3f2e4c29611b3858f484ba729bf121b3d1a",r.callServer,void 0,r.findSourceMapURL,"saveMdxFrontmatter")},42939:(e,t,s)=>{"use strict";s.d(t,{SidebarCacheWriter:()=>a,z:()=>l.z});var r=s(34023),l=s(8249);function a({collections:e}){return(0,r.useEffect)(()=>{(0,l.m)(e)},[e]),null}},45045:(e,t,s)=>{"use strict";s.d(t,{JsonSheetEditor:()=>I});var r=s(94799),l=s(34023),a=s(38014),n=s(39074),i=s(22149),o=s(82058),d=s(15968),c=s(59256),u=s(92935),m=s(69360),x=s(25471),f=s(32115);function h({collectionName:e,hasSync:t,locales:s,selectedLocale:u,onLocaleChange:f}){let h=(0,a.U)(e=>e.isDirty),g=(0,a.U)(e=>e.filePath),b=(0,a.U)(e=>e.isMdx),v=(0,a.U)(e=>e.addRow),j=(0,a.U)(e=>e.getSerializedJson),y=(0,a.U)(e=>e.getMdxSources),w=(0,a.U)(e=>e.markClean),[N,S]=(0,l.useTransition)(),k=(0,l.useCallback)(()=>{h&&!N&&S(async()=>{let e=b?await (0,n.Z)(y()):await (0,i.q)(g,j());e.success?(w(),(0,x.o)("Saved successfully","success")):(0,x.o)(e.error??"Save failed","error")})},[h,N,b,g,y,j,w,S]),[C,A]=(0,l.useState)(!1),U=(0,l.useCallback)(async()=>{if(!C){A(!0);try{let t=await fetch(`/api/sync/${e}`,{method:"POST"}),s=await t.json();t.ok&&s.success?((0,x.o)("Sync completed","success"),window.location.reload()):(0,x.o)(s.error??"Sync failed","error")}catch{(0,x.o)("Sync failed","error")}finally{A(!1)}}},[e,C]);return(0,m.K)({onSave:k}),(0,r.jsxs)("div",{className:"studio-topbar",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[14px]",children:[(0,r.jsx)("span",{className:"font-bold capitalize tracking-tight",children:e}),h&&(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-foreground/40"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[s&&s.length>1&&(0,r.jsx)("div",{className:"flex items-center rounded-md border overflow-hidden",children:s.map(e=>{let t=e??"default",s=e===u;return(0,r.jsx)("button",{onClick:()=>f?.(e),className:`h-7 px-2.5 text-xs font-medium transition-colors ${s?"bg-foreground text-background":"bg-transparent text-foreground/60 hover:text-foreground"}`,children:t},t)})}),(0,r.jsx)(p,{}),t&&(0,r.jsxs)(o.$,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:U,disabled:C,children:[(0,r.jsx)(d.A,{className:`h-3.5 w-3.5 ${C?"animate-spin":""}`}),C?"Syncing…":"Sync"]}),!b&&(0,r.jsxs)(o.$,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:v,children:[(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"}),"Add Row"]}),(0,r.jsx)(o.$,{size:"sm",className:"h-7 px-3 text-xs",onClick:k,disabled:!h||N,children:N?"Saving…":"Save"})]})]})}function p(){let e=(0,a.U)(e=>e.rows),t=(0,a.U)(e=>e.fieldDefs),s=(0,a.U)(e=>e.visibleColumns),n=(0,a.U)(e=>e.hasCustomVisibility),i=(0,a.U)(e=>e.toggleColumnVisibility),d=(0,a.U)(e=>e.resetColumnVisibility),[c,m]=(0,l.useState)(!1),x=(0,l.useRef)(null),h=(0,l.useMemo)(()=>{let t=new Set;for(let s of e)for(let e of Object.keys(s))t.add(e);return Array.from(t)},[e]);return((0,l.useEffect)(()=>{if(!c)return;let e=e=>{x.current&&!x.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]),0===h.length)?null:(0,r.jsxs)("div",{className:"relative",ref:x,children:[(0,r.jsxs)(o.$,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:()=>m(!c),children:[(0,r.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Columns"]}),c&&(0,r.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 rounded-md border bg-background py-1 shadow-lg",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5",children:[(0,r.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Visible columns"}),n&&(0,r.jsx)("button",{type:"button",onClick:d,className:"text-[10px] text-muted-foreground hover:text-foreground",children:"Reset"})]}),(0,r.jsx)("div",{className:"max-h-64 overflow-auto",children:h.map((e,l)=>{let a=n?s.has(e):l<5,o=t[e]?.label??(0,f.w)(e);return(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 px-3 py-1 text-xs hover:bg-accent",children:[(0,r.jsx)("input",{type:"checkbox",checked:a,onChange:()=>i(e),className:"h-3.5 w-3.5 rounded border-input"}),(0,r.jsx)("span",{className:"truncate",children:o})]},e)})})]})]})}var g=s(1727),b=s(65976),v=s(57084);function j(e){let t=String(e);return t.length<=100?t:`${t.slice(0,97)}…`}function y({value:e}){let t;return(0,r.jsx)("span",{className:"block truncate px-1 py-0.5",children:null==e?(0,r.jsx)("span",{className:"text-muted-foreground",children:"—"}):"boolean"==typeof e?e?"true":"false":e instanceof Date?j(e.toISOString().split("T")[0]):Array.isArray(e)?(0,r.jsx)("span",{className:"text-muted-foreground",children:function(e){if(0===e.length)return"[]";if(e.every(e=>"object"!=typeof e||null===e)){let t=e.join(", ");return t.length>60?`${t.slice(0,57)}…`:t}return`${e.length} item${1!==e.length?"s":""}`}(e)}):"object"==typeof e?(0,r.jsx)("span",{className:"text-muted-foreground",children:0===(t=Object.keys(e)).length?"{}":t.length<=3?`{ ${t.join(", ")} }`:`{ ${t.slice(0,2).join(", ")}, +${t.length-2} }`}):j(e)})}var w=s(8249);let N=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{className:"relative h-full w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,w.cn)("w-full caption-bottom text-sm",e),...t})}));N.displayName="Table";let S=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("thead",{ref:s,className:(0,w.cn)("[&_tr]:border-b",e),...t}));S.displayName="TableHeader";let k=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("tbody",{ref:s,className:(0,w.cn)("[&_tr:last-child]:border-0",e),...t}));k.displayName="TableBody";let C=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("tr",{ref:s,className:(0,w.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));C.displayName="TableRow";let A=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("th",{ref:s,className:(0,w.cn)("h-10 px-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));A.displayName="TableHead";let U=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)("td",{ref:s,className:(0,w.cn)("px-3 py-2 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));U.displayName="TableCell";var D=s(4516),R=s(26829),$=s(20301),O=s(54916),_=s(57997),J=s(31507),z=s(54994),P=s(20704),F=s(81268);let M=(0,O.default)(()=>Promise.all([s.e(4841),s.e(5942),s.e(8814),s.e(8800)]).then(s.bind(s,28800)).then(e=>e.RichTextField),{loadableGenerated:{webpack:()=>[28800]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"h-[120px] animate-pulse rounded-md border bg-muted/30"})});function E({rowIndex:e}){let t=(0,g.useRouter)(),s=(0,a.U)(e=>e.rows),l=(0,a.U)(e=>e.updateCell),n=(0,a.U)(e=>e.selectRow),i=(0,a.U)(e=>e.deleteRow),d=(0,a.U)(e=>e.fieldDefs),c=(0,a.U)(e=>e.isMdx),u=(0,a.U)(e=>e.collectionName),m=(0,a.U)(e=>e.rowSlugs);if(!s[e])return null;let x=Object.entries(s[e]);return(0,r.jsxs)("div",{className:"border-l-2 border-l-foreground/20 bg-muted/40",children:[(0,r.jsxs)("div",{className:"flex h-10 items-center justify-between border-b px-4",children:[(0,r.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wide text-foreground/80",children:["Row details - ",e+1]}),(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[c&&(0,r.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",title:"Edit entry",onClick:()=>t.push(`/collection/${u}/${m[e]??""}`),children:(0,r.jsx)(R.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",title:"Delete row",onClick:()=>{i(e),n(null)},children:(0,r.jsx)($.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>n(null),children:(0,r.jsx)(P.A,{className:"h-4 w-4"})})]})]}),(0,r.jsx)("div",{className:"flex max-h-80 flex-col gap-2 overflow-auto px-4 py-3",children:x.map(([t,s])=>(function(t,s){let a=d[t],n=a?.type,i=a?.label??(0,f.w)(t);if("boolean"===n||!n&&"boolean"==typeof s)return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(z.d,{checked:!!s,onCheckedChange:s=>l(e,t,s)})]},t);if("date"===n){let n=a.includeTime;return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:n?"datetime-local":"date",value:String(s??""),onChange:s=>l(e,t,s.target.value),className:"h-7 w-40 text-sm"})]},t)}if("created-time"===n||"updated-time"===n)return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"text",value:String(s??""),readOnly:!0,className:"h-7 w-40 cursor-default text-sm opacity-60"})]},t);if("email"===n)return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"email",value:String(s??""),onChange:s=>l(e,t,s.target.value),className:"h-7 w-40 text-sm"})]},t);if("url"===n)return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"url",value:String(s??""),onChange:s=>l(e,t,s.target.value),className:"h-7 w-40 text-sm"})]},t);if("select"===n||"status"===n){let n=a.options??[];return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(F.m,{value:String(s??""),onChange:s=>l(e,t,s),options:[{label:"—",value:""},...n],className:"h-7 w-40 px-2"})]},t)}if("multi-select"===n){let n=a.options??[],o=Array.isArray(s)?s:[];return(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate pt-1 text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[n.map(s=>{let a=o.includes(s.value);return(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-1 text-xs",children:[(0,r.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{l(e,t,a?o.filter(e=>e!==s.value):[...o,s.value])},className:"h-3 w-3 rounded border-input accent-foreground"}),s.label]},s.value)}),0===n.length&&(0,r.jsx)(_.p,{type:"text",value:o.join(", "),onChange:s=>l(e,t,s.target.value.split(",").map(e=>e.trim()).filter(Boolean)),className:"h-7 w-40 text-sm"})]})]},t)}return"number"!==n&&(n||"number"!=typeof s)?Array.isArray(s)?s.every(e=>"object"!=typeof e||null===e)?(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"text",value:s.join(", "),onChange:s=>l(e,t,s.target.value.split(",").map(e=>e.trim()).filter(Boolean)),className:"h-7 w-40 text-sm"})]},t):(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate pt-1 text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)("pre",{className:"max-h-32 flex-1 overflow-auto rounded border bg-muted/50 px-2 py-1 text-xs",children:JSON.stringify(s,null,2)})]},t):"object"==typeof s&&null!==s?(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate pt-1 text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)("div",{className:"flex flex-1 flex-col gap-1.5 border-l pl-3",children:Object.entries(s).map(([a,n])=>"object"==typeof n&&null!==n?(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)(J.J,{className:"w-24 shrink-0 truncate pt-1 text-xs text-muted-foreground",children:(0,f.w)(a)}),(0,r.jsx)("pre",{className:"max-h-24 flex-1 overflow-auto rounded border bg-muted/50 px-2 py-1 text-xs",children:JSON.stringify(n,null,2)})]},a):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(J.J,{className:"w-24 shrink-0 truncate text-xs text-muted-foreground",children:(0,f.w)(a)}),"boolean"==typeof n?(0,r.jsx)(z.d,{checked:n,onCheckedChange:r=>{l(e,t,{...s,[a]:r})}}):"number"==typeof n?(0,r.jsx)(_.p,{type:"number",value:String(n),onChange:r=>{let n=Number(r.target.value);l(e,t,{...s,[a]:Number.isNaN(n)?0:n})},className:"h-6 w-32 text-xs"}):(0,r.jsx)(_.p,{type:"text",value:String(n??""),onChange:r=>{l(e,t,{...s,[a]:r.target.value})},className:"h-6 w-32 text-xs"})]},a))})]},t):"string"==typeof s&&("long-text"===n||s.length>200||s.includes("\n"))?(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)(J.J,{className:"text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(M,{value:s,onChange:s=>l(e,t,s),placeholder:"Start writing..."})]},t):(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"text",value:String(s??""),onChange:s=>l(e,t,s.target.value),className:"h-7 w-40 text-sm"})]},t):(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(J.J,{className:"w-36 shrink-0 truncate text-xs font-semibold text-muted-foreground",children:i}),(0,r.jsx)(_.p,{type:"number",value:String(s??0),onChange:s=>{let r=Number(s.target.value);l(e,t,Number.isNaN(r)?0:r)},className:"h-7 w-40 text-sm"})]},t)})(t,s))})]})}function T(){let e=(0,g.useRouter)(),t=(0,a.U)(e=>e.rows),s=(0,a.U)(e=>e.sortColumn),n=(0,a.U)(e=>e.sortDirection),i=(0,a.U)(e=>e.selectedRowIndex),d=(0,a.U)(e=>e.isMdx),c=(0,a.U)(e=>e.collectionName),u=(0,a.U)(e=>e.fieldDefs),m=(0,a.U)(e=>e.rowSlugs),x=(0,a.U)(e=>e.sortBy),h=(0,a.U)(e=>e.selectRow),p=(0,a.U)(e=>e.deleteRow),j=(0,a.U)(e=>e.visibleColumns),O=(0,a.U)(e=>e.hasCustomVisibility),_=(0,l.useMemo)(()=>{let e=new Set;for(let s of t)for(let t of Object.keys(s))e.add(t);return Array.from(e)},[t]),J=(0,l.useMemo)(()=>_.filter(e=>O?j.has(e):5>_.indexOf(e)),[_,j,O]),z=(0,l.useMemo)(()=>[...J.map(e=>({accessorKey:e,header:()=>(0,r.jsxs)("button",{className:"flex items-center gap-1 text-xs font-semibold uppercase tracking-wide hover:text-foreground",onClick:()=>x(e),children:[u[e]?.label??(0,f.w)(e),(0,r.jsx)(D.A,{className:(0,w.cn)("h-3 w-3",s===e?"text-foreground":"text-muted-foreground")}),s===e&&(0,r.jsx)("span",{className:"text-xs",children:"asc"===n?"↑":"↓"})]}),cell:({row:t})=>(0,r.jsx)(y,{value:t.original[e]})})),{id:"actions",header:()=>(0,r.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Actions"}),cell:({row:t})=>(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[d&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:s=>{s.stopPropagation(),e.push(`/collection/${c}/${m[t.index]??""}`)},children:(0,r.jsx)(R.A,{className:"h-3.5 w-3.5"})})}),(0,r.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:e=>{e.stopPropagation(),p(t.index)},children:(0,r.jsx)($.A,{className:"h-3.5 w-3.5"})})]}),size:d?72:40}],[J,s,n,x,p,d,c,m,e,u]),P=(0,b.N4)({data:t,columns:z,getCoreRowModel:(0,v.HT)()});return(0,r.jsxs)(N,{children:[(0,r.jsx)(S,{children:P.getHeaderGroups().map(e=>(0,r.jsx)(C,{children:e.headers.map(e=>(0,r.jsx)(A,{children:e.isPlaceholder?null:(0,b.Kv)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(k,{children:0===P.getRowModel().rows.length?(0,r.jsx)(C,{children:(0,r.jsx)(U,{colSpan:z.length,className:"h-24 text-center text-muted-foreground",children:"No data"})}):P.getRowModel().rows.map(e=>(0,r.jsx)(l.Fragment,{children:i===e.index?(0,r.jsx)(C,{children:(0,r.jsx)(U,{colSpan:z.length,className:"p-0",children:(0,r.jsx)(E,{rowIndex:e.index})})}):(0,r.jsx)(C,{"data-state":void 0,className:(0,w.cn)("cursor-pointer",!0===e.original.draft&&"opacity-50"),onClick:()=>h(e.index),children:e.getVisibleCells().map(e=>(0,r.jsx)(U,{children:(0,b.Kv)(e.column.columnDef.cell,e.getContext())},e.id))})},e.id))})]})}function I({collection:e,entries:t,filePath:s,hasSync:n}){let i=(0,a.U)(e=>e.initSheet),o=(0,l.useMemo)(()=>{let e=new Set,s=[];for(let r of t){let t=r.locale??"__base__";e.has(t)||(e.add(t),s.push(r.locale))}return s},[t]),d=o.length>1,[c,u]=(0,l.useState)(void 0),m=(0,l.useMemo)(()=>d?t.filter(e=>e.locale===c):t,[t,c,d]);return(0,l.useEffect)(()=>{let t=m.map(e=>e.data),r="mdx"===e.type?m.map(e=>({slug:e.slug,filePath:e.filePath,body:e.body??""})):void 0;i(e.name,s,t,r,e.fields)},[e.name,e.type,e.fields,s,m,i]),(0,r.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,r.jsx)(h,{collectionName:e.name,hasSync:n,locales:d?o:void 0,selectedLocale:c,onLocaleChange:u}),(0,r.jsx)("div",{className:"studio-canvas px-4 py-4 md:px-6",children:(0,r.jsx)("div",{className:"h-full overflow-hidden rounded-xl border bg-card",children:(0,r.jsx)(T,{})})})]})}},52917:(e,t,s)=>{"use strict";s.d(t,{ThemeToggle:()=>d});var r=s(94799),l=s(86846),a=s(34023),n=s(8802),i=s(6933),o=s(82058);function d(){let{theme:e,setTheme:t}=(0,l.D)(),[s,d]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{d(!0)},[]),s)?(0,r.jsxs)(o.$,{variant:"ghost",size:"icon",onClick:()=>t("dark"===e?"light":"dark"),children:["dark"===e?(0,r.jsx)(n.A,{className:"h-4 w-4"}):(0,r.jsx)(i.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle theme"})]}):(0,r.jsx)(o.$,{variant:"ghost",size:"icon",disabled:!0,children:(0,r.jsx)(n.A,{className:"h-4 w-4"})})}},54994:(e,t,s)=>{"use strict";s.d(t,{d:()=>i});var r=s(94799),l=s(34023),a=s(41353),n=s(8249);let i=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)(a.bL,{className:(0,n.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:(0,r.jsx)(a.zi,{className:(0,n.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));i.displayName="Switch"},57997:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var r=s(94799),l=s(34023),a=s(8249);let n=l.forwardRef(({className:e,type:t,...s},l)=>(0,r.jsx)("input",{type:t,className:(0,a.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:l,...s}));n.displayName="Input"},69360:(e,t,s)=>{"use strict";s.d(t,{K:()=>l});var r=s(34023);function l({onSave:e,onEscape:t}){(0,r.useEffect)(()=>{function s(s){(s.ctrlKey||s.metaKey)&&"s"===s.key&&(s.preventDefault(),e?.()),"Escape"===s.key&&t?.()}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t])}},81268:(e,t,s)=>{"use strict";s.d(t,{m:()=>a});var r=s(94799),l=s(8249);function a({value:e,onChange:t,options:s,className:a}){return(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})}},82058:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var r=s(94799),l=s(34023),a=s(10086),n=s(8249);let i=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=l.forwardRef(({className:e,variant:t,size:s,...l},a)=>(0,r.jsx)("button",{className:(0,n.cn)(i({variant:t,size:s,className:e})),ref:a,...l}));o.displayName="Button"},83008:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,68202,23)),Promise.resolve().then(s.bind(s,52917)),Promise.resolve().then(s.bind(s,3777)),Promise.resolve().then(s.bind(s,14756)),Promise.resolve().then(s.bind(s,45045)),Promise.resolve().then(s.bind(s,42939))}},e=>{e.O(0,[3098,2462,7722,3987,6299,3212,7408,1858,7358],()=>e(e.s=83008)),_N_E=e.O()}]);