@shepai/cli 1.69.0 → 1.70.1

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 (136) hide show
  1. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts +1 -1
  2. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts.map +1 -1
  3. package/dist/packages/core/src/infrastructure/services/deployment/deployment-logger.d.ts +7 -0
  4. package/dist/packages/core/src/infrastructure/services/deployment/deployment-logger.d.ts.map +1 -0
  5. package/dist/packages/core/src/infrastructure/services/deployment/deployment-logger.js +17 -0
  6. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map +1 -1
  7. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.js +60 -7
  8. package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map +1 -1
  9. package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.js +13 -6
  10. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts +2 -1
  11. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts.map +1 -1
  12. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.js +17 -2
  13. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts +1 -1
  14. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/CLAUDE.md +45 -18
  16. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/alacritty.json +18 -0
  17. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/iterm2.json +17 -0
  18. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/kitty.json +18 -0
  19. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/tmux.json +27 -0
  20. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/warp.json +17 -0
  21. package/dist/src/presentation/web/app/actions/deploy-feature.d.ts.map +1 -1
  22. package/dist/src/presentation/web/app/actions/deploy-feature.js +11 -0
  23. package/dist/src/presentation/web/app/actions/deploy-repository.d.ts.map +1 -1
  24. package/dist/src/presentation/web/app/actions/deploy-repository.js +8 -0
  25. package/dist/src/presentation/web/components/features/tools/tool-card.d.ts.map +1 -1
  26. package/dist/src/presentation/web/components/features/tools/tool-card.js +1 -0
  27. package/dist/src/presentation/web/components/features/tools/tools-page-client.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/features/tools/tools-page-client.js +2 -1
  29. package/dist/src/presentation/web/hooks/use-deploy-action.d.ts.map +1 -1
  30. package/dist/src/presentation/web/hooks/use-deploy-action.js +36 -5
  31. package/dist/tsconfig.build.tsbuildinfo +1 -1
  32. package/package.json +1 -1
  33. package/web/.next/BUILD_ID +1 -1
  34. package/web/.next/build-manifest.json +2 -2
  35. package/web/.next/cache/.previewinfo +1 -1
  36. package/web/.next/cache/.rscinfo +1 -1
  37. package/web/.next/cache/.tsbuildinfo +1 -1
  38. package/web/.next/cache/config.json +3 -3
  39. package/web/.next/fallback-build-manifest.json +2 -2
  40. package/web/.next/prerender-manifest.json +3 -3
  41. package/web/.next/required-server-files.js +1 -1
  42. package/web/.next/required-server-files.json +1 -1
  43. package/web/.next/server/app/_global-error.html +2 -2
  44. package/web/.next/server/app/_global-error.rsc +1 -1
  45. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  46. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  47. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  48. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  49. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  50. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  51. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/page/server-reference-manifest.json +18 -18
  53. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/skills/page/server-reference-manifest.json +5 -5
  55. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  57. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  59. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/chunks/[root-of-the-server]__09413611._.js.map +1 -1
  61. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  62. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js.map +1 -1
  63. package/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  64. package/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js +1 -1
  65. package/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js.map +1 -1
  66. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  67. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  68. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  69. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  70. package/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js +2 -2
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js.map +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js +2 -2
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js.map +1 -1
  74. package/web/.next/server/chunks/ssr/_49bf495c._.js +1 -1
  75. package/web/.next/server/chunks/ssr/_49bf495c._.js.map +1 -1
  76. package/web/.next/server/chunks/ssr/_68b5e0de._.js +1 -1
  77. package/web/.next/server/chunks/ssr/_68b5e0de._.js.map +1 -1
  78. package/web/.next/server/chunks/ssr/_690ea95f._.js +1 -1
  79. package/web/.next/server/chunks/ssr/_690ea95f._.js.map +1 -1
  80. package/web/.next/server/chunks/ssr/_725584e5._.js +1 -1
  81. package/web/.next/server/chunks/ssr/_725584e5._.js.map +1 -1
  82. package/web/.next/server/pages/500.html +2 -2
  83. package/web/.next/server/server-reference-manifest.js +1 -1
  84. package/web/.next/server/server-reference-manifest.json +19 -19
  85. package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
  86. package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +2 -2
  87. package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
  88. package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +1 -1
  89. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
  90. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +1 -1
  91. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  92. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  93. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  94. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  95. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  96. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  97. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  98. package/web/.next/standalone/src/presentation/web/.next/server/app/page/server-reference-manifest.json +18 -18
  99. package/web/.next/standalone/src/presentation/web/.next/server/app/page_client-reference-manifest.js +1 -1
  100. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page/server-reference-manifest.json +5 -5
  101. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  102. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  103. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  104. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  105. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  106. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  107. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  108. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js +1 -1
  109. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  110. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  111. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js +2 -2
  112. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js +2 -2
  113. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_49bf495c._.js +1 -1
  114. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_68b5e0de._.js +1 -1
  115. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_690ea95f._.js +1 -1
  116. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_725584e5._.js +1 -1
  117. package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
  118. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
  119. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +19 -19
  120. package/web/.next/standalone/src/presentation/web/app/actions/deploy-feature.ts +16 -0
  121. package/web/.next/standalone/src/presentation/web/app/actions/deploy-repository.ts +10 -0
  122. package/web/.next/standalone/src/presentation/web/components/features/tools/tool-card.tsx +1 -0
  123. package/web/.next/standalone/src/presentation/web/components/features/tools/tools-page-client.tsx +5 -1
  124. package/web/.next/standalone/src/presentation/web/hooks/use-deploy-action.ts +45 -5
  125. package/web/.next/standalone/src/presentation/web/server.js +1 -1
  126. package/web/.next/static/chunks/16e380b8dd9d11bc.js +1 -0
  127. package/web/.next/static/chunks/{5bc5d426870feb7e.js → 1ed0df845a1625f6.js} +1 -1
  128. package/web/.next/static/chunks/{2da52289a4a8f9e2.js → 24e1d97cab8bad6d.js} +1 -1
  129. package/web/.next/static/chunks/{491ae2bbae40857c.js → 505c6a9e4c5d0808.js} +1 -1
  130. package/web/.next/static/chunks/{5ef9d8b7401f2f1f.js → 9db5c06001f3e664.js} +2 -2
  131. package/web/.next/trace +1 -1
  132. package/web/.next/trace-build +1 -1
  133. package/web/.next/static/chunks/faf8ad4c823884d7.js +0 -1
  134. /package/web/.next/static/{7ktIn83yR3rYLLF00uLSx → 8xZoRkWykApYNlvamCGUe}/_buildManifest.js +0 -0
  135. /package/web/.next/static/{7ktIn83yR3rYLLF00uLSx → 8xZoRkWykApYNlvamCGUe}/_clientMiddlewareManifest.json +0 -0
  136. /package/web/.next/static/{7ktIn83yR3rYLLF00uLSx → 8xZoRkWykApYNlvamCGUe}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
1
  (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25661,(e,t,n)=>{"use strict";var r=e.r(79054),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,c=r[1];return l(function(){o.value=n,o.getSnapshot=t,u(o)&&c({inst:o})},[e,n,t]),a(function(){return u(o)&&c({inst:o}),e(function(){u(o)&&c({inst:o})})},[e]),s(n),n};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},56032,(e,t,n)=>{"use strict";t.exports=e.r(25661)},20206,(e,t,n)=>{"use strict";var r=e.r(79054),o=e.r(56032),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,u=r.useMemo,c=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=l(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=a(e,(d=u(function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return l=t}return l=e}if(t=l,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,l=n)}var a,l,s=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,o]))[0],d[1]);return s(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},96482,(e,t,n)=>{"use strict";t.exports=e.r(20206)},47904,(e,t,n)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:n,blurHeight:r,blurDataURL:o,objectFit:i}){let a=n?40*n:e,l=r?40*r:t,s=a&&l?`viewBox='0 0 ${a} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${s}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${s?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${o}'/%3E%3C/svg%3E`}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},49261,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return a}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let i=["default","imgix","cloudinary","akamai","custom"],a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},81241,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImgProps",{enumerable:!0,get:function(){return u}}),e.r(24270);let r=e.r(22193),o=e.r(47904),i=e.r(49261),a=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function s(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:n=!1,priority:u=!1,preload:c=!1,loading:d,className:f,quality:h,width:p,height:m,fill:g=!1,style:x,overrideSrc:y,onLoad:v,onLoadingComplete:b,placeholder:w="empty",blurDataURL:k,fetchPriority:j,decoding:E="async",layout:C,objectFit:S,objectPosition:N,lazyBoundary:_,lazyRoot:M,...P},R){var A;let I,D,O,{imgConf:T,showAltText:z,blurComplete:L,defaultLoader:B}=R,F=T||i.imageConfigDefault;if("allSizes"in F)I=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),n=F.qualities?.sort((e,t)=>e-t);I={...F,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===B)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let $=P.loader||B;delete P.loader,delete P.srcSet;let H="__next_img_default"in $;if(H){if("custom"===I.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2
2
  Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=$;$=t=>{let{config:n,...r}=t;return e(r)}}if(C){"fill"===C&&(g=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(x={...x,...e});let n={responsive:"100vw",fill:"100vw"}[C];n&&!t&&(t=n)}let V="",q=s(p),U=s(m);if((A=e)&&"object"==typeof A&&(l(A)||void 0!==A.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(D=t.blurWidth,O=t.blurHeight,k=k||t.blurDataURL,V=t.src,!g)if(q||U){if(q&&!U){let e=q/t.width;U=Math.round(t.height*e)}else if(!q&&U){let e=U/t.height;q=Math.round(t.width*e)}}else q=t.width,U=t.height}let X=!u&&!c&&("lazy"===d||void 0===d);(!(e="string"==typeof e?e:V)||e.startsWith("data:")||e.startsWith("blob:"))&&(n=!0,X=!1),I.unoptimized&&(n=!0),H&&!I.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(n=!0);let W=s(h),Y=Object.assign(g?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:S,objectPosition:N}:{},z?{}:{color:"transparent"},x),K=L||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,o.getImageBlurSvg)({widthInt:q,heightInt:U,blurWidth:D,blurHeight:O,blurDataURL:k||"",objectFit:Y.objectFit})}")`:`url("${w}")`,G=a.includes(Y.objectFit)?"fill"===Y.objectFit?"100% 100%":"cover":Y.objectFit,Z=K?{backgroundSize:G,backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Q=function({config:e,src:t,unoptimized:n,width:o,quality:i,sizes:a,loader:l}){if(n){let e=(0,r.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let n=t.includes("?")?"&":"?";t=`${t}${n}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:s,kind:u}=function({deviceSizes:e,allSizes:t},n,r){if(r){let n=/(^|\s)(1?\d?\d)vw/g,o=[];for(let e;e=n.exec(r);)o.push(parseInt(e[2]));if(o.length){let n=.01*Math.min(...o);return{widths:t.filter(t=>t>=e[0]*n),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof n?{widths:e,kind:"w"}:{widths:[...new Set([n,2*n].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,o,a),c=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((n,r)=>`${l({config:e,src:t,quality:i,width:n})} ${"w"===u?n:r+1}${u}`).join(", "),src:l({config:e,src:t,quality:i,width:s[c]})}}({config:I,src:e,unoptimized:n,width:q,quality:W,sizes:t,loader:$}),J=X?"lazy":d;return{props:{...P,loading:J,fetchPriority:j,width:q,height:U,decoding:E,className:f,style:{...Y,...Z},sizes:Q.sizes,srcSet:Q.srcSet,src:y||Q.src},meta:{unoptimized:n,preload:c||u,placeholder:w,fill:g}}}},38820,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return l}});let r=e.r(79054),o="u"<typeof window,i=o?()=>{}:r.useLayoutEffect,a=o?()=>{}:r.useEffect;function l(e){let{headManager:t,reduceComponentsToState:n}=e;function l(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return o&&(t?.mountedInstances?.add(e.children),l()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},79646,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return m},defaultHead:function(){return d}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let i=e.r(81258),a=e.r(44066),l=e.r(20314),s=a._(e.r(79054)),u=i._(e.r(38820)),c=e.r(84210);function d(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(24270);let h=["name","httpEquiv","charSet","itemProp"];function p(e){let t,n,r,o;return e.reduce(f,[]).reverse().concat(d().reverse()).filter((t=new Set,n=new Set,r=new Set,o={},e=>{let i=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?i=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?i=!1:n.add(e.type);break;case"meta":for(let t=0,n=h.length;t<n;t++){let n=h[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?i=!1:r.add(n);else{let t=e.props[n],r=o[n]||new Set;("name"!==n||!a)&&r.has(t)?i=!1:(r.add(t),o[n]=r)}}}return i})).reverse().map((e,t)=>{let n=e.key||t;return s.default.cloneElement(e,{key:n})})}let m=function({children:e}){let t=(0,s.useContext)(c.HeadManagerContext);return(0,l.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},5160,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=e.r(81258)._(e.r(79054)),o=e.r(49261),i=r.default.createContext(o.imageConfigDefault)},2880,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(81258)._(e.r(79054)).default.createContext(null)},36200,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,0):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},78200,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(36200),o=e.r(22193);function i({config:e,src:t,width:n,quality:i}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3
3
  Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let a=(0,r.findClosestQuality)(i,e),l=(0,o.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${n}&q=${a}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}i.__next_img_default=!0;let a=i},81819,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Image",{enumerable:!0,get:function(){return b}});let r=e.r(81258),o=e.r(44066),i=e.r(20314),a=o._(e.r(79054)),l=r._(e.r(26036)),s=r._(e.r(79646)),u=e.r(81241),c=e.r(49261),d=e.r(5160);e.r(24270);let f=e.r(2880),h=r._(e.r(78200)),p=e.r(80764),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,n,r,o,i,a){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),n?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,o=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function x(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y=(0,a.forwardRef)(({src:e,srcSet:t,sizes:n,height:r,width:o,decoding:l,className:s,style:u,fetchPriority:c,placeholder:d,loading:f,unoptimized:h,fill:m,onLoadRef:y,onLoadingCompleteRef:v,setBlurComplete:b,setShowAltText:w,sizesInput:k,onLoad:j,onError:E,...C},S)=>{let N=(0,a.useCallback)(e=>{e&&(E&&(e.src=e.src),e.complete&&g(e,d,y,v,b,h,k))},[e,d,y,v,b,E,h,k]),_=(0,p.useMergedRef)(S,N);return(0,i.jsx)("img",{...C,...x(c),loading:f,width:o,height:r,decoding:l,"data-nimg":m?"fill":"1",className:s,style:u,sizes:n,srcSet:t,src:e,ref:_,onLoad:e=>{g(e.currentTarget,d,y,v,b,h,k)},onError:e=>{w(!0),"empty"!==d&&b(!0),E&&E(e)}})});function v({isAppRouter:e,imgAttributes:t}){let n={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,n),null):(0,i.jsx)(s.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...n},"__nimg-"+t.src+t.srcSet+t.sizes)})}let b=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(d.ImageConfigContext),o=(0,a.useMemo)(()=>{let e=m||r||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t),o=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n,qualities:o,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:l,onLoadingComplete:s}=e,p=(0,a.useRef)(l);(0,a.useEffect)(()=>{p.current=l},[l]);let g=(0,a.useRef)(s);(0,a.useEffect)(()=>{g.current=s},[s]);let[x,b]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),{props:j,meta:E}=(0,u.getImgProps)(e,{defaultLoader:h.default,imgConf:o,blurComplete:x,showAltText:w});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{...j,unoptimized:E.unoptimized,placeholder:E.placeholder,fill:E.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:k,sizesInput:e.sizes,ref:t}),E.preload?(0,i.jsx)(v,{isAppRouter:!n,imgAttributes:j}):null]})});("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},78639,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return c},getImageProps:function(){return u}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let i=e.r(81258),a=e.r(81241),l=e.r(81819),s=i._(e.r(78200));function u(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let c=l.Image},98804,(e,t,n)=>{t.exports=e.r(78639)},69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,o=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g;function d(e){return e?e.replace(c,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,c=1;function f(e){var t=e.match(o);t&&(n+=t.length);var r=e.lastIndexOf("\n");c=~r?e.length-r:c+e.length}function h(){var e={line:n,column:c};return function(t){return t.position=new p(e),g(i),t}}function p(e){this.start=e,this.end={line:n,column:c},this.source=t.source}function m(r){var o=Error(t.source+":"+n+":"+c+": "+r);if(o.reason=r,o.filename=t.source,o.line=n,o.column=c,o.source=e,t.silent);else throw o}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function x(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return c+=2,f(r),e=e.slice(n),c+=2,t({type:"comment",comment:r})}}p.prototype.content=e,g(i);var v,b=[];for(x(b);v=function(){var e=h(),t=g(a);if(t){if(y(),!g(l))return m("property missing ':'");var n=g(s),o=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return g(u),o}}();)!1!==v&&(b.push(v),x(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,o.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:o}=e;i?t(r,o,e):o&&((n=n||{})[r]=o)}),n};let o=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,o=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},u=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||i.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(l,u):e.replace(a,u)).replace(o,s))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),o=e.r(51521);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)}),n}i.default=i,t.exports=i},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===o.call(e)},s=function(e){if(!e||"[object Object]"!==o.call(e))return!1;var t,n=r.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,o,i,a,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(t=arguments[f],null!=t)for(n in t)r=c(d,n),d!==(o=c(t,n))&&(p&&o&&(s(o)||(i=l(o)))?(i?(i=!1,a=r&&l(r)?r:[]):a=r&&s(r)?r:{},u(d,{name:n,newValue:e(p,a,o)})):void 0!==o&&u(d,{name:n,newValue:o}));return d}},53271,92002,17840,e=>{"use strict";e.i(44172);var t,n,r,o,i,a,l,s,u,c,d,f,h,p,m,g,x,y=e.i(20314),v=e.i(79054);function b(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)""!==(r=b(e[n]))&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var w={value:()=>{}};function k(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new j(r)}function j(e){this._=e}function E(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=w,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function C(){}function S(e){return null==e?C:function(){return this.querySelector(e)}}function N(){return[]}function _(e){return null==e?N:function(){return this.querySelectorAll(e)}}function M(e){return function(){return this.matches(e)}}function P(e){return function(t){return t.matches(e)}}j.prototype=k.prototype={constructor:j,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=o.length;if(arguments.length<2){for(;++i<a;)if((n=(e=o[i]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=E(r[n],e.name,t);else if(null==t)for(n in r)r[n]=E(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new j(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],i=0,n=r.length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var R=Array.prototype.find;function A(){return this.firstElementChild}var I=Array.prototype.filter;function D(){return Array.from(this.children)}function O(e){return Array(e.length)}function T(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function z(e,t,n,r,o,i){for(var a,l=0,s=t.length,u=i.length;l<u;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new T(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function L(e,t,n,r,o,i,a){var l,s,u,c=new Map,d=t.length,f=i.length,h=Array(d);for(l=0;l<d;++l)(s=t[l])&&(h[l]=u=a.call(s,s.__data__,l,t)+"",c.has(u)?o[l]=s:c.set(u,s));for(l=0;l<f;++l)u=a.call(e,i[l],l,i)+"",(s=c.get(u))?(r[l]=s,s.__data__=i[l],c.delete(u)):n[l]=new T(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&c.get(h[l])===s&&(o[l]=s)}function B(e){return e.__data__}function F(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}T.prototype={constructor:T,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var $="http://www.w3.org/1999/xhtml";let H={svg:"http://www.w3.org/2000/svg",xhtml:$,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function V(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),H.hasOwnProperty(t)?{space:H[t],local:e}:e}function q(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function U(e,t){return e.style.getPropertyValue(t)||q(e).getComputedStyle(e,null).getPropertyValue(t)}function X(e){return e.trim().split(/^|\s+/)}function W(e){return e.classList||new Y(e)}function Y(e){this._node=e,this._names=X(e.getAttribute("class")||"")}function K(e,t){for(var n=W(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function G(e,t){for(var n=W(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Z(){this.textContent=""}function Q(){this.innerHTML=""}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function ee(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function et(e){var t=V(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$&&t.documentElement.namespaceURI===$?t.createElement(e):t.createElementNS(n,e)}})(t)}function en(){return null}function er(){var e=this.parentNode;e&&e.removeChild(this)}function eo(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ei(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ea(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function el(e,t,n){return function(){var r,o=this.__on,i=function(e){t.call(this,e,this.__data__)};if(o){for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function es(e,t,n){var r=q(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}Y.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var eu=[null];function ec(e,t){this._groups=e,this._parents=t}function ed(){return new ec([[document.documentElement]],eu)}function ef(e){return"string"==typeof e?new ec([[document.querySelector(e)]],[document.documentElement]):new ec([[e]],eu)}function eh(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}ec.prototype=ed.prototype={constructor:ec,select:function(e){"function"!=typeof e&&(e=S(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,u=r[o]=Array(s),c=0;c<s;++c)(i=l[c])&&(a=e.call(i,i.__data__,c,l))&&("__data__"in i&&(a.__data__=i.__data__),u[c]=a);return new ec(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=_(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var l,s=n[a],u=s.length,c=0;c<u;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),i.push(l));return new ec(o,i)},selectChild:function(e){var t;return this.select(null==e?A:(t="function"==typeof e?e:P(e),function(){return R.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?D:(t="function"==typeof e?e:P(e),function(){return I.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=M(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new ec(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,B);var n=t?L:z,r=this._parents,o=this._groups;"function"!=typeof e&&(y=e,e=function(){return y});for(var i=o.length,a=Array(i),l=Array(i),s=Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h="object"==typeof(x=e.call(c,c&&c.__data__,u,r))&&"length"in x?x:Array.from(x),p=h.length,m=l[u]=Array(p),g=a[u]=Array(p);n(c,d,m,g,s[u]=Array(f),h,t);for(var x,y,v,b,w=0,k=0;w<p;++w)if(v=m[w]){for(w>=k&&(k=w+1);!(b=g[k])&&++k<p;);v._next=b||null}}return(a=new ec(a,r))._enter=l,a._exit=s,a},enter:function(){return new ec(this._enter||this._groups.map(O),this._parents)},exit:function(){return new ec(this._exit||this._groups.map(O),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),l=Array(o),s=0;s<a;++s)for(var u,c=n[s],d=r[s],f=c.length,h=l[s]=Array(f),p=0;p<f;++p)(u=c[p]||d[p])&&(h[p]=u);for(;s<o;++s)l[s]=n[s];return new ec(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=F);for(var n=this._groups,r=n.length,o=Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,u=o[i]=Array(s),c=0;c<s;++c)(a=l[c])&&(u[c]=a);u.sort(t)}return new ec(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=V(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):U(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=X(e+"");if(arguments.length<2){for(var r=W(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?K:G)(this,e)}}:t?function(e){return function(){K(this,e)}}:function(e){return function(){G(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?Z:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Q:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(ee)},append:function(e){var t="function"==typeof e?e:et(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:et(e),r=null==t?en:"function"==typeof t?t:S(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(er)},clone:function(e){return this.select(e?ei:eo)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=i.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,u=0,c=l.length;u<c;++u)for(r=0,s=l[u];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value}return}for(r=0,l=t?el:ea;r<a;++r)this.each(l(i[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return es(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return es(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};let ep={passive:!1},em={capture:!0,passive:!1};function eg(e){e.stopImmediatePropagation()}function ex(e){e.preventDefault(),e.stopImmediatePropagation()}function ey(e){var t=e.document.documentElement,n=ef(e).on("dragstart.drag",ex,em);"onselectstart"in t?n.on("selectstart.drag",ex,em):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ev(e,t){var n=e.document.documentElement,r=ef(e).on("dragstart.drag",null);t&&(r.on("click.drag",ex,em),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let eb=e=>()=>e;function ew(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:l,dx:s,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function ek(e){return!e.ctrlKey&&!e.button}function ej(){return this.parentNode}function eE(e,t){return null==t?{x:e.x,y:e.y}:t}function eC(){return navigator.maxTouchPoints||"ontouchstart"in this}function eS(){var e,t,n,r,o=ek,i=ej,a=eE,l=eC,s={},u=k("start","drag","end"),c=0,d=0;function f(e){e.on("mousedown.drag",h).filter(l).on("touchstart.drag",g).on("touchmove.drag",x,ep).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,l){if(!r&&o.call(this,a,l)){var s=v(this,i.call(this,a,l),a,l,"mouse");s&&(ef(a.view).on("mousemove.drag",p,em).on("mouseup.drag",m,em),ey(a.view),eg(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function p(r){if(ex(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}s.mouse("drag",r)}function m(e){ef(e.view).on("mousemove.drag mouseup.drag",null),ev(e.view,n),ex(e),s.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=v(this,l,e,t,a[n].identifier,a[n]))&&(eg(e),r("start",e,a[n]))}}function x(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(ex(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=s[o[t].identifier])&&(eg(e),n("end",e,o[t]))}function v(e,t,n,r,o,i){var l,d,h,p=u.copy(),m=eh(i||n,t);if(null!=(h=a.call(e,new ew("beforestart",{sourceEvent:n,target:f,identifier:o,active:c,x:m[0],y:m[1],dx:0,dy:0,dispatch:p}),r)))return l=h.x-m[0]||0,d=h.y-m[1]||0,function n(i,a,u){var g,x=m;switch(i){case"start":s[o]=n,g=c++;break;case"end":delete s[o],--c;case"drag":m=eh(u||a,t),g=c}p.call(i,e,new ew(i,{sourceEvent:a,subject:h,target:f,identifier:o,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-x[0],dy:m[1]-x[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:eb(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:eb(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:eb(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:eb(!!e),f):l},f.on=function(){var e=u.on.apply(u,arguments);return e===u?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f}function eN(e){return((e=Math.exp(e))+1/e)/2}ew.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let e_=function e(t,n,r){function o(e,o){var i,a,l=e[0],s=e[1],u=e[2],c=o[0],d=o[1],f=o[2],h=c-l,p=d-s,m=h*h+p*p;if(m<1e-12)a=Math.log(f/u)/t,i=function(e){return[l+e*h,s+e*p,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),x=(f*f-u*u+r*m)/(2*u*n*g),y=(f*f-u*u-r*m)/(2*f*n*g),v=Math.log(Math.sqrt(x*x+1)-x);a=(Math.log(Math.sqrt(y*y+1)-y)-v)/t,i=function(e){var r,o,i=e*a,c=eN(v),d=u/(n*g)*(c*(((r=Math.exp(2*(r=t*i+v)))-1)/(r+1))-((o=Math.exp(o=v))-1/o)/2);return[l+d*h,s+d*p,u*c/eN(t*i+v)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var eM,eP,eR=0,eA=0,eI=0,eD=0,eO=0,eT=0,ez="object"==typeof performance&&performance.now?performance:Date,eL="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eB(){return eO||(eL(eF),eO=ez.now()+eT)}function eF(){eO=0}function e$(){this._call=this._time=this._next=null}function eH(e,t,n){var r=new e$;return r.restart(e,t,n),r}function eV(){eO=(eD=ez.now())+eT,eR=eA=0;try{eB(),++eR;for(var e,t=eM;t;)(e=eO-t._time)>=0&&t._call.call(void 0,e),t=t._next;--eR}finally{eR=0,function(){for(var e,t,n=eM,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:eM=t);eP=e,eU(r)}(),eO=0}}function eq(){var e=ez.now(),t=e-eD;t>1e3&&(eT-=t,eD=e)}function eU(e){!eR&&(eA&&(eA=clearTimeout(eA)),e-eO>24?(e<1/0&&(eA=setTimeout(eV,e-ez.now()-eT)),eI&&(eI=clearInterval(eI))):(eI||(eD=ez.now(),eI=setInterval(eq,1e3)),eR=1,eL(eV)))}function eX(e,t,n){var r=new e$;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}e$.prototype=eH.prototype={constructor:e$,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?eB():+n)+(null==t?0:+t),this._next||eP===this||(eP?eP._next=this:eM=this,eP=this),this._call=e,this._time=n,eU()},stop:function(){this._call&&(this._call=null,this._time=1/0,eU())}};var eW=k("start","end","cancel","interrupt"),eY=[];function eK(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(s){var u,c,d,f;if(1!==n.state)return l();for(u in o)if((f=o[u]).name===n.name){if(3===f.state)return eX(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(eX(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(u=0,n.state=3,r=Array(d=n.tween.length),c=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=eH(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:eW,tween:eY,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function eG(e,t){var n=eQ(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eZ(e,t){var n=eQ(e,t);if(n.state>3)throw Error("too late; already running");return n}function eQ(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function eJ(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i){if((n=i[o]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}a&&delete e.__transition}}function e0(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var e1=180/Math.PI,e2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function e5(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*e1,skewX:Math.atan(s)*e1,scaleX:a,scaleY:l}}function e3(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l,s,u,c,d=[],f=[];return i=e(i),a=e(a),!function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:e0(e,o)},{i:s-2,x:e0(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,d,f),l=i.rotate,s=a.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:e0(l,s)})):s&&d.push(o(d)+"rotate("+s+r),u=i.skewX,c=a.skewX,u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:e0(u,c)}):c&&d.push(o(d)+"skewX("+c+r),!function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:e0(e,n)},{i:l-2,x:e0(t,r)})}else(1!==n||1!==r)&&i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,d,f),i=a=null,function(e){for(var t,n=-1,r=f.length;++n<r;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var e4=e3(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?e2:e5(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),e6=e3(function(e){return null==e?e2:(u||(u=document.createElementNS("http://www.w3.org/2000/svg","g")),u.setAttribute("transform",e),e=u.transform.baseVal.consolidate())?e5((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):e2},", ",")",")");function e8(e,t,n){var r=e._id;return e.each(function(){var e=eZ(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return eQ(e,r).value[t]}}function e9(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function e7(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function te(){}var tt="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",to=/^#([0-9a-f]{3,8})$/,ti=RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),ta=RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),tl=RegExp(`^rgba\\(${tt},${tt},${tt},${tn}\\)$`),ts=RegExp(`^rgba\\(${tr},${tr},${tr},${tn}\\)$`),tu=RegExp(`^hsl\\(${tn},${tr},${tr}\\)$`),tc=RegExp(`^hsla\\(${tn},${tr},${tr},${tn}\\)$`),td={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tf(){return this.rgb().formatHex()}function th(){return this.rgb().formatRgb()}function tp(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=to.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?tm(t):3===n?new ty(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?tg(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?tg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ti.exec(e))?new ty(t[1],t[2],t[3],1):(t=ta.exec(e))?new ty(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=tl.exec(e))?tg(t[1],t[2],t[3],t[4]):(t=ts.exec(e))?tg(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=tu.exec(e))?tE(t[1],t[2]/100,t[3]/100,1):(t=tc.exec(e))?tE(t[1],t[2]/100,t[3]/100,t[4]):td.hasOwnProperty(e)?tm(td[e]):"transparent"===e?new ty(NaN,NaN,NaN,0):null}function tm(e){return new ty(e>>16&255,e>>8&255,255&e,1)}function tg(e,t,n,r){return r<=0&&(e=t=n=NaN),new ty(e,t,n,r)}function tx(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof te||(o=tp(o)),o)?new ty((o=o.rgb()).r,o.g,o.b,o.opacity):new ty:new ty(e,t,n,null==r?1:r)}function ty(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function tv(){return`#${tj(this.r)}${tj(this.g)}${tj(this.b)}`}function tb(){let e=tw(this.opacity);return`${1===e?"rgb(":"rgba("}${tk(this.r)}, ${tk(this.g)}, ${tk(this.b)}${1===e?")":`, ${e})`}`}function tw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tk(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tj(e){return((e=tk(e))<16?"0":"")+e.toString(16)}function tE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tS(e,t,n,r)}function tC(e){if(e instanceof tS)return new tS(e.h,e.s,e.l,e.opacity);if(e instanceof te||(e=tp(e)),!e)return new tS;if(e instanceof tS)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+(n<r)*6:n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new tS(a,l,s,e.opacity)}function tS(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tN(e){return(e=(e||0)%360)<0?e+360:e}function t_(e){return Math.max(0,Math.min(1,e||0))}function tM(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function tP(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}e9(te,tp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tf,formatHex:tf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tC(this).formatHsl()},formatRgb:th,toString:th}),e9(ty,tx,e7(te,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ty(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ty(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ty(tk(this.r),tk(this.g),tk(this.b),tw(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tv,formatHex:tv,formatHex8:function(){return`#${tj(this.r)}${tj(this.g)}${tj(this.b)}${tj((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:tb,toString:tb})),e9(tS,function(e,t,n,r){return 1==arguments.length?tC(e):new tS(e,t,n,null==r?1:r)},e7(te,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tS(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tS(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ty(tM(e>=240?e-240:e+120,o,r),tM(e,o,r),tM(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new tS(tN(this.h),t_(this.s),t_(this.l),tw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tw(this.opacity);return`${1===e?"hsl(":"hsla("}${tN(this.h)}, ${100*t_(this.s)}%, ${100*t_(this.l)}%${1===e?")":`, ${e})`}`}}));let tR=e=>()=>e;function tA(e,t){var n=t-e;return n?function(t){return e+t*n}:tR(isNaN(e)?t:e)}let tI=function e(t){var n,r=1==(n=+t)?tA:function(e,t){var r,o,i;return t-e?(r=e,o=t,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(e){return Math.pow(r+e*o,i)}):tR(isNaN(e)?t:e)};function o(e,t){var n=r((e=tx(e)).r,(t=tx(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=tA(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function tD(e){return function(t){var n,r,o=t.length,i=Array(o),a=Array(o),l=Array(o);for(n=0;n<o;++n)r=tx(t[n]),i[n]=r.r||0,a[n]=r.g||0,l[n]=r.b||0;return i=e(i),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=l(e),r+""}}}tD(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,l=r<t-1?e[r+2]:2*i-o;return tP((n-r/t)*t,a,o,i,l)}}),tD(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],l=e[(r+2)%t];return tP((n-r/t)*t,o,i,a,l)}});var tO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tT=RegExp(tO.source,"g");function tz(e,t){var n,r,o,i,a,l=tO.lastIndex=tT.lastIndex=0,s=-1,u=[],c=[];for(e+="",t+="";(o=tO.exec(e))&&(i=tT.exec(t));)(a=i.index)>l&&(a=t.slice(l,a),u[s]?u[s]+=a:u[++s]=a),(o=o[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,c.push({i:s,x:e0(o,i)})),l=tT.lastIndex;return l<t.length&&(a=t.slice(l),u[s]?u[s]+=a:u[++s]=a),u.length<2?c[0]?(n=c[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=c.length,function(e){for(var n,r=0;r<t;++r)u[(n=c[r]).i]=n.x(e);return u.join("")})}function tL(e,t){var n;return("number"==typeof t?e0:t instanceof tp?tI:(n=tp(t))?(t=n,tI):tz)(e,t)}var tB=ed.prototype.constructor;function tF(e){return function(){this.style.removeProperty(e)}}var t$=0;function tH(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var tV=ed.prototype;tH.prototype=(function(e){return ed().transition(e)}).prototype={constructor:tH,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=S(e));for(var r=this._groups,o=r.length,i=Array(o),a=0;a<o;++a)for(var l,s,u=r[a],c=u.length,d=i[a]=Array(c),f=0;f<c;++f)(l=u[f])&&(s=e.call(l,l.__data__,f,u))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,eK(d[f],t,n,f,d,eQ(l,n)));return new tH(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=_(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,u=r[l],c=u.length,d=0;d<c;++d)if(s=u[d]){for(var f,h=e.call(s,s.__data__,d,u),p=eQ(s,n),m=0,g=h.length;m<g;++m)(f=h[m])&&eK(f,t,n,m,h,p);i.push(h),a.push(s)}return new tH(i,a,t,n)},selectChild:tV.selectChild,selectChildren:tV.selectChildren,filter:function(e){"function"!=typeof e&&(e=M(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new tH(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=Array(r),l=0;l<i;++l)for(var s,u=t[l],c=n[l],d=u.length,f=a[l]=Array(d),h=0;h<d;++h)(s=u[h]||c[h])&&(f[h]=s);for(;l<r;++l)a[l]=t[l];return new tH(a,this._parents,this._name,this._id)},selection:function(){return new tB(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++t$,r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)if(a=l[u]){var c=eQ(a,t);eK(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tH(r,this._parents,e,n)},call:tV.call,nodes:tV.nodes,node:tV.node,size:tV.size,empty:tV.empty,each:tV.each,on:function(e,t){var n,r,o,i,a,l,s=this._id;return arguments.length<2?eQ(this.node(),s).on.on(e):this.each((n=s,r=e,o=t,l=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eG:eZ,function(){var e=l(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(r,o),e.on=a}))},attr:function(e,t){var n=V(e),r="transform"===n?e6:tL;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}:function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttribute(e):(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}})(n,r,e8(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}:function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=V(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,i,a,l,s,u,c,d,f,h,p,m,g,x,y,v,b,w,k,j,E="transform"==(e+="")?e4:tL;return null==t?this.styleTween(e,(r=e,function(){var e=U(this,r),t=(this.style.removeProperty(r),U(this,r));return e===t?null:e===o&&t===i?a:a=E(o=e,i=t)})).on("end.style."+e,tF(e)):"function"==typeof t?this.styleTween(e,(l=e,s=e8(this,"style."+e,t),function(){var e=U(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=U(this,l)),e===n?null:e===u&&n===c?d:(c=n,d=E(u=e,t))})).each((f=this._id,v="end."+(y="style."+(h=e)),function(){var e=eZ(this,f),t=e.on,n=null==e.value[y]?x||(x=tF(h)):void 0;(t!==p||g!==n)&&(m=(p=t).copy()).on(v,g=n),e.on=m})):this.styleTween(e,(b=e,j=t+"",function(){var e=U(this,b);return e===j?null:e===w?k:k=E(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=e8(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=eQ(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=eZ(this,e),i=o.tween;if(i!==n){r=n=i;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var i=eZ(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,u=o.length;s<u;++s)if(o[s].name===t){o[s]=l;break}s===u&&o.push(l)}i.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eG(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eG(this,e).delay=t}})(t,e)):eQ(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eZ(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eZ(this,e).duration=t}})(t,e)):eQ(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eZ(this,e).ease=t}}(t,e)):eQ(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eZ(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each(function(){var n=eZ(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===o&&i()})},[Symbol.iterator]:tV[Symbol.iterator]};var tq={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};ed.prototype.interrupt=function(e){return this.each(function(){eJ(this,e)})},ed.prototype.transition=function(e){var t,n;e instanceof tH?(t=e._id,e=e._name):(t=++t$,(n=tq).time=eB(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)(a=l[u])&&eK(a,e,t,u,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new tH(r,this._parents,e,t)};let tU=e=>()=>e;function tX(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function tW(e,t,n){this.k=e,this.x=t,this.y=n}tW.prototype={constructor:tW,scale:function(e){return 1===e?this:new tW(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tW(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tY=new tW(1,0,0);function tK(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tY;return e.__zoom}function tG(e){e.stopImmediatePropagation()}function tZ(e){e.preventDefault(),e.stopImmediatePropagation()}function tQ(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function tJ(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function t0(){return this.__zoom||tY}function t1(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function t2(){return navigator.maxTouchPoints||"ontouchstart"in this}function t5(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function t3(){var e,t,n,r=tQ,o=tJ,i=t5,a=t1,l=t2,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=e_,f=k("start","zoom","end"),h=0,p=10;function m(e){e.property("__zoom",t0).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",C).filter(l).on("touchstart.zoom",S).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",_).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new tW(t,e.x,e.y)}function x(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new tW(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function v(e,t,n,r){e.on("start.zoom",function(){b(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,i=b(this,e).event(r),a=o.apply(this,e),l=null==n?y(a):"function"==typeof n?n.apply(this,e):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=this.__zoom,c="function"==typeof t?t.apply(this,e):t,f=d(u.invert(l).concat(s/u.k),c.invert(l).concat(s/c.k));return function(e){if(1===e)e=c;else{var t=f(e),n=s/t[2];e=new tW(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function b(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function j(e,...t){if(r.apply(this,arguments)){var n=b(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,a.apply(this,arguments)))),c=eh(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=o.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[c,o.invert(c)],eJ(this),n.start()}tZ(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(x(g(o,l),n.mouse[0],n.mouse[1]),n.extent,u))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=b(this,t,!0).event(e),l=ef(e.view).on("mousemove.zoom",function(e){if(tZ(e),!a.moved){var t=e.clientX-c,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=eh(e,o),a.mouse[1]),a.extent,u))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),ev(e.view,a.moved),tZ(e),a.event(e).end()},!0),s=eh(e,o),c=e.clientX,d=e.clientY;ey(e.view),tG(e),a.mouse=[s,this.__zoom.invert(s)],eJ(this),a.start()}}function C(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=eh(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(x(g(n,s),a,l),o.apply(this,t),u);tZ(e),c>0?ef(this).transition().duration(c).call(v,d,a,e):ef(this).call(m.transform,d,a,e)}}function S(n,...o){if(r.apply(this,arguments)){var i,a,l,s,u=n.touches,c=u.length,d=b(this,o,n.changedTouches.length===c).event(n);for(tG(n),a=0;a<c;++a)s=[s=eh(l=u[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),eJ(this),d.start())}}function N(e,...t){if(this.__zooming){var n,r,o,a,l=b(this,t).event(e),s=e.changedTouches,c=s.length;for(tZ(e),n=0;n<c;++n)o=eh(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],h=l.touch1[0],p=l.touch1[1],m=(m=h[0]-d[0])*m+(m=h[1]-d[1])*m,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;r=g(r,Math.sqrt(m/y)),o=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(x(r,o,a),l.extent,u))}}function _(e,...r){if(this.__zooming){var o,i,a=b(this,r).event(e),l=e.changedTouches,s=l.length;for(tG(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<s;++o)i=l[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=eh(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var u=ef(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",t0),e!==o?v(e,t,n,r):o.interrupt().each(function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(x(g(r,s),a,l),e,u)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),u)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,l=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return i(tY.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,u)},r,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ef(this.that).datum();f.call(e,this.that,new tX(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:tU(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:tU(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:tU(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:tU([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],m):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(c=+e,m):c},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,m):Math.sqrt(h)},m.tapDistance=function(e){return arguments.length?(p=+e,m):p},m}function t4(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?tR(t):("number"===o?e0:"string"===o?(r=tp(t))?(t=r,tI):tz:t instanceof tp?tI:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=Array(o),a=Array(r);for(n=0;n<o;++n)i[n]=t4(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=t4(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:e0:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}})(e,t)}tK.prototype=tW.prototype;let t6={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},t8=[[-1/0,-1/0],[1/0,1/0]],t9=["Enter"," ","Escape"],t7={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(t=c||(c={})).Strict="strict",t.Loose="loose",(n=d||(d={})).Free="free",n.Vertical="vertical",n.Horizontal="horizontal",(r=f||(f={})).Partial="partial",r.Full="full";let ne={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(o=h||(h={})).Bezier="default",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o.SimpleBezier="simplebezier",(i=p||(p={})).Arrow="arrow",i.ArrowClosed="arrowclosed",(a=m||(m={})).Left="left",a.Top="top",a.Right="right",a.Bottom="bottom";let nt={[m.Left]:m.Right,[m.Right]:m.Left,[m.Top]:m.Bottom,[m.Bottom]:m.Top};function nn(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function nr(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function no(e){return null===e?null:e?"valid":"invalid"}let ni=e=>"id"in e&&"source"in e&&"target"in e,na=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),nl=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ns=(e,t=[0,0])=>{let{width:n,height:r}=nz(e),o=e.origin??t,i=n*o[0],a=r*o[1];return{x:e.position.x-i,y:e.position.y-a}},nu=(e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:nk(e.reduce((e,n)=>{let r="string"==typeof n,o=t.nodeLookup||r?void 0:n;return t.nodeLookup&&(o=r?t.nodeLookup.get(n):nl(n)?n:t.nodeLookup.get(n.id)),nb(e,o?nE(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),nc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=nb(n,nE(e)),r=!0)}),r?nk(n):{x:0,y:0,width:0,height:0}},nd=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1)=>{let l={...nR(t,[n,r,o]),width:t.width/o,height:t.height/o},s=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(a&&!n||r)continue;let o=e.width??t.width??t.initialWidth??null,u=e.height??t.height??t.initialHeight??null,c=nS(l,nj(t)),d=(o??0)*(u??0),f=i&&c>0;(!t.internals.handleBounds||f||c>=d||t.dragging)&&s.push(t)}return s};async function nf({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},a){let l,s;if(0===e.size)return Promise.resolve(!0);let u=nD(nc((l=new Map,s=a?.nodes?new Set(a.nodes.map(e=>e.id)):null,e.forEach(e=>{e.measured.width&&e.measured.height&&(a?.includeHiddenNodes||!e.hidden)&&(!s||s.has(e.id))&&l.set(e.id,e)}),l)),t,n,a?.minZoom??o,a?.maxZoom??i,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}function nh({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:s,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=a.origin??r,d=a.extent||o;if("parent"!==a.extent||a.expandParent)l&&nT(a.extent)&&(d=[[a.extent[0][0]+s,a.extent[0][1]+u],[a.extent[1][0]+s,a.extent[1][1]+u]]);else if(l){let e=l.measured.width,t=l.measured.height;e&&t&&(d=[[s,u],[s+e,u+t]])}else i?.("005",t6.error005());let f=nT(d)?ng(t,d,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&i?.("015",t6.error015()),{position:{x:f.x-s+(a.measured.width??0)*c[0],y:f.y-u+(a.measured.height??0)*c[1]},positionAbsolute:f}}async function np({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){let i,a=new Set(e.map(e=>e.id)),l=[];for(let e of n){if(!1===e.deletable)continue;let t=a.has(e.id),n=!t&&e.parentId&&l.find(t=>t.id===e.parentId);(t||n)&&l.push(e)}let s=new Set(t.map(e=>e.id)),u=r.filter(e=>!1!==e.deletable),c=(i=new Set,l.forEach(e=>{i.add(e.id)}),u.filter(e=>i.has(e.source)||i.has(e.target)));for(let e of u)s.has(e.id)&&!c.find(t=>t.id===e.id)&&c.push(e);if(!o)return{edges:c,nodes:l};let d=await o({nodes:l,edges:c});return"boolean"==typeof d?d?{edges:c,nodes:l}:{edges:[],nodes:[]}:d}let nm=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ng=(e={x:0,y:0},t,n)=>({x:nm(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nm(e.y,t[0][1],t[1][1]-(n?.height??0))});function nx(e,t,n){let{width:r,height:o}=nz(n),{x:i,y:a}=n.internals.positionAbsolute;return ng(e,[[i,a],[i+r,a+o]],t)}let ny=(e,t,n)=>e<t?nm(Math.abs(e-t),1,t)/t:e>n?-nm(Math.abs(e-n),1,t)/t:0,nv=(e,t,n=15,r=40)=>[ny(e.x,r,t.width-r)*n,ny(e.y,r,t.height-r)*n],nb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),nw=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nk=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),nj=(e,t=[0,0])=>{let{x:n,y:r}=nl(e)?e.internals.positionAbsolute:ns(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nE=(e,t=[0,0])=>{let{x:n,y:r}=nl(e)?e.internals.positionAbsolute:ns(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},nC=(e,t)=>nk(nb(nw(e),nw(t))),nS=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),nN=e=>n_(e.width)&&n_(e.height)&&n_(e.x)&&n_(e.y),n_=e=>!isNaN(e)&&isFinite(e),nM=(e,t)=>{},nP=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nR=({x:e,y:t},[n,r,o],i=!1,a=[1,1])=>{let l={x:(e-n)/o,y:(t-r)/o};return i?nP(l,a):l},nA=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function nI(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let nD=(e,t,n,r,o,i)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=nI(e,n),o=nI(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){let r=nI(e.top??e.y??0,n),o=nI(e.bottom??e.y??0,n),i=nI(e.left??e.x??0,t),a=nI(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:i,x:i+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),l=nm(Math.min((t-a.x)/e.width,(n-a.y)/e.height),r,o),s=e.x+e.width/2,u=e.y+e.height/2,c=t/2-s*l,d=n/2-u*l,f=function(e,t,n,r,o,i){let{x:a,y:l}=nA(e,[t,n,r]),{x:s,y:u}=nA({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(o-s),bottom:Math.floor(i-u)}}(e,c,d,l,t,n),h={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:c-h.left+h.right,y:d-h.top+h.bottom,zoom:l}},nO=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nT(e){return null!=e&&"parent"!==e}function nz(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nL(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nB(e,t={width:0,height:0},n,r,o){let i={...e},a=r.get(n);if(a){let e=a.origin||o;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function nF(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function n$(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function nH(e){return{...t7,...e||{}}}function nV(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){let{x:i,y:a}=nK(e),l=nR({x:i-(o?.left??0),y:a-(o?.top??0)},r),{x:s,y:u}=n?nP(l,t):l;return{xSnapped:s,ySnapped:u,...l}}let nq=e=>({width:e.offsetWidth,height:e.offsetHeight}),nU=e=>e?.getRootNode?.()||window?.document,nX=["INPUT","SELECT","TEXTAREA"];function nW(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(nX.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let nY=e=>"clientX"in e,nK=(e,t)=>{let n=nY(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},nG=(e,t,n,r,o)=>{let i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{let i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...nq(t)}}):null};function nZ({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:l}){let s=.125*e+.375*o+.375*a+.125*n,u=.125*t+.375*i+.375*l+.125*r,c=Math.abs(s-e),d=Math.abs(u-t);return[s,u,c,d]}function nQ(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function nJ({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case m.Left:return[t-nQ(t-r,i),n];case m.Right:return[t+nQ(r-t,i),n];case m.Top:return[t,n-nQ(n-o,i)];case m.Bottom:return[t,n+nQ(o-n,i)]}}function n0({sourceX:e,sourceY:t,sourcePosition:n=m.Bottom,targetX:r,targetY:o,targetPosition:i=m.Top,curvature:a=.25}){let[l,s]=nJ({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[u,c]=nJ({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,h,p]=nZ({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${s} ${u},${c} ${r},${o}`,d,f,h,p]}function n1({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+i:r-i,o,i]}function n2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if("manual"===i)return r;let a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return(o&&n?r+1e3:r)+a}function n5({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){let i=nb(nE(e),nE(t));return i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1),nS({x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]},nk(i))>0}let n3=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,n4=(e,t,n={})=>{let r,o;if(!e.source||!e.target)return nM("006",t6.error006()),t;let i=n.getEdgeId||n3;return(o=r=ni(e)?{...e}:{...e,id:i(e)},t.some(e=>e.source===o.source&&e.target===o.target&&(e.sourceHandle===o.sourceHandle||!e.sourceHandle&&!o.sourceHandle)&&(e.targetHandle===o.targetHandle||!e.targetHandle&&!o.targetHandle)))?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))};function n6({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,a,l]=n1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,l]}let n8={[m.Left]:{x:-1,y:0},[m.Right]:{x:1,y:0},[m.Top]:{x:0,y:-1},[m.Bottom]:{x:0,y:1}},n9=({source:e,sourcePosition:t=m.Bottom,target:n})=>t===m.Left||t===m.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},n7=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function re({sourceX:e,sourceY:t,sourcePosition:n=m.Bottom,targetX:r,targetY:o,targetPosition:i=m.Top,borderRadius:a=5,centerX:l,centerY:s,offset:u=20,stepPosition:c=.5}){let[d,f,h,p,g]=function({source:e,sourcePosition:t=m.Bottom,target:n,targetPosition:r=m.Top,center:o,offset:i,stepPosition:a}){let l,s,u=n8[t],c=n8[r],d={x:e.x+u.x*i,y:e.y+u.y*i},f={x:n.x+c.x*i,y:n.y+c.y*i},h=n9({source:d,sourcePosition:t,target:f}),p=0!==h.x?"x":"y",g=h[p],x=[],y={x:0,y:0},v={x:0,y:0},[,,b,w]=n1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(u[p]*c[p]==-1){"x"===p?(l=o.x??d.x+(f.x-d.x)*a,s=o.y??(d.y+f.y)/2):(l=o.x??(d.x+f.x)/2,s=o.y??d.y+(f.y-d.y)*a);let e=[{x:l,y:d.y},{x:l,y:f.y}],t=[{x:d.x,y:s},{x:f.x,y:s}];x=u[p]===g?"x"===p?e:t:"x"===p?t:e}else{let o=[{x:d.x,y:f.y}],a=[{x:f.x,y:d.y}];if(x="x"===p?u.x===g?a:o:u.y===g?o:a,t===r){let t=Math.abs(e[p]-n[p]);if(t<=i){let r=Math.min(i-1,i-t);u[p]===g?y[p]=(d[p]>e[p]?-1:1)*r:v[p]=(f[p]>n[p]?-1:1)*r}}if(t!==r){let e="x"===p?"y":"x",t=u[p]===c[e],n=d[e]>f[e],r=d[e]<f[e];(1===u[p]&&(!t&&n||t&&r)||1!==u[p]&&(!t&&r||t&&n))&&(x="x"===p?o:a)}let h={x:d.x+y.x,y:d.y+y.y},m={x:f.x+v.x,y:f.y+v.y};Math.max(Math.abs(h.x-x[0].x),Math.abs(m.x-x[0].x))>=Math.max(Math.abs(h.y-x[0].y),Math.abs(m.y-x[0].y))?(l=(h.x+m.x)/2,s=x[0].y):(l=x[0].x,s=(h.y+m.y)/2)}return[[e,{x:d.x+y.x,y:d.y+y.y},...x,{x:f.x+v.x,y:f.y+v.y},n],l,s,b,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:s},offset:u,stepPosition:c});return[d.reduce((e,t,n)=>e+(n>0&&n<d.length-1?function(e,t,n,r){let o=Math.min(n7(e,t)/2,n7(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${i+o*t},${a}Q ${i},${a} ${i},${a+o*r}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${i},${a+o*s}Q ${i},${a} ${i+o*l},${a}`}(d[n-1],t,d[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`),""),f,h,p,g]}function rt(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function rn(e){let{sourceNode:t,targetNode:n}=e;if(!rt(t)||!rt(n))return null;let r=t.internals.handleBounds||rr(t.handles),o=n.internals.handleBounds||rr(n.handles),i=ri(r?.source??[],e.sourceHandle),a=ri(e.connectionMode===c.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!i||!a)return e.onError?.("008",t6.error008(!i?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=i?.position||m.Bottom,s=a?.position||m.Top,u=ro(t,i,l),d=ro(n,a,s);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:s}}function rr(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function ro(e,t,n=m.Left,r=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??nz(e);if(r)return{x:o+a/2,y:i+l/2};switch(t?.position??n){case m.Top:return{x:o+a/2,y:i};case m.Right:return{x:o+a,y:i+l/2};case m.Bottom:return{x:o+a/2,y:i+l};case m.Left:return{x:o,y:i+l/2}}}function ri(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function ra(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}function rl(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){let i=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){let o=ra(r,t);i.has(o)||(e.push({id:o,color:r.color||n,...r}),i.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}function rs(e,t,n,r,o){let i=.5;"start"===o?i=0:"end"===o&&(i=1);let a=[(e.x+e.width*i)*t.zoom+t.x,e.y*t.zoom+t.y-r],l=[-100*i,-100];switch(n){case m.Right:a=[(e.x+e.width)*t.zoom+t.x+r,(e.y+e.height*i)*t.zoom+t.y],l=[0,-100*i];break;case m.Bottom:a[1]=(e.y+e.height)*t.zoom+t.y+r,l[1]=0;break;case m.Left:a=[e.x*t.zoom+t.x-r,(e.y+e.height*i)*t.zoom+t.y],l=[-100,-100*i]}return`translate(${a[0]}px, ${a[1]}px) translate(${l[0]}%, ${l[1]}%)`}let ru={left:0,center:50,right:100},rc={top:0,center:50,bottom:100};function rd(e,t,n,r="center",o="center"){return`translate(${e}px, ${t}px) scale(${1/n}) translate(${-(ru[r]??50)}%, ${-(rc[o]??50)}%)`}let rf={nodeOrigin:[0,0],nodeExtent:t8,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rh={...rf,checkEquality:!0};function rp(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function rm(e,t,n){let r=rp(rf,n);for(let n of e.values())if(n.parentId)ry(n,e,t,r);else{let e=ng(ns(n,r.nodeOrigin),nT(n.extent)?n.extent:r.nodeExtent,nz(n));n.internals.positionAbsolute=e}}function rg(e){return"manual"===e}function rx(e,t,n,r={}){let o=rp(rh,r),i={i:0},a=new Map(t),l=o?.elevateNodesOnSelect&&!rg(o.zIndexMode)?1e3:0,s=e.length>0;for(let u of(t.clear(),n.clear(),e)){let e=a.get(u.id);if(o.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=ng(ns(u,o.nodeOrigin),nT(u.extent)?u.extent:o.nodeExtent,nz(u));e={...o.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}(u,e),z:rv(u,l,o.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(s=!1),u.parentId&&ry(e,t,n,r,i)}return s}function ry(e,t,n,r,o){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:s}=rp(rf,r),u=e.parentId,c=t.get(u);if(!c)return void console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===s&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+10*o.i),o&&void 0!==c.internals.rootParentIndex&&(o.i=c.internals.rootParentIndex);let{x:d,y:f,z:h}=function(e,t,n,r,o,i){let{x:a,y:l}=t.internals.positionAbsolute,s=nz(e),u=ns(e,n),c=nT(e.extent)?ng(u,e.extent,s):u,d=ng({x:a+c.x,y:l+c.y},r,s);"parent"===e.extent&&(d=nx(d,s,t));let f=rv(e,o,i),h=t.internals.z??0;return{x:d.x,y:d.y,z:h>=f?h+1:f}}(e,c,a,l,i&&!rg(s)?1e3:0,s),{positionAbsolute:p}=e.internals,m=d!==p.x||f!==p.y;(m||h!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:d,y:f}:p,z:h}})}function rv(e,t,n){let r=n_(e.zIndex)?e.zIndex:0;return rg(n)?r:r+(e.selected?t:0)}function rb(e,t,n,r=[0,0]){let o=[],i=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=nC(i.get(n.parentId)?.expandedRect??nj(e),n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{let l=i.internals.positionAbsolute,s=nz(i),u=i.origin??r,c=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,d=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,f=Math.max(s.width,Math.round(t.width)),h=Math.max(s.height,Math.round(t.height)),p=(f-s.width)*u[0],m=(h-s.height)*u[1];(c>0||d>0||p||m)&&(o.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-d+m}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+d}})})),(s.width<t.width||s.height<t.height||c||d)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(c?u[0]*c-p:0),height:h+(d?u[1]*d-m:0)}})}),o}function rw(e,t,n,r,o,i,a){let l=r?.querySelector(".xyflow__viewport"),s=!1;if(!l)return{changes:[],updatedInternals:s};let u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}let l=nq(r.nodeElement),c=e.measured.width!==l.width||e.measured.height!==l.height;if(l.width&&l.height&&(c||!e.internals.handleBounds||r.force)){let h=r.nodeElement.getBoundingClientRect(),p=nT(e.extent)?e.extent:i,{positionAbsolute:m}=e.internals;e.parentId&&"parent"===e.extent?m=nx(m,l,t.get(e.parentId)):p&&(m=ng(m,p,l));let g={...e,measured:l,internals:{...e.internals,positionAbsolute:m,handleBounds:{source:nG("source",r.nodeElement,h,d,e.id),target:nG("target",r.nodeElement,h,d,e.id)}}};t.set(e.id,g),e.parentId&&ry(g,t,n,{nodeOrigin:o,zIndexMode:a}),s=!0,c&&(u.push({id:e.id,type:"dimensions",dimensions:l}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:nj(g,o)}))}}if(f.length>0){let e=rb(f,t,n,o);u.push(...e)}return{changes:u,updatedInternals:s}}async function rk({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return Promise.resolve(!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]))}function rj(e,t,n,r,o,i){let a=o,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${o}-${e}`;let s=r.get(a)||new Map;if(r.set(a,s.set(n,t)),i){a=`${o}-${e}-${i}`;let l=r.get(a)||new Map;r.set(a,l.set(n,t))}}function rE(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:o,sourceHandle:i=null,targetHandle:a=null}=r,l={edgeId:r.id,source:n,target:o,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${o}-${a}`;rj("source",l,`${o}-${a}--${n}-${i}`,e,n,i),rj("target",l,s,e,o,a),t.set(r.id,r)}}function rC(e,t){if(null===e||null===t)return!1;let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e].id!==r[e].id||n[e].type!==r[e].type||!Object.is(n[e].data,r[e].data))return!1;return!0}function rS(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r)return!1}function rN({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let o=[];for(let[e,i]of t){let t=n.get(e)?.internals.userNode;t&&o.push({...t,position:i.position,dragging:r})}if(!e)return[o[0],o];let i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:r}:o[0],o]}function r_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},a=0,l=new Map,s=!1,u={x:0,y:0},c=null,d=!1,f=null,h=!1,p=!1,m=null;return{update:function({noDragClassName:g,handleSelector:x,domNode:y,isSelectable:v,nodeId:b,nodeClickDistance:w=0}){function k({x:e,y:n}){let{nodeLookup:o,nodeExtent:a,snapGrid:s,snapToGrid:u,nodeOrigin:c,onNodeDrag:d,onSelectionDrag:f,onError:h,updateNodePositions:g}=t();i={x:e,y:n};let x=!1,y=l.size>1,v=y&&a?nw(nc(l)):null,w=y&&u?function({dragItems:e,snapGrid:t,x:n,y:r}){let o=e.values().next().value;if(!o)return null;let i={x:n-o.distance.x,y:r-o.distance.y},a=nP(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:l,snapGrid:s,x:e,y:n}):null;for(let[t,r]of l){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};u&&(i=w?{x:Math.round(i.x+w.x),y:Math.round(i.y+w.y)}:nP(i,s));let l=null;if(y&&a&&!r.extent&&v){let{positionAbsolute:e}=r.internals,t=e.x-v.x+a[0][0],n=e.x+r.measured.width-v.x2+a[1][0];l=[[t,e.y-v.y+a[0][1]],[n,e.y+r.measured.height-v.y2+a[1][1]]]}let{position:d,positionAbsolute:f}=nh({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:l||a,nodeOrigin:c,onError:h});x=x||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(p=p||x,x&&(g(l,!0),m&&(r||d||!b&&f))){let[e,t]=rN({nodeId:b,dragItems:l,nodeLookup:o});r?.(m,l,e,t),d?.(m,e,t),b||f?.(m,t)}}async function j(){if(!c)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o){s=!1,cancelAnimationFrame(a);return}let[l,d]=nv(u,c,r);(0!==l||0!==d)&&(i.x=(i.x??0)-l/e[2],i.y=(i.y??0)-d/e[2],await n({x:l,y:d})&&k(i)),a=requestAnimationFrame(j)}function E(r){let{nodeLookup:o,multiSelectionActive:a,nodesDraggable:s,transform:u,snapGrid:f,snapToGrid:h,selectNodesOnDrag:p,onNodeDragStart:m,onSelectionDragStart:g,unselectNodesAndEdges:x}=t();d=!0,p&&v||a||!b||o.get(b)?.selected||x(),v&&p&&b&&e?.(b);let y=nV(r.sourceEvent,{transform:u,snapGrid:f,snapToGrid:h,containerBounds:c});if(i=y,(l=function(e,t,n,r){let o=new Map;for(let[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(i);t&&o.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,s,y,b)).size>0&&(n||m||!b&&g)){let[e,t]=rN({nodeId:b,dragItems:l,nodeLookup:o});n?.(r.sourceEvent,l,e,t),m?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}f=ef(y);let C=eS().clickDistance(w).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:a,snapToGrid:l}=t();c=n?.getBoundingClientRect()||null,h=!1,p=!1,m=e.sourceEvent,0===r&&E(e),i=nV(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:l,containerBounds:c}),u=nK(e.sourceEvent,c)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=t(),g=nV(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:a,containerBounds:c});if(m=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||b&&!p.has(b))&&(h=!0),!h){if(!s&&n&&d&&(s=!0,j()),!d){let t=nK(e.sourceEvent,c),n=t.x-u.x,r=t.y-u.y;Math.sqrt(n*n+r*r)>f&&E(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&l&&d&&(u=nK(e.sourceEvent,c),k(g))}}).on("end",e=>{if(d&&!h&&(s=!1,d=!1,cancelAnimationFrame(a),l.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:i,onSelectionDragStop:a}=t();if(p&&(r(l,!1),p=!1),o||i||!b&&a){let[t,r]=rN({nodeId:b,dragItems:l,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,l,t,r),i?.(e.sourceEvent,t,r),b||a?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!rS(t,`.${g}`,y))&&(!x||rS(t,x,y))});f.call(C)},destroy:function(){f?.on(".drag",null)}}}function rM(e,t,n,r,o,i=!1){let a=r.get(e);if(!a)return null;let l="strict"===o?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],s=(n?l?.find(e=>e.id===n):l?.[0])??null;return s&&i?{...s,...ro(a,s,s.position,!0)}:s}function rP(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let rR=()=>!0;function rA(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:a,lib:l,flowId:s,isValidConnection:u=rR,nodeLookup:d}){let f="target"===i,h=t?a.querySelector(`.${l}-flow__handle[data-id="${s}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=nK(e),g=a.elementFromPoint(p,m),x=g?.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){let e=rP(void 0,x),t=x.getAttribute("data-nodeid"),i=x.getAttribute("data-handleid"),a=x.classList.contains("connectable"),l=x.classList.contains("connectableend");if(!t||!e)return y;let s={source:f?t:r,sourceHandle:f?i:o,target:f?r:t,targetHandle:f?o:i};y.connection=s,y.isValid=a&&l&&(n===c.Strict?f&&"source"===e||!f&&"target"===e:t!==r||i!==o)&&u(s),y.toHandle=rM(t,e,i,d,n,!0)}return y}let rI={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:s,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:g,onConnectEnd:x,isValidConnection:y=rR,onReconnectEnd:v,updateConnection:b,getTransform:w,getFromHandle:k,autoPanSpeed:j,dragThreshold:E=1,handleDomNode:C}){let S,N=nU(e.target),_=0,{x:M,y:P}=nK(e),R=rP(i,C),A=l?.getBoundingClientRect(),I=!1;if(!A||!R)return;let D=rM(o,R,r,s,t);if(!D)return;let O=nK(e,A),T=!1,z=null,L=!1,B=null,F={...D,nodeId:o,type:R,position:D.position},$=s.get(o),H={inProgress:!0,isValid:null,from:ro($,F,m.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:$,to:O,toHandle:null,toPosition:nt[F.position],toNode:null,pointer:O};function V(){I=!0,b(H),p?.(e,{nodeId:o,handleId:r,handleType:R})}function q(e){var i,l;let h;if(!I){let{x:t,y:n}=nK(e),r=t-M,o=n-P;if(!(r*r+o*o>E*E))return;V()}if(!k()||!F)return void U(e);let p=w();S=function(e,t,n,r){let o=[],i=1/0;for(let a of function(e,t,n){let r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())nS(o,nj(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:l,y:s}=ro(a,n,n.position,!0),u=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(s-e.y,2));u>t||(u<i?(o=[{...n,x:l,y:s}],i=u):u===i&&o.push({...n,x:l,y:s}))}if(!o.length)return null;if(o.length>1){let e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(nR(O=nK(e,A),p,!1,[1,1]),n,s,F),T||(!function e(){if(!c||!A)return;let[t,n]=nv(O,A,j);f({x:t,y:n}),_=requestAnimationFrame(e)}(),T=!0);let g=rA(e,{handle:S,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:u,flowId:d,nodeLookup:s});B=g.handleDomNode,z=g.connection,i=!!S,l=g.isValid,h=null,l?h=!0:i&&!l&&(h=!1),L=h;let x=s.get(o),v=x?ro(x,F,m.Left,!0):H.from,C={...H,from:v,isValid:L,to:g.toHandle&&L?nA({x:g.toHandle.x,y:g.toHandle.y},p):O,toHandle:g.toHandle,toPosition:L&&g.toHandle?g.toHandle.position:nt[F.position],toNode:g.toHandle?s.get(g.toHandle.nodeId):null,pointer:O};b(C),H=C}function U(e){if(!("touches"in e)||!(e.touches.length>0)){if(I){(S||B)&&z&&L&&g?.(z);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};x?.(e,r),i&&v?.(e,r)}h(),cancelAnimationFrame(_),T=!1,L=!1,z=null,B=null,N.removeEventListener("mousemove",q),N.removeEventListener("mouseup",U),N.removeEventListener("touchmove",q),N.removeEventListener("touchend",U)}}0===E&&V(),N.addEventListener("mousemove",q),N.addEventListener("mouseup",U),N.addEventListener("touchmove",q),N.addEventListener("touchend",U)},isValid:rA};function rD({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let o=ef(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:l=1,pannable:s=!0,zoomable:u=!0,inversePan:c=!1}){let d=[0,0],f=t3().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",s?o=>{let l=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;let s=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],u=[s[0]-d[0],s[1]-d[1]];d=s;let f=r()*Math.max(l[2],Math.log(l[2]))*(c?-1:1),h={x:l[0]-u[0]*f,y:l[1]-u[1]*f};t.setViewportConstrained({x:h.x,y:h.y,zoom:l[2]},[[0,0],[i,a]],e)}:null).on("zoom.wheel",u?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),o=e.sourceEvent.ctrlKey&&nO()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*l,a=r[2]*Math.pow(2,i*o);t.scaleTo(a)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:eh}}let rO=e=>({x:e.x,y:e.y,zoom:e.k}),rT=({x:e,y:t,zoom:n})=>tY.translate(e,t).scale(n),rz=(e,t)=>e.target.closest(`.${t}`),rL=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),rB=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rF=(e,t=0,n=rB,r=()=>{})=>{let o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},r$=e=>{let t=e.ctrlKey&&nO()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function rH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:s}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),f=t3().scaleExtent([t,n]).translateExtent(r),h=ef(e).call(f);y({x:o.x,y:o.y,zoom:nm(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);let p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");function g(e,t){return h?new Promise(n=>{f?.interpolate(t?.interpolate==="linear"?t4:e_).transform(rF(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function x(){f.on("zoom",null)}async function y(e,t,n){let r=rT(e),o=f?.constrain()(r,t,n);return o&&await g(o),new Promise(e=>e(o))}return f.wheelDelta(r$),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:c,panOnScrollMode:g,panOnScrollSpeed:y,preventScrolling:v,zoomOnPinch:b,zoomOnScroll:w,zoomOnDoubleClick:k,zoomActivationKeyPressed:j,lib:E,onTransformChange:C,connectionInProgress:S,paneClickDistance:N,selectionOnDrag:_}){r&&!u.isZoomingOrPanning&&x();let M=o&&!j&&!r;f.clickDistance(_?1/0:!n_(N)||N<0?0:N);let P=M?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}){return c=>{if(rz(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(c.ctrlKey&&a){let e=eh(c),t=f*Math.pow(2,r$(c));r.scaleTo(n,t,e,c);return}let h=1===c.deltaMode?20:1,p=o===d.Vertical?0:c.deltaX*h,m=o===d.Horizontal?0:c.deltaY*h;!nO()&&c.shiftKey&&o!==d.Vertical&&(p=c.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});let g=rO(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(s?.(c,g),e.panScrollTimeout=setTimeout(()=>{u?.(c,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l?.(c,g))}}({zoomPanValues:u,noWheelClassName:e,d3Selection:h,d3Zoom:f,panOnScrollMode:g,panOnScrollSpeed:y,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){let i="wheel"===r.type,a=!t&&i&&!r.ctrlKey,l=rz(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});if(h.on("wheel.zoom",P,{passive:!1}),!r){let e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let o=rO(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:u,onDraggingChange:s,onPanZoomStart:a});f.on("start",e);let t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&rL(t,e.mouseButton??0)),i.sourceEvent?.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,rO(i.transform))}}({zoomPanValues:u,panOnDrag:c,onPaneContextMenu:!!n,onPanZoom:i,onTransformChange:C});f.on("zoom",t);let r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&rL(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){let t=rO(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:u,panOnDrag:c,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:s});f.on("end",r)}let R=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:s,lib:u,connectionInProgress:c}){return d=>{let f=e||t,h=n&&d.ctrlKey,p="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(rz(d,`${u}-flow__node`)||rz(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||a||c&&!p||rz(d,l)&&p||rz(d,s)&&(!p||o&&p&&!e)||!n&&d.ctrlKey&&p)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!o&&!h&&p||!r&&("mousedown"===d.type||"touchstart"===d.type)||Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;let m=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||p)&&m}}({zoomActivationKeyPressed:j,panOnDrag:c,zoomOnScroll:w,panOnScroll:o,zoomOnDoubleClick:k,zoomOnPinch:b,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:E,connectionInProgress:S});f.filter(R),k?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)},destroy:x,setViewport:async function e(e,t){let n=rT(e);return await g(n,t),new Promise(e=>e(n))},setViewportConstrained:y,getViewport:function(){let e=h?tK(h.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return h?new Promise(n=>{f?.interpolate(t?.interpolate==="linear"?t4:e_).scaleTo(rF(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return h?new Promise(n=>{f?.interpolate(t?.interpolate==="linear"?t4:e_).scaleBy(rF(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){f?.scaleExtent(e)},setTranslateExtent:function(e){f?.translateExtent(e)},syncViewport:function(e){if(h){let t=rT(e),n=h.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(h,t,null,{sync:!0})}},setClickDistance:function(e){let t=!n_(e)||e<0?0:e;f?.clickDistance(t)}}}(l=g||(g={})).Line="line",l.Handle="handle";let rV=["top-left","top-right","bottom-left","bottom-right"],rq=["top","right","bottom","left"];function rU(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}function rX(e,t){return Math.max(0,t-e)}function rW(e,t){return Math.max(0,e-t)}function rY(e,t,n){return Math.max(0,t-e,e-n)}let rK={width:0,height:0,x:0,y:0},rG={...rK,pointerX:0,pointerY:0,aspectRatio:1};function rZ({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){let i=ef(e),a={controlDirection:rU("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:l,keepAspectRatio:s,resizeDirection:u,onResizeStart:c,onResize:d,onResizeEnd:f,shouldResize:h}){let p,m,g,x,y={...rK},v={...rG};a={boundaries:l,resizeDirection:u,keepAspectRatio:s,controlDirection:rU(e)};let b=null,w=[],k=!1,j=eS().on("start",e=>{let{nodeLookup:r,transform:o,snapGrid:i,snapToGrid:a,nodeOrigin:l,paneDomNode:s}=n();if(!(p=r.get(t)))return;b=s?.getBoundingClientRect()??null;let{xSnapped:u,ySnapped:d}=nV(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:a,containerBounds:b});if(v={...y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},pointerX:u,pointerY:d,aspectRatio:y.width/y.height},m=void 0,p.parentId&&("parent"===p.extent||p.expandParent)){var f;g=(m=r.get(p.parentId))&&"parent"===p.extent?[[0,0],[(f=m).measured.width,f.measured.height]]:void 0}for(let[e,n]of(w=[],x=void 0,r))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,l=n[0]*i,s=n[1]*a;return[[r-l,o-s],[r+i-l,o+a-s]]}(n,p,n.origin??l);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}c?.(e,{...y})}).on("drag",e=>{let{transform:t,snapGrid:o,snapToGrid:i,nodeOrigin:l}=n(),s=nV(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:i,containerBounds:b}),u=[];if(!p)return;let{x:c,y:f,width:j,height:E}=y,C={},S=p.origin??l,{width:N,height:_,x:M,y:P}=function(e,t,n,r,o,i,a,l){var s,u,c,d;let{affectsX:f,affectsY:h}=t,{isHorizontal:p,isVertical:m}=t,g=p&&m,{xSnapped:x,ySnapped:y}=n,{minWidth:v,maxWidth:b,minHeight:w,maxHeight:k}=r,{x:j,y:E,width:C,height:S,aspectRatio:N}=e,_=Math.floor(p?x-e.pointerX:0),M=Math.floor(m?y-e.pointerY:0),P=C+(f?-_:_),R=S+(h?-M:M),A=-i[0]*C,I=-i[1]*S,D=rY(P,v,b),O=rY(R,w,k);if(a){let e=0,t=0;f&&_<0?e=rX(j+_+A,a[0][0]):!f&&_>0&&(e=rW(j+P+A,a[1][0])),h&&M<0?t=rX(E+M+I,a[0][1]):!h&&M>0&&(t=rW(E+R+I,a[1][1])),D=Math.max(D,e),O=Math.max(O,t)}if(l){let e=0,t=0;f&&_>0?e=rW(j+_,l[0][0]):!f&&_<0&&(e=rX(j+P,l[1][0])),h&&M>0?t=rW(E+M,l[0][1]):!h&&M<0&&(t=rX(E+R,l[1][1])),D=Math.max(D,e),O=Math.max(O,t)}if(o){if(p){(D=Math.max(D,rY(P/N,w,k)*N),a)&&(D=Math.max(D,(f||h)&&(!f||h||!g)?rX(E+I+(f?_:-_)/N,a[0][1])*N:rW(E+I+P/N,a[1][1])*N));l&&(D=Math.max(D,(f||h)&&(!f||h||!g)?rW(E+(f?_:-_)/N,l[0][1])*N:rX(E+P/N,l[1][1])*N))}if(m){(O=Math.max(O,rY(R*N,v,b)/N),a)&&(O=Math.max(O,(f||h)&&(!h||f||!g)?rX(j+(h?M:-M)*N+A,a[0][0])/N:rW(j+R*N+A,a[1][0])/N));l&&(O=Math.max(O,(f||h)&&(!h||f||!g)?rW(j+(h?M:-M)*N,l[0][0])/N:rX(j+R*N,l[1][0])/N))}}M+=M<0?O:-O,_+=_<0?D:-D,o&&(g?P>R*N?M=((s=f,u=h,s?!u:u)?-_:_)/N:_=((c=f,d=h,c?!d:d)?-M:M)*N:p?(M=_/N,h=f):(_=M*N,f=h));let T=f?j+_:j,z=h?E+M:E;return{width:C+(f?-_:_),height:S+(h?-M:M),x:i[0]*_*(f?-1:1)+T,y:i[1]*M*(h?-1:1)+z}}(v,a.controlDirection,s,a.boundaries,a.keepAspectRatio,S,g,x),R=N!==j,A=_!==E,I=M!==c&&R,D=P!==f&&A;if(!I&&!D&&!R&&!A)return;if((I||D||1===S[0]||1===S[1])&&(C.x=I?M:y.x,C.y=D?P:y.y,y.x=C.x,y.y=C.y,w.length>0)){let e=M-c,t=P-f;for(let n of w)n.position={x:n.position.x-e+S[0]*(N-j),y:n.position.y-t+S[1]*(_-E)},u.push(n)}if((R||A)&&(C.width=R&&(!a.resizeDirection||"horizontal"===a.resizeDirection)?N:y.width,C.height=A&&(!a.resizeDirection||"vertical"===a.resizeDirection)?_:y.height,y.width=C.width,y.height=C.height),m&&p.expandParent){let e=S[0]*(C.width??0);C.x&&C.x<e&&(y.x=e,v.x=v.x-(C.x-e));let t=S[1]*(C.height??0);C.y&&C.y<t&&(y.y=t,v.y=v.y-(C.y-t))}let O=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){let a=e-t,l=n-r,s=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&o&&(s[0]=-1*s[0]),l&&i&&(s[1]=-1*s[1]),s}({width:y.width,prevWidth:j,height:y.height,prevHeight:E,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),T={...y,direction:O};!1!==h?.(e,T)&&(k=!0,d?.(e,T),r(C,u))}).on("end",e=>{k&&(f?.(e,{...y}),o?.({...y}),k=!1)});i.call(j)},destroy:function(){i.on(".drag",null)}}}e.s(["ConnectionLineType",()=>h,"ConnectionMode",()=>c,"MarkerType",()=>p,"PanOnScrollMode",()=>d,"Position",()=>m,"ResizeControlVariant",()=>g,"SelectionMode",()=>f,"XYDrag",()=>r_,"XYHandle",()=>rI,"XYMinimap",()=>rD,"XYPanZoom",()=>rH,"XYResizer",()=>rZ,"XY_RESIZER_HANDLE_POSITIONS",()=>rV,"XY_RESIZER_LINE_POSITIONS",()=>rq,"addEdge",()=>n4,"adoptUserNodes",()=>rx,"areConnectionMapsEqual",()=>nn,"areSetsEqual",()=>nF,"calculateNodePosition",()=>nh,"createMarkerIds",()=>rl,"defaultAriaLabelConfig",()=>t7,"devWarn",()=>nM,"elementSelectionKeys",()=>t9,"errorMessages",()=>t6,"evaluateAbsolutePosition",()=>nB,"fitViewport",()=>nf,"getBezierEdgeCenter",()=>nZ,"getBezierPath",()=>n0,"getBoundsOfRects",()=>nC,"getConnectionStatus",()=>no,"getDimensions",()=>nq,"getEdgePosition",()=>rn,"getEdgeToolbarTransform",()=>rd,"getElementsToRemove",()=>np,"getElevatedEdgeZIndex",()=>n2,"getEventPosition",()=>nK,"getHandlePosition",()=>ro,"getHostForElement",()=>nU,"getInternalNodesBounds",()=>nc,"getMarkerId",()=>ra,"getNodeDimensions",()=>nz,"getNodeToolbarTransform",()=>rs,"getNodesBounds",()=>nu,"getNodesInside",()=>nd,"getOverlappingArea",()=>nS,"getSmoothStepPath",()=>re,"getStraightPath",()=>n6,"getViewportForBounds",()=>nD,"handleConnectionChange",()=>nr,"handleExpandParent",()=>rb,"infiniteExtent",()=>t8,"initialConnection",()=>ne,"isEdgeBase",()=>ni,"isEdgeVisible",()=>n5,"isInputDOMNode",()=>nW,"isMacOs",()=>nO,"isMouseEvent",()=>nY,"isNodeBase",()=>na,"isNumeric",()=>n_,"isRectObject",()=>nN,"mergeAriaLabelConfig",()=>nH,"nodeHasDimensions",()=>nL,"nodeToRect",()=>nj,"panBy",()=>rk,"pointToRendererPoint",()=>nR,"rendererPointToPoint",()=>nA,"shallowNodeData",()=>rC,"snapPosition",()=>nP,"updateAbsolutePositions",()=>rm,"updateConnectionLookup",()=>rE,"updateNodeInternals",()=>rw,"withResolvers",()=>n$],92002);var rQ=e.i(96482);let rJ={get url(){return`file://${e.P("node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.10_react@19.2.4/node_modules/zustand/esm/vanilla.mjs")}`}},r0=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{(rJ.env?rJ.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},{useDebugValue:r1}=v.default,{useSyncExternalStoreWithSelector:r2}=rQ.default,r5=e=>e;function r3(e,t=r5,n){let r=r2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return r1(r),r}let r4=(e,t)=>{let n=e?r0(e):r0,r=(e,r=t)=>r3(n,e,r);return Object.assign(r,n),r};function r6(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}e.i(26036);let r8=(0,v.createContext)(null),r9=r8.Provider,r7=t6.error001();function oe(e,t){let n=(0,v.useContext)(r8);if(null===n)throw Error(r7);return r3(n,e,t)}function ot(){let e=(0,v.useContext)(r8);if(null===e)throw Error(r7);return(0,v.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let on={display:"none"},or={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oo="react-flow__node-desc",oi="react-flow__edge-desc",oa=e=>e.ariaLiveMessage,ol=e=>e.ariaLabelConfig;function os({rfId:e}){let t=oe(oa);return(0,y.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:or,children:t})}function ou({rfId:e,disableKeyboardA11y:t}){let n=oe(ol);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{id:`${oo}-${e}`,style:on,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,y.jsx)("div",{id:`${oi}-${e}`,style:on,children:n["edge.a11yDescription.default"]}),!t&&(0,y.jsx)(os,{rfId:e})]})}let oc=(0,v.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{let a=`${e}`.split("-");return(0,y.jsx)("div",{className:b(["react-flow__panel",n,...a]),style:r,ref:i,...o,children:t})});function od({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,y.jsx)(oc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,y.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}oc.displayName="Panel";let of=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},oh=e=>e.id;function op(e,t){return r6(e.selectedNodes.map(oh),t.selectedNodes.map(oh))&&r6(e.selectedEdges.map(oh),t.selectedEdges.map(oh))}function om({onSelectionChange:e}){let t=ot(),{selectedNodes:n,selectedEdges:r}=oe(of,op);return(0,v.useEffect)(()=>{let o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}let og=e=>!!e.onSelectionChangeHandlers;function ox({onSelectionChange:e}){let t=oe(og);return e||t?(0,y.jsx)(om,{onSelectionChange:e}):null}let oy=[0,0],ov={x:0,y:0,zoom:1},ob=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],ow=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ok={translateExtent:t8,nodeOrigin:oy,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function oj(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:s}=oe(ow,r6),u=ot();(0,v.useEffect)(()=>(s(e.defaultNodes,e.defaultEdges),()=>{c.current=ok,l()}),[]);let c=(0,v.useRef)(ok);return(0,v.useEffect)(()=>{for(let l of ob){let s=e[l];s!==c.current[l]&&void 0!==e[l]&&("nodes"===l?t(s):"edges"===l?n(s):"minZoom"===l?r(s):"maxZoom"===l?o(s):"translateExtent"===l?i(s):"nodeExtent"===l?a(s):"ariaLabelConfig"===l?u.setState({ariaLabelConfig:nH(s)}):"fitView"===l?u.setState({fitViewQueued:s}):"fitViewOptions"===l?u.setState({fitViewOptions:s}):u.setState({[l]:s}))}c.current=e},ob.map(t=>e[t])),null}function oE(){return"u"<typeof window||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}let oC="u">typeof document?document:null;function oS(e=null,t={target:oC,actInsideInputWithModifier:!0}){let[n,r]=(0,v.useState)(!1),o=(0,v.useRef)(!1),i=(0,v.useRef)(new Set([])),[a,l]=(0,v.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,v.useEffect)(()=>{let n=t?.target??oC,s=t?.actInsideInputWithModifier??!0;if(null!==e){let e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!o.current||o.current&&!s)&&nW(e))return!1;let n=o_(e.code,l);if(i.current.add(e[n]),oN(a,i.current,!1)){let n=e.composedPath?.()?.[0]||e.target,i=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(o.current||!i)&&e.preventDefault(),r(!0)}},u=e=>{let t=o_(e.code,l);oN(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),o.current=!1},c=()=>{i.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",u),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",u),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[e,r]),n}function oN(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function o_(e,t){return t.includes(e)?"code":"key"}function oM(e,t){let n=[],r=new Map,o=[];for(let t of e)if("add"===t.type){o.push(t);continue}else if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let o={...e};for(let e of t){var i=e,a=o;switch(i.type){case"select":a.selected=i.selected;break;case"position":void 0!==i.position&&(a.position=i.position),void 0!==i.dragging&&(a.dragging=i.dragging);break;case"dimensions":void 0!==i.dimensions&&(a.measured={...i.dimensions},i.setAttributes&&((!0===i.setAttributes||"width"===i.setAttributes)&&(a.width=i.dimensions.width),(!0===i.setAttributes||"height"===i.setAttributes)&&(a.height=i.dimensions.height))),"boolean"==typeof i.resizing&&(a.resizing=i.resizing)}}n.push(o)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function oP(e,t){return oM(e,t)}function oR(e,t){return{id:e,type:"select",selected:t}}function oA(e,t=new Set,n=!1){let r=[];for(let[o,i]of e){let e=t.has(o);(void 0!==i.selected||e)&&i.selected!==e&&(n&&(i.selected=e),r.push(oR(i.id,e)))}return r}function oI({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,o]of e.entries()){let e=t.get(o.id),i=e?.internals?.userNode??e;void 0!==i&&i!==o&&n.push({id:o.id,item:o,type:"replace"}),void 0===i&&n.push({item:o,type:"add",index:r})}for(let[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function oD(e){return{id:e.id,type:"remove"}}function oO(e){return(0,v.forwardRef)(e)}let oT="u">typeof window?v.useLayoutEffect:v.useEffect;function oz(e){let[t,n]=(0,v.useState)(BigInt(0)),[r]=(0,v.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return oT(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}let oL=(0,v.createContext)(null);function oB({children:e}){let t=ot(),n=oz((0,v.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:i,nodeLookup:a,fitViewQueued:l,onNodesChangeMiddlewareMap:s}=t.getState(),u=n;for(let t of e)u="function"==typeof t?t(u):t;let c=oI({items:u,lookup:a});for(let e of s.values())c=e(c);o&&r(u),c.length>0?i?.(c):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=oz((0,v.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i,edgeLookup:a}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;o?r(l):i&&i(oI({items:l,lookup:a}))},[])),o=(0,v.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,y.jsx)(oL.Provider,{value:o,children:e})}let oF=e=>!!e.panZoom;function o$(){let e,t=(e=ot(),(0,v.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,o,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:o,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),s=nD(t,r,o,i,a,n?.padding??.1);return l?(await l.setViewport(s,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:o,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:l,y:s}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-s},c=n.snapGrid??o;return nR(u,r,n.snapToGrid??i,c)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:o,y:i}=r.getBoundingClientRect(),a=nA(t,n);return{x:a.x+o,y:a.y+i}}}),[])),n=ot(),r=function(){let e=(0,v.useContext)(oL);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),o=oe(oF),i=(0,v.useMemo)(()=>{let e=e=>n.getState().nodeLookup.get(e),t=e=>{r.nodeQueue.push(e)},o=e=>{r.edgeQueue.push(e)},i=e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState(),o=na(e)?e:t.get(e.id),i=o.parentId?nB(o.position,o.measured,o.parentId,t,r):o.position;return nj({...o,position:i,width:o.measured?.width??o.width,height:o.measured?.height??o.height})},a=(e,n,r={replace:!1})=>{t(t=>t.map(t=>{if(t.id===e){let e="function"==typeof n?n(t):n;return r.replace&&na(e)?e:{...t,...e}}return t}))},l=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){let e="function"==typeof t?t(r):t;return n.replace&&ni(e)?e:{...r,...e}}return r}))};return{getNodes:()=>n.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=n.getState();return e.map(e=>({...e}))},getEdge:e=>n.getState().edgeLookup.get(e),setNodes:t,setEdges:o,addNodes:e=>{let t=Array.isArray(e)?e:[e];r.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];r.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:t=[],transform:r}=n.getState(),[o,i,a]=r;return{nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:t=[]})=>{let{nodes:r,edges:o,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:l,triggerEdgeChanges:s,onDelete:u,onBeforeDelete:c}=n.getState(),{nodes:d,edges:f}=await np({nodesToRemove:e,edgesToRemove:t,nodes:r,edges:o,onBeforeDelete:c}),h=f.length>0,p=d.length>0;if(h){let e=f.map(oD);a?.(f),s(e)}if(p){let e=d.map(oD);i?.(d),l(e)}return(p||h)&&u?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,t=!0,r)=>{let o=nN(e),a=o?e:i(e),l=void 0!==r;return a?(r||n.getState().nodes).filter(r=>{let i=n.getState().nodeLookup.get(r.id);if(i&&!o&&(r.id===e.id||!i.internals.positionAbsolute))return!1;let s=nj(l?r:i),u=nS(s,a);return t&&u>0||u>=s.width*s.height||u>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=nN(e)?e:i(e);if(!r)return!1;let o=nS(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState();return nu(e,{nodeLookup:t,nodeOrigin:r})},getHandleConnections:({type:e,id:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}-${e}${t?`-${t}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}${e?t?`-${e}-${t}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let t=n.getState().fitViewResolver??n$();return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:t}),r.nodeQueue.push(e=>[...e]),t.promise}}},[]);return(0,v.useMemo)(()=>({...i,...t,viewportInitialized:o}),[o])}let oH=e=>e.selected,oV="u">typeof window?window:void 0,oq={position:"absolute",width:"100%",height:"100%",top:0,left:0},oU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function oX({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=d.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:s,translateExtent:u,minZoom:c,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:x,onViewportChange:b,isControlledViewport:w,paneClickDistance:k,selectionOnDrag:j}){let E,C=ot(),S=(0,v.useRef)(null),{userSelectionActive:N,lib:_,connectionInProgress:M}=oe(oU,r6),P=oS(h),R=(0,v.useRef)();E=ot(),(0,v.useEffect)(()=>{let e=()=>{if(!S.current||!(S.current.checkVisibility?.()??!0))return!1;let e=nq(S.current);(0===e.height||0===e.width)&&E.getState().onError?.("004",t6.error004()),E.setState({width:e.width||500,height:e.height||500})};if(S.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(S.current),()=>{window.removeEventListener("resize",e),t&&S.current&&t.unobserve(S.current)}}},[]);let A=(0,v.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),w||C.setState({transform:e})},[b,w]);return(0,v.useEffect)(()=>{if(S.current){R.current=rH({domNode:S.current,minZoom:c,maxZoom:f,translateExtent:u,viewport:s,onDraggingChange:e=>C.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=R.current.getViewport();return C.setState({panZoom:R.current,transform:[e,t,n],domNode:S.current.closest(".react-flow")}),()=>{R.current?.destroy()}}},[]),(0,v.useEffect)(()=>{R.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:P,preventScrolling:p,noPanClassName:x,userSelectionActive:N,noWheelClassName:g,lib:_,onTransformChange:A,connectionInProgress:M,selectionOnDrag:j,paneClickDistance:k})},[e,t,n,r,o,i,a,l,P,p,x,N,g,_,A,M,j,k]),(0,y.jsx)("div",{className:"react-flow__renderer",ref:S,style:oq,children:m})}let oW=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function oY(){let{userSelectionActive:e,userSelectionRect:t}=oe(oW,r6);return e&&t?(0,y.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let oK=(e,t)=>n=>{n.target===t.current&&e?.(n)},oG=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function oZ({isSelecting:e,selectionKeyPressed:t,selectionMode:n=f.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:l,onPaneClick:s,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:m}){let g=ot(),{userSelectionActive:x,elementsSelectable:w,dragging:k,connectionInProgress:j}=oe(oG,r6),E=w&&(e||x),C=(0,v.useRef)(null),S=(0,v.useRef)(),N=(0,v.useRef)(new Set),_=(0,v.useRef)(new Set),M=(0,v.useRef)(!1),P=e=>{if(M.current||j){M.current=!1;return}s?.(e),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},R=!0===r||Array.isArray(r)&&r.includes(0);return(0,y.jsxs)("div",{className:b(["react-flow__pane",{draggable:R,dragging:k,selection:e}]),onClick:E?void 0:oK(P,C),onContextMenu:oK(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},C),onWheel:oK(c?e=>c(e):void 0,C),onPointerEnter:E?void 0:d,onPointerMove:E?e=>{let{userSelectionRect:r,transform:i,nodeLookup:l,edgeLookup:s,connectionLookup:u,triggerNodeChanges:c,triggerEdgeChanges:d,defaultEdgeOptions:h,resetSelectedElements:p}=g.getState();if(!S.current||!r)return;let{x:m,y:x}=nK(e.nativeEvent,S.current),{startX:y,startY:v}=r;if(!M.current){if(Math.hypot(m-y,x-v)<=(t?0:o))return;p(),a?.(e)}M.current=!0;let b={startX:y,startY:v,x:m<y?m:y,y:x<v?x:v,width:Math.abs(m-y),height:Math.abs(x-v)},w=N.current,k=_.current;N.current=new Set(nd(l,b,i,n===f.Partial,!0).map(e=>e.id)),_.current=new Set;let j=h?.selectable??!0;for(let e of N.current){let t=u.get(e);if(t)for(let{edgeId:e}of t.values()){let t=s.get(e);t&&(t.selectable??j)&&_.current.add(e)}}nF(w,N.current)||c(oA(l,N.current,!0)),nF(k,_.current)||d(oA(s,_.current)),g.setState({userSelectionRect:b,userSelectionActive:!0,nodesSelectionActive:!1})}:h,onPointerUp:E?e=>{0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!x&&e.target===C.current&&g.getState().userSelectionRect&&P?.(e),g.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(l?.(e),g.setState({nodesSelectionActive:N.current.size>0})))}:void 0,onPointerDownCapture:E?n=>{let{domNode:r}=g.getState();if(S.current=r?.getBoundingClientRect(),!S.current)return;let o=n.target===C.current;if(!o&&n.target.closest(".nokey")||!e||!(i&&o||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),M.current=!1;let{x:a,y:l}=nK(n.nativeEvent,S.current);g.setState({userSelectionRect:{width:0,height:0,startX:a,startY:l,x:a,y:l}}),o||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:E?e=>{M.current&&(e.stopPropagation(),M.current=!1)}:void 0,onPointerLeave:p,ref:C,style:oq,children:[m,(0,y.jsx)(oY,{})]})}function oQ({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:s}=t.getState(),u=l.get(e);u?(t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):s?.("012",t6.error012(e))}function oJ({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:a}){let l=ot(),[s,u]=(0,v.useState)(!1),c=(0,v.useRef)();return(0,v.useEffect)(()=>{c.current=r_({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{oQ({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,v.useEffect)(()=>{if(t)c.current?.destroy();else if(e.current)return c.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:a}),()=>{c.current?.destroy()}},[n,r,t,i,e,o]),s}function o0(){let e=ot();return(0,v.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:i,onError:a,updateNodePositions:l,nodeLookup:s,nodeOrigin:u}=e.getState(),c=new Map,d=e=>e.selected&&(e.draggable||i&&void 0===e.draggable),f=r?o[0]:5,h=r?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*h*t.factor;for(let[,e]of s){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};r&&(t=nP(t,o));let{position:i,positionAbsolute:l}=nh({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:n,nodeOrigin:u,onError:a});e.position=i,e.internals.positionAbsolute=l,c.set(e.id,e)}l(c)},[])}let o1=(0,v.createContext)(null),o2=o1.Provider;o1.Consumer;let o5=()=>(0,v.useContext)(o1),o3=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),o4=(0,v.memo)(oO(function({type:e="source",position:t=m.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:s,className:u,onMouseDown:d,onTouchStart:f,...h},p){let g=a||null,x="target"===e,v=ot(),w=o5(),{connectOnClick:k,noPanClassName:j,rfId:E}=oe(o3,r6),{connectingFrom:C,connectingTo:S,clickConnecting:N,isPossibleEndHandle:_,connectionInProcess:M,clickConnectionInProcess:P,valid:R}=oe(t=>{let{connectionClickStartHandle:n,connectionMode:r,connection:o}=t,{fromHandle:i,toHandle:a,isValid:l}=o,s=a?.nodeId===w&&a?.id===g&&a?.type===e;return{connectingFrom:i?.nodeId===w&&i?.id===g&&i?.type===e,connectingTo:s,clickConnecting:n?.nodeId===w&&n?.id===g&&n?.type===e,isPossibleEndHandle:r===c.Strict?i?.type!==e:w!==i?.nodeId||g!==i?.id,connectionInProcess:!!i,clickConnectionInProcess:!!n,valid:s&&l}},r6);w||v.getState().onError?.("010",t6.error010());let A=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){let{edges:e,setEdges:t}=v.getState();t(n4(o,e))}n?.(o),l?.(o)},I=e=>{if(!w)return;let t=nY(e.nativeEvent);if(o&&(t&&0===e.button||!t)){let t=v.getState();rI.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:x,handleId:g,nodeId:w,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:A,isValidConnection:n||t.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?d?.(e):f?.(e)};return(0,y.jsx)("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":t,"data-id":`${E}-${w}-${g}-${e}`,className:b(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:C,connectingto:S,valid:R,connectionindicator:r&&(!M||_)&&(M||P?i:o)}]),onMouseDown:I,onTouchStart:I,onClick:k?t=>{let{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s,lib:u,rfId:c,nodeLookup:d,connection:f}=v.getState();if(!w||!a&&!o)return;if(!a){r?.(t.nativeEvent,{nodeId:w,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:w,type:e,id:g}});return}let h=nU(t.target),p=n||s,{connection:m,isValid:x}=rI.isValid(t.nativeEvent,{handle:{nodeId:w,id:g,type:e},connectionMode:l,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:p,flowId:c,doc:h,lib:u,nodeLookup:d});x&&m&&A(m);let y=structuredClone(f);delete y.inProgress,y.toPosition=y.toHandle?y.toHandle.position:null,i?.(t,y),v.setState({connectionClickStartHandle:null})}:void 0,ref:p,...h,children:s})})),o6={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},o8={input:function({data:e,isConnectable:t,sourcePosition:n=m.Bottom}){return(0,y.jsxs)(y.Fragment,{children:[e?.label,(0,y.jsx)(o4,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=m.Top,sourcePosition:r=m.Bottom}){return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o4,{type:"target",position:n,isConnectable:t}),e?.label,(0,y.jsx)(o4,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=m.Top}){return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o4,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},o9=e=>{let{width:t,height:n,x:r,y:o}=nc(e.nodeLookup,{filter:e=>!!e.selected});return{width:n_(t)?t:null,height:n_(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function o7({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=ot(),{width:o,height:i,transformString:a,userSelectionActive:l}=oe(o9,r6),s=o0(),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]),oJ({nodeRef:u}),l||!o||!i)return null;let c=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,y.jsx)("div",{className:b(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,y.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(o6,e.key)&&(e.preventDefault(),s({direction:o6[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:i}})})}let ie="u">typeof window?window:void 0,it=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ir({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:x,zoomOnScroll:b,zoomOnPinch:w,panOnScroll:k,panOnScrollSpeed:j,panOnScrollMode:E,zoomOnDoubleClick:C,panOnDrag:S,defaultViewport:N,translateExtent:_,minZoom:M,maxZoom:P,preventScrolling:R,onSelectionContextMenu:A,noWheelClassName:I,noPanClassName:D,disableKeyboardA11y:O,onViewportChange:T,isControlledViewport:z}){let{nodesSelectionActive:L,userSelectionActive:B}=oe(it,r6),F=oS(u,{target:ie}),$=oS(m,{target:ie}),H=$||S,V=$||k,q=c&&!0!==H,U=F||B||q;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=ot(),{deleteElements:r}=o$(),o=oS(e,{actInsideInputWithModifier:!1}),i=oS(t,{target:oV});(0,v.useEffect)(()=>{if(o){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(oH),edges:e.filter(oH)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,v.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:s,multiSelectionKeyCode:p}),(0,y.jsx)(oX,{onPaneContextMenu:i,elementsSelectable:x,zoomOnScroll:b,zoomOnPinch:w,panOnScroll:V,panOnScrollSpeed:j,panOnScrollMode:E,zoomOnDoubleClick:C,panOnDrag:!F&&H,defaultViewport:N,translateExtent:_,minZoom:M,maxZoom:P,zoomActivationKeyCode:g,preventScrolling:R,noWheelClassName:I,noPanClassName:D,onViewportChange:T,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:q,children:(0,y.jsxs)(oZ,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:H,isSelecting:!!U,selectionMode:d,selectionKeyPressed:F,paneClickDistance:l,selectionOnDrag:q,children:[e,L&&(0,y.jsx)(o7,{onSelectionContextMenu:A,noPanClassName:D,disableKeyboardA11y:O})]})})}ir.displayName="FlowRenderer";let io=(0,v.memo)(ir),ii=e=>e.updateNodeInternals;var ia=(0,v.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:s,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:p,rfId:m,nodeTypes:g,nodeClickDistance:x,onError:w}){let{node:k,internals:j,isParent:E}=oe(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},r6),C=k.type||"default",S=g?.[C]||o8[C];void 0===S&&(w?.("003",t6.error003(C)),C="default",S=g?.default||o8.default);let N=!!(k.draggable||l&&void 0===k.draggable),_=!!(k.selectable||s&&void 0===k.selectable),M=!!(k.connectable||u&&void 0===k.connectable),P=!!(k.focusable||c&&void 0===k.focusable),R=ot(),A=nL(k),I=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let o=ot(),i=(0,v.useRef)(null),a=(0,v.useRef)(null),l=(0,v.useRef)(e.sourcePosition),s=(0,v.useRef)(e.targetPosition),u=(0,v.useRef)(t),c=n&&!!e.internals.handleBounds;return(0,v.useEffect)(()=>{!i.current||e.hidden||c&&a.current===i.current||(a.current&&r?.unobserve(a.current),r?.observe(i.current),a.current=i.current)},[c,e.hidden]),(0,v.useEffect)(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),(0,v.useEffect)(()=>{if(i.current){let n=u.current!==t,r=l.current!==e.sourcePosition,a=s.current!==e.targetPosition;(n||r||a)&&(u.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}({node:k,nodeType:C,hasDimensions:A,resizeObserver:d}),D=oJ({nodeRef:I,disabled:k.hidden||!N,noDragClassName:f,handleSelector:k.dragHandle,nodeId:e,isSelectable:_,nodeClickDistance:x}),O=o0();if(k.hidden)return null;let T=nz(k),z=void 0===k.internals.handleBounds?{width:k.width??k.initialWidth??k.style?.width,height:k.height??k.initialHeight??k.style?.height}:{width:k.width??k.style?.width,height:k.height??k.style?.height},L=_||N||t||n||r||o,B=n?e=>n(e,{...j.userNode}):void 0,F=r?e=>r(e,{...j.userNode}):void 0,$=o?e=>o(e,{...j.userNode}):void 0,H=i?e=>i(e,{...j.userNode}):void 0,V=a?e=>a(e,{...j.userNode}):void 0;return(0,y.jsx)("div",{className:b(["react-flow__node",`react-flow__node-${C}`,{[h]:N},k.className,{selected:k.selected,selectable:_,parent:E,draggable:N,dragging:D}]),ref:I,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:A?"visible":"hidden",...k.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:F,onMouseLeave:$,onContextMenu:H,onClick:n=>{let{selectNodesOnDrag:r,nodeDragThreshold:o}=R.getState();_&&(!r||!N||o>0)&&oQ({id:e,store:R,nodeRef:I}),t&&t(n,{...j.userNode})},onDoubleClick:V,onKeyDown:P?t=>{if(!nW(t.nativeEvent)&&!p){if(t9.includes(t.key)&&_)oQ({id:e,store:R,unselect:"Escape"===t.key,nodeRef:I});else if(N&&k.selected&&Object.prototype.hasOwnProperty.call(o6,t.key)){t.preventDefault();let{ariaLabelConfig:e}=R.getState();R.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),O({direction:o6[t.key],factor:t.shiftKey?4:1})}}}:void 0,tabIndex:P?0:void 0,onFocus:P?()=>{if(p||!I.current?.matches(":focus-visible"))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:o,setCenter:i}=R.getState();!o||nd(new Map([[e,k]]),{x:0,y:0,width:n,height:r},t,!0).length>0||i(k.position.x+T.width/2,k.position.y+T.height/2,{zoom:t[2]})}:void 0,role:k.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${oo}-${m}`,"aria-label":k.ariaLabel,...k.domAttributes,children:(0,y.jsx)(o2,{value:e,children:(0,y.jsx)(S,{id:e,data:k.data,type:C,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:k.selected??!1,selectable:_,draggable:N,deletable:k.deletable??!0,isConnectable:M,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:D,dragHandle:k.dragHandle,zIndex:j.z,parentId:k.parentId,...T})})})});let il=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function is(e){var t;let{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,onError:a}=oe(il,r6),l=(t=e.onlyRenderVisibleElements,oe((0,v.useCallback)(e=>t?nd(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),r6)),s=function(){let e=oe(ii),[t]=(0,v.useState)(()=>"u"<typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,v.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,y.jsx)("div",{className:"react-flow__nodes",style:oq,children:l.map(t=>(0,y.jsx)(ia,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},t))})}is.displayName="NodeRenderer";let iu=(0,v.memo)(is),ic={[p.Arrow]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,y.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[p.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,y.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},id=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let s,u=(s=ot(),(0,v.useMemo)(()=>Object.prototype.hasOwnProperty.call(ic,t)?ic[t]:(s.getState().onError?.("009",t6.error009(t)),null),[t]));return u?(0,y.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:(0,y.jsx)(u,{color:n,strokeWidth:a})}):null},ih=({defaultColor:e,rfId:t})=>{let n=oe(e=>e.edges),r=oe(e=>e.defaultEdgeOptions),o=(0,v.useMemo)(()=>rl(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return o.length?(0,y.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,y.jsx)("defs",{children:o.map(e=>(0,y.jsx)(id,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};ih.displayName="MarkerDefinitions";var ip=(0,v.memo)(ih);function im({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:s,className:u,...c}){let[d,f]=(0,v.useState)({x:1,y:0,width:0,height:0}),h=b(["react-flow__edge-textwrapper",u]),p=(0,v.useRef)(null);return((0,v.useEffect)(()=>{if(p.current){let e=p.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,y.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...c,children:[o&&(0,y.jsx)("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),(0,y.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:p,style:r,children:n}),s]}):null}im.displayName="EdgeText";let ig=(0,v.memo)(im);function ix({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:u=20,...c}){return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{...c,d:e,fill:"none",className:b(["react-flow__edge-path",c.className])}),u?(0,y.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&n_(t)&&n_(n)?(0,y.jsx)(ig,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function iy({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===m.Left||e===m.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function iv({sourceX:e,sourceY:t,sourcePosition:n=m.Bottom,targetX:r,targetY:o,targetPosition:i=m.Top}){let[a,l]=iy({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,u]=iy({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,h]=nZ({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:u});return[`M${e},${t} C${a},${l} ${s},${u} ${r},${o}`,c,d,f,h]}function ib(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a,targetPosition:l,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,interactionWidth:x})=>{let[v,b,w]=iv({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return(0,y.jsx)(ix,{id:k,path:v,labelX:b,labelY:w,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,interactionWidth:x})})}let iw=ib({isInternal:!1}),ik=ib({isInternal:!0});function ij(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:h=m.Bottom,targetPosition:p=m.Top,markerEnd:g,markerStart:x,pathOptions:v,interactionWidth:b})=>{let[w,k,j]=re({sourceX:n,sourceY:r,sourcePosition:h,targetX:o,targetY:i,targetPosition:p,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),E=e.isInternal?void 0:t;return(0,y.jsx)(ix,{id:E,path:w,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:x,interactionWidth:b})})}iw.displayName="SimpleBezierEdge",ik.displayName="SimpleBezierEdgeInternal";let iE=ij({isInternal:!1}),iC=ij({isInternal:!0});function iS(e){return(0,v.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,y.jsx)(iE,{...n,id:r,pathOptions:(0,v.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}iE.displayName="SmoothStepEdge",iC.displayName="SmoothStepEdgeInternal";let iN=iS({isInternal:!1}),i_=iS({isInternal:!0});function iM(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{let[g,x,v]=n6({sourceX:n,sourceY:r,targetX:o,targetY:i}),b=e.isInternal?void 0:t;return(0,y.jsx)(ix,{id:b,path:g,labelX:x,labelY:v,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})})}iN.displayName="StepEdge",i_.displayName="StepEdgeInternal";let iP=iM({isInternal:!1}),iR=iM({isInternal:!0});function iA(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a=m.Bottom,targetPosition:l=m.Top,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:x,pathOptions:v,interactionWidth:b})=>{let[w,k,j]=n0({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:l,curvature:v?.curvature}),E=e.isInternal?void 0:t;return(0,y.jsx)(ix,{id:E,path:w,labelX:k,labelY:j,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:x,interactionWidth:b})})}iP.displayName="StraightEdge",iR.displayName="StraightEdgeInternal";let iI=iA({isInternal:!1}),iD=iA({isInternal:!0});iI.displayName="BezierEdge",iD.displayName="BezierEdgeInternal";let iO={default:iD,straight:iR,step:i_,smoothstep:iC,simplebezier:ik},iT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},iz="react-flow__edgeupdater";function iL({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:l}){return(0,y.jsx)("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:b([iz,`${iz}-${l}`]),cx:e===m.Left?t-r:e===m.Right?t+r:t,cy:e===m.Top?n-r:e===m.Bottom?n+r:n,r:r,stroke:"transparent",fill:"transparent"})}function iB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:a,sourcePosition:l,targetPosition:s,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){let p=ot(),m=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:r,domNode:o,isValidConnection:i,connectionMode:a,connectionRadius:l,lib:s,onConnectStart:h,onConnectEnd:m,cancelConnection:g,nodeLookup:x,rfId:y,panBy:v,updateConnection:b}=p.getState(),w="target"===t.type;rI.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:l,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:x,isTarget:w,edgeUpdaterType:t.type,lib:s,flowId:y,cancelConnection:g,panBy:v,isValidConnection:i,onConnect:e=>u?.(n,e),onConnectStart:(r,o)=>{f(!0),c?.(e,n,t.type),h?.(r,o)},onConnectEnd:m,onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:b,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>h(!0),x=()=>h(!1);return(0,y.jsxs)(y.Fragment,{children:[(!0===e||"source"===e)&&(0,y.jsx)(iL,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:e=>m(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:x,type:"source"}),(!0===e||"target"===e)&&(0,y.jsx)(iL,{position:s,centerX:i,centerY:a,radius:t,onMouseDown:e=>m(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:x,type:"target"})]})}var iF=(0,v.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:p,edgeTypes:m,noPanClassName:g,onError:x,disableKeyboardA11y:w}){let k=oe(t=>t.edgeLookup.get(e)),j=oe(e=>e.defaultEdgeOptions),E=(k=j?{...j,...k}:k).type||"default",C=m?.[E]||iO[E];void 0===C&&(x?.("011",t6.error011(E)),E="default",C=m?.default||iO.default);let S=!!(k.focusable||t&&void 0===k.focusable),N=void 0!==d&&(k.reconnectable||n&&void 0===k.reconnectable),_=!!(k.selectable||r&&void 0===k.selectable),M=(0,v.useRef)(null),[P,R]=(0,v.useState)(!1),[A,I]=(0,v.useState)(!1),D=ot(),{zIndex:O,sourceX:T,sourceY:z,targetX:L,targetY:B,sourcePosition:F,targetPosition:$}=oe((0,v.useCallback)(t=>{let n=t.nodeLookup.get(k.source),r=t.nodeLookup.get(k.target);if(!n||!r)return{zIndex:k.zIndex,...iT};let o=rn({id:e,sourceNode:n,targetNode:r,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:t.connectionMode,onError:x});return{zIndex:n2({selected:k.selected,zIndex:k.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...o||iT}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),r6),H=(0,v.useMemo)(()=>k.markerStart?`url('#${ra(k.markerStart,p)}')`:void 0,[k.markerStart,p]),V=(0,v.useMemo)(()=>k.markerEnd?`url('#${ra(k.markerEnd,p)}')`:void 0,[k.markerEnd,p]);if(k.hidden||null===T||null===z||null===L||null===B)return null;let q=i?e=>{i(e,{...k})}:void 0,U=a?e=>{a(e,{...k})}:void 0,X=l?e=>{l(e,{...k})}:void 0,W=s?e=>{s(e,{...k})}:void 0,Y=u?e=>{u(e,{...k})}:void 0;return(0,y.jsx)("svg",{style:{zIndex:O},children:(0,y.jsxs)("g",{className:b(["react-flow__edge",`react-flow__edge-${E}`,k.className,g,{selected:k.selected,animated:k.animated,inactive:!_&&!o,updating:P,selectable:_}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:i}=D.getState();_&&(D.setState({nodesSelectionActive:!1}),k.selected&&i?(r({nodes:[],edges:[k]}),M.current?.blur()):n([e])),o&&o(t,k)},onDoubleClick:q,onContextMenu:U,onMouseEnter:X,onMouseMove:W,onMouseLeave:Y,onKeyDown:S?t=>{if(!w&&t9.includes(t.key)&&_){let{unselectNodesAndEdges:n,addSelectedEdges:r}=D.getState();"Escape"===t.key?(M.current?.blur(),n({edges:[k]})):r([e])}}:void 0,tabIndex:S?0:void 0,role:k.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===k.ariaLabel?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":S?`${oi}-${p}`:void 0,ref:M,...k.domAttributes,children:[!A&&(0,y.jsx)(C,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:_,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:T,sourceY:z,targetX:L,targetY:B,sourcePosition:F,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:H,markerEnd:V,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),N&&(0,y.jsx)(iB,{edge:k,isReconnectable:N,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:T,sourceY:z,targetX:L,targetY:B,sourcePosition:F,targetPosition:$,setUpdateHover:R,setReconnecting:I})]})})});let i$=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function iH({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:m}){let{edgesFocusable:g,edgesReconnectable:x,elementsSelectable:b,onError:w}=oe(i$,r6),k=oe((0,v.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let r=e.nodeLookup.get(t.source),o=e.nodeLookup.get(t.target);r&&o&&n5({sourceNode:r,targetNode:o,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),r6);return(0,y.jsxs)("div",{className:"react-flow__edges",children:[(0,y.jsx)(ip,{defaultColor:e,rfId:n}),k.map(e=>(0,y.jsx)(iF,{id:e,edgesFocusable:g,edgesReconnectable:x,elementsSelectable:b,noPanClassName:o,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:w,edgeTypes:r,disableKeyboardA11y:m},e))]})}iH.displayName="EdgeRenderer";let iV=(0,v.memo)(iH),iq=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function iU({children:e}){let t=oe(iq);return(0,y.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}let iX=e=>e.panZoom?.syncViewport;function iW(e){return e.connection.inProgress?{...e.connection,to:nR(e.connection.to,e.transform)}:{...e.connection}}let iY=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iK({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:o,width:i,height:a,isValid:l,inProgress:s}=oe(iY,r6);return i&&o&&s?(0,y.jsx)("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:(0,y.jsx)("g",{className:b(["react-flow__connection",no(l)]),children:(0,y.jsx)(iG,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}let iG=({style:e,type:t=h.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:o,from:i,fromNode:a,fromHandle:l,fromPosition:s,to:u,toNode:c,toHandle:d,toPosition:f,pointer:p}=oe(iW,r6);if(!o)return;if(n)return(0,y.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:s,toPosition:f,connectionStatus:no(r),toNode:c,toHandle:d,pointer:p});let m="",g={sourceX:i.x,sourceY:i.y,sourcePosition:s,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case h.Bezier:[m]=n0(g);break;case h.SimpleBezier:[m]=iv(g);break;case h.Step:[m]=re({...g,borderRadius:0});break;case h.SmoothStep:[m]=re(g);break;default:[m]=n6(g)}return(0,y.jsx)("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};iG.displayName="ConnectionLine";let iZ={};function iQ(e=iZ){(0,v.useRef)(e),ot(),(0,v.useEffect)(()=>{},[e])}function iJ({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:m,connectionLineComponent:g,connectionLineContainerStyle:x,selectionKeyCode:b,selectionOnDrag:w,selectionMode:k,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:C,deleteKeyCode:S,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:M,translateExtent:P,minZoom:R,maxZoom:A,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:O,zoomOnPinch:T,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:B,zoomOnDoubleClick:F,panOnDrag:$,onPaneClick:H,onPaneMouseEnter:V,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneScroll:X,onPaneContextMenu:W,paneClickDistance:Y,nodeClickDistance:K,onEdgeContextMenu:G,onEdgeMouseEnter:Z,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,onReconnect:et,onReconnectStart:en,onReconnectEnd:er,noDragClassName:eo,noWheelClassName:ei,noPanClassName:ea,disableKeyboardA11y:el,nodeExtent:es,rfId:eu,viewport:ec,onViewportChange:ed}){let ef,eh,ep,em;return iQ(e),iQ(t),ot(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{},[]),ef=o$(),eh=(0,v.useRef)(!1),(0,v.useEffect)(()=>{!eh.current&&ef.viewportInitialized&&n&&(setTimeout(()=>n(ef),1),eh.current=!0)},[n,ef.viewportInitialized]),ep=oe(iX),em=ot(),(0,v.useEffect)(()=>{ec&&(ep?.(ec),em.setState({transform:[ec.x,ec.y,ec.zoom]}))},[ec,ep]),(0,y.jsx)(io,{onPaneClick:H,onPaneMouseEnter:V,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:W,onPaneScroll:X,paneClickDistance:Y,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:w,selectionMode:k,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:_,zoomOnScroll:O,zoomOnPinch:T,zoomOnDoubleClick:F,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:B,panOnDrag:$,defaultViewport:M,translateExtent:P,minZoom:R,maxZoom:A,onSelectionContextMenu:d,preventScrolling:I,noDragClassName:eo,noWheelClassName:ei,noPanClassName:ea,disableKeyboardA11y:el,onViewportChange:ed,isControlledViewport:!!ec,children:(0,y.jsxs)(iU,{children:[(0,y.jsx)(iV,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:a,onReconnect:et,onReconnectStart:en,onReconnectEnd:er,onlyRenderVisibleElements:N,onEdgeContextMenu:G,onEdgeMouseEnter:Z,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,defaultMarkerColor:D,noPanClassName:ea,disableKeyboardA11y:el,rfId:eu}),(0,y.jsx)(iK,{style:m,type:p,component:g,containerStyle:x}),(0,y.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,y.jsx)(iu,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:K,onlyRenderVisibleElements:N,noPanClassName:ea,noDragClassName:eo,disableKeyboardA11y:el,nodeExtent:es,rfId:eu}),(0,y.jsx)("div",{className:"react-flow__viewport-portal"})]})})}iJ.displayName="GraphView";let i0=(0,v.memo)(iJ),i1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{let p=new Map,m=new Map,g=new Map,x=new Map,y=r??t??[],v=n??e??[],b=d??[0,0],w=f??t8;rE(g,x,y);let k=rx(v,p,m,{nodeOrigin:b,nodeExtent:w,zIndexMode:h}),j=[0,0,1];if(a&&o&&i){let{x:e,y:t,zoom:n}=nD(nc(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),o,i,s,u,l?.padding??.1);j=[e,t,n]}return{rfId:"1",width:o??0,height:i??0,transform:j,nodes:v,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:x,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:s,maxZoom:u,translateExtent:t8,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:c.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...ne},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:t7,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}};function i2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:s,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:h}){let[p]=(0,v.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>{let h,p;return h=(h,p)=>{async function g(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:i,minZoom:a,maxZoom:l}=p();t&&(await nf({nodes:e,width:o,height:i,panZoom:t,minZoom:a,maxZoom:l},n),r?.resolve(!0),h({fitViewResolver:null}))}return{...i1({nodes:e,edges:t,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:o,fitViewQueued:i,zIndexMode:a}=p(),l=rx(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:o,checkEquality:!0,zIndexMode:a});i&&l?(g(),h({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:e,nodesInitialized:l})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=p();rE(t,n,e),h({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=p();t(e),h({hasDefaultNodes:!0})}if(t){let{setEdges:e}=p();e(t),h({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:i,nodeExtent:a,debug:l,fitViewQueued:s,zIndexMode:u}=p(),{changes:c,updatedInternals:d}=rw(e,n,r,o,i,a,u);d&&(rm(n,r,{nodeOrigin:i,nodeExtent:a,zIndexMode:u}),s?(g(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),c?.length>0&&(l&&console.log("React Flow: trigger node changes",c),t?.(c)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:o,triggerNodeChanges:i,connection:a,updateConnection:l,onNodesChangeMiddlewareMap:s}=p();for(let[i,s]of e){let e=o.get(i),u=!!(e?.expandParent&&e?.parentId&&s?.position),c={id:i,type:"position",position:u?{x:Math.max(0,s.position.x),y:Math.max(0,s.position.y)}:s.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){let t=ro(e,a.fromHandle,m.Left,!0);l({...a,from:t})}u&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...s.internals.positionAbsolute,width:s.measured.width??0,height:s.measured.height??0}}),r.push(c)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=p(),i=rb(n,o,e,t);r.push(...i)}for(let e of s.values())r=e(r);i(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:i}=p();e?.length&&(o&&n(oM(e,r)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:i}=p();e?.length&&(o&&n(oM(e,r)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=p();t?o(e.map(e=>oR(e,!0))):(o(oA(r,new Set([...e]),!0)),i(oA(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=p();t?i(e.map(e=>oR(e,!0))):(i(oA(n,new Set([...e]))),o(oA(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:i,triggerEdgeChanges:a}=p(),l=(e||r).map(e=>{let t=o.get(e.id);return t&&(t.selected=!1),oR(e.id,!1)}),s=(t||n).map(e=>oR(e.id,!1));i(l),a(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=p();t?.setScaleExtent([e,n]),h({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=p();t?.setScaleExtent([n,e]),h({maxZoom:e})},setTranslateExtent:e=>{p().panZoom?.setTranslateExtent(e),h({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=p();if(!o)return;let i=t.reduce((e,t)=>t.selected?[...e,oR(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,oR(t.id,!1)]:e,[]);n(i),r(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:i,nodeExtent:a,zIndexMode:l}=p();(e[0][0]!==a[0][0]||e[0][1]!==a[0][1]||e[1][0]!==a[1][0]||e[1][1]!==a[1][1])&&(rx(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1,zIndexMode:l}),h({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:o,translateExtent:i}=p();return rk({delta:e,panZoom:o,transform:t,translateExtent:i,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:o,maxZoom:i,panZoom:a}=p();if(!a)return Promise.resolve(!1);let l=void 0!==n?.zoom?n.zoom:i;return await a.setViewport({x:r/2-e*l,y:o/2-t*l,zoom:l},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...ne}})},updateConnection:e=>{h({connection:e})},reset:()=>h({...i1()})}},p=Object.is,h?r4(h,p):r4})({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:s,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return(0,y.jsx)(r9,{value:p,children:(0,y.jsx)(oB,{children:h})})}function i5({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:a,fitView:l,fitViewOptions:s,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return(0,v.useContext)(r8)?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(i2,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:s,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}let i3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var i4=oO(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:s,onInit:u,onMove:c,onMoveStart:p,onMoveEnd:m,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:k,onClickConnectEnd:j,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:S,onNodeContextMenu:N,onNodeDoubleClick:_,onNodeDragStart:M,onNodeDrag:P,onNodeDragStop:R,onNodesDelete:A,onEdgesDelete:I,onDelete:D,onSelectionChange:O,onSelectionDragStart:T,onSelectionDrag:z,onSelectionDragStop:L,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,onBeforeDelete:H,connectionMode:V,connectionLineType:q=h.Bezier,connectionLineStyle:U,connectionLineComponent:X,connectionLineContainerStyle:W,deleteKeyCode:Y="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:G=!1,selectionMode:Z=f.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:J=nO()?"Meta":"Control",zoomActivationKeyCode:ee=nO()?"Meta":"Control",snapToGrid:et,snapGrid:en,onlyRenderVisibleElements:er=!1,selectNodesOnDrag:eo,nodesDraggable:ei,autoPanOnNodeFocus:ea,nodesConnectable:el,nodesFocusable:es,nodeOrigin:eu=oy,edgesFocusable:ec,edgesReconnectable:ed,elementsSelectable:ef=!0,defaultViewport:eh=ov,minZoom:ep=.5,maxZoom:em=2,translateExtent:eg=t8,preventScrolling:ex=!0,nodeExtent:ey,defaultMarkerColor:ev="#b1b1b7",zoomOnScroll:eb=!0,zoomOnPinch:ew=!0,panOnScroll:ek=!1,panOnScrollSpeed:ej=.5,panOnScrollMode:eE=d.Free,zoomOnDoubleClick:eC=!0,panOnDrag:eS=!0,onPaneClick:eN,onPaneMouseEnter:e_,onPaneMouseMove:eM,onPaneMouseLeave:eP,onPaneScroll:eR,onPaneContextMenu:eA,paneClickDistance:eI=1,nodeClickDistance:eD=0,children:eO,onReconnect:eT,onReconnectStart:ez,onReconnectEnd:eL,onEdgeContextMenu:eB,onEdgeDoubleClick:eF,onEdgeMouseEnter:e$,onEdgeMouseMove:eH,onEdgeMouseLeave:eV,reconnectRadius:eq=10,onNodesChange:eU,onEdgesChange:eX,noDragClassName:eW="nodrag",noWheelClassName:eY="nowheel",noPanClassName:eK="nopan",fitView:eG,fitViewOptions:eZ,connectOnClick:eQ,attributionPosition:eJ,proOptions:e0,defaultEdgeOptions:e1,elevateNodesOnSelect:e2=!0,elevateEdgesOnSelect:e5=!1,disableKeyboardA11y:e3=!1,autoPanOnConnect:e4,autoPanOnNodeDrag:e6,autoPanSpeed:e8,connectionRadius:e9,isValidConnection:e7,onError:te,style:tt,id:tn,nodeDragThreshold:tr,connectionDragThreshold:to,viewport:ti,onViewportChange:ta,width:tl,height:ts,colorMode:tu="light",debug:tc,onScroll:td,ariaLabelConfig:tf,zIndexMode:th="basic",...tp},tm){let tg=tn||"1",tx=function(e){let[t,n]=(0,v.useState)("system"===e?null:e);return(0,v.useEffect)(()=>{if("system"!==e)return void n(e);let t=oE(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:oE()?.matches?"dark":"light"}(tu),ty=(0,v.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),td?.(e)},[td]);return(0,y.jsx)("div",{"data-testid":"rf__wrapper",...tp,onScroll:ty,style:{...tt,...i3},ref:tm,className:b(["react-flow",o,tx]),id:tn,role:"application",children:(0,y.jsxs)(i5,{nodes:e,edges:t,width:tl,height:ts,fitView:eG,fitViewOptions:eZ,minZoom:ep,maxZoom:em,nodeOrigin:eu,nodeExtent:ey,zIndexMode:th,children:[(0,y.jsx)(i0,{onInit:u,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:S,onNodeContextMenu:N,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:a,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:X,connectionLineContainerStyle:W,selectionKeyCode:K,selectionOnDrag:G,selectionMode:Z,deleteKeyCode:Y,multiSelectionKeyCode:J,panActivationKeyCode:Q,zoomActivationKeyCode:ee,onlyRenderVisibleElements:er,defaultViewport:eh,translateExtent:eg,minZoom:ep,maxZoom:em,preventScrolling:ex,zoomOnScroll:eb,zoomOnPinch:ew,zoomOnDoubleClick:eC,panOnScroll:ek,panOnScrollSpeed:ej,panOnScrollMode:eE,panOnDrag:eS,onPaneClick:eN,onPaneMouseEnter:e_,onPaneMouseMove:eM,onPaneMouseLeave:eP,onPaneScroll:eR,onPaneContextMenu:eA,paneClickDistance:eI,nodeClickDistance:eD,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,onReconnect:eT,onReconnectStart:ez,onReconnectEnd:eL,onEdgeContextMenu:eB,onEdgeDoubleClick:eF,onEdgeMouseEnter:e$,onEdgeMouseMove:eH,onEdgeMouseLeave:eV,reconnectRadius:eq,defaultMarkerColor:ev,noDragClassName:eW,noWheelClassName:eY,noPanClassName:eK,rfId:tg,disableKeyboardA11y:e3,nodeExtent:ey,viewport:ti,onViewportChange:ta}),(0,y.jsx)(oj,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:x,onConnectEnd:w,onClickConnectStart:k,onClickConnectEnd:j,nodesDraggable:ei,autoPanOnNodeFocus:ea,nodesConnectable:el,nodesFocusable:es,edgesFocusable:ec,edgesReconnectable:ed,elementsSelectable:ef,elevateNodesOnSelect:e2,elevateEdgesOnSelect:e5,minZoom:ep,maxZoom:em,nodeExtent:ey,onNodesChange:eU,onEdgesChange:eX,snapToGrid:et,snapGrid:en,connectionMode:V,translateExtent:eg,connectOnClick:eQ,defaultEdgeOptions:e1,fitView:eG,fitViewOptions:eZ,onNodesDelete:A,onEdgesDelete:I,onDelete:D,onNodeDragStart:M,onNodeDrag:P,onNodeDragStop:R,onSelectionDrag:z,onSelectionDragStart:T,onSelectionDragStop:L,onMove:c,onMoveStart:p,onMoveEnd:m,noPanClassName:eK,nodeOrigin:eu,rfId:tg,autoPanOnConnect:e4,autoPanOnNodeDrag:e6,autoPanSpeed:e8,onError:te,connectionRadius:e9,isValidConnection:e7,selectNodesOnDrag:eo,nodeDragThreshold:tr,connectionDragThreshold:to,onBeforeDelete:H,debug:tc,ariaLabelConfig:tf,zIndexMode:th}),(0,y.jsx)(ox,{onSelectionChange:O}),eO,(0,y.jsx)(od,{proOptions:e0,position:eJ}),(0,y.jsx)(ou,{rfId:tg,disableKeyboardA11y:e3})]})})});function i6({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,y.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:b(["react-flow__background-pattern",n,r])})}function i8({radius:e,className:t}){return(0,y.jsx)("circle",{cx:e,cy:e,r:e,className:b(["react-flow__background-pattern","dots",t])})}t6.error014(),(s=x||(x={})).Lines="lines",s.Dots="dots",s.Cross="cross";let i9={[x.Dots]:1,[x.Lines]:1,[x.Cross]:6},i7=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ae({id:e,variant:t=x.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:a,bgColor:l,style:s,className:u,patternClassName:c}){let d=(0,v.useRef)(null),{transform:f,patternId:h}=oe(i7,r6),p=r||i9[t],m=t===x.Dots,g=t===x.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*f[2]||1,w[1]*f[2]||1],j=p*f[2],E=Array.isArray(i)?i:[i,i],C=g?[j,j]:k,S=[E[0]*f[2]||1+C[0]/2,E[1]*f[2]||1+C[1]/2],N=`${h}${e||""}`;return(0,y.jsxs)("svg",{className:b(["react-flow__background",u]),style:{...s,...oq,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[(0,y.jsx)("pattern",{id:N,x:f[0]%k[0],y:f[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:m?(0,y.jsx)(i8,{radius:j/2,className:c}):(0,y.jsx)(i6,{dimensions:C,lineWidth:o,variant:t,className:c})}),(0,y.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}ae.displayName="Background";let at=(0,v.memo)(ae);function an(){return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,y.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ar(){return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,y.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function ao(){return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,y.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ai(){return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,y.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function aa(){return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,y.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function al({children:e,className:t,...n}){return(0,y.jsx)("button",{type:"button",className:b(["react-flow__controls-button",t]),...n,children:e})}let as=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function au({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:s,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":h}){let p=ot(),{isInteractive:m,minZoomReached:g,maxZoomReached:x,ariaLabelConfig:v}=oe(as,r6),{zoomIn:w,zoomOut:k,fitView:j}=o$();return(0,y.jsxs)(oc,{className:b(["react-flow__controls","horizontal"===f?"horizontal":"vertical",u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(al,{onClick:()=>{w(),i?.()},className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:x,children:(0,y.jsx)(an,{})}),(0,y.jsx)(al,{onClick:()=>{k(),a?.()},className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:g,children:(0,y.jsx)(ar,{})})]}),n&&(0,y.jsx)(al,{className:"react-flow__controls-fitview",onClick:()=>{j(o),l?.()},title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:(0,y.jsx)(ao,{})}),r&&(0,y.jsx)(al,{className:"react-flow__controls-interactive",onClick:()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),s?.(!m)},title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:m?(0,y.jsx)(aa,{}):(0,y.jsx)(ai,{})}),c]})}au.displayName="Controls";let ac=(0,v.memo)(au),ad=(0,v.memo)(function({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:l,strokeWidth:s,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:h}){let{background:p,backgroundColor:m}=i||{};return(0,y.jsx)("rect",{className:b(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:a||p||m,stroke:l,strokeWidth:s},shapeRendering:d,onClick:h?t=>h(t,e):void 0})}),af=e=>e.nodes.map(e=>e.id),ah=e=>e instanceof Function?e:()=>e,ap=(0,v.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:s}){let{node:u,x:c,y:d,width:f,height:h}=oe(t=>{let{internals:n}=t.nodeLookup.get(e),r=n.userNode,{x:o,y:i}=n.positionAbsolute,{width:a,height:l}=nz(r);return{node:r,x:o,y:i,width:a,height:l}},r6);return u&&!u.hidden&&nL(u)?(0,y.jsx)(l,{x:c,y:d,width:f,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:s,id:u.id}):null});var am=(0,v.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=ad,onClick:a}){let l=oe(af,r6),s=ah(t),u=ah(e),c=ah(n),d="u"<typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,y.jsx)(y.Fragment,{children:l.map(e=>(0,y.jsx)(ap,{id:e,nodeColorFunc:s,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:a,shapeRendering:d},e))})});let ag=e=>!e.hidden,ax=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nC(nc(e.nodeLookup,{filter:ag}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function ay({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:s,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:m=!1,zoomable:g=!1,ariaLabel:x,inversePan:w,zoomStep:k=1,offsetScale:j=5}){let E=ot(),C=(0,v.useRef)(null),{boundingRect:S,viewBB:N,rfId:_,panZoom:M,translateExtent:P,flowWidth:R,flowHeight:A,ariaLabelConfig:I}=oe(ax,r6),D=e?.width??200,O=e?.height??150,T=Math.max(S.width/D,S.height/O),z=T*D,L=T*O,B=j*T,F=S.x-(z-S.width)/2-B,$=S.y-(L-S.height)/2-B,H=z+2*B,V=L+2*B,q=`react-flow__minimap-desc-${_}`,U=(0,v.useRef)(0),X=(0,v.useRef)();U.current=T,(0,v.useEffect)(()=>{if(C.current&&M)return X.current=rD({domNode:C.current,panZoom:M,getTransform:()=>E.getState().transform,getViewScale:()=>U.current}),()=>{X.current?.destroy()}},[M]),(0,v.useEffect)(()=>{X.current?.update({translateExtent:P,width:R,height:A,inversePan:w,pannable:m,zoomStep:k,zoomable:g})},[m,g,w,k,P,R,A]);let W=h?e=>{let[t,n]=X.current?.pointer(e)||[0,0];h(e,{x:t,y:n})}:void 0,Y=p?(0,v.useCallback)((e,t)=>{p(e,E.getState().nodeLookup.get(t).internals.userNode)},[]):void 0,K=x??I["minimap.ariaLabel"];return(0,y.jsx)(oc,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof s?s:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*T:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof a?a:void 0},className:b(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,y.jsxs)("svg",{width:D,height:O,viewBox:`${F} ${$} ${H} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:C,onClick:W,children:[K&&(0,y.jsx)("title",{id:q,children:K}),(0,y.jsx)(am,{onClick:Y,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),(0,y.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-B},${$-B}h${H+2*B}v${V+2*B}h${-H-2*B}z
4
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ay.displayName="MiniMap",(0,v.memo)(ay);let av={[g.Line]:"right",[g.Handle]:"bottom-right"};(0,v.memo)(function({nodeId:e,position:t,variant:n=g.Handle,className:r,style:o,children:i,color:a,minWidth:l=10,minHeight:s=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:p,onResizeStart:m,onResize:x,onResizeEnd:w}){let k,j=o5(),E="string"==typeof e?e:j,C=ot(),S=(0,v.useRef)(null),N=n===g.Handle,_=oe((0,v.useCallback)((k=N&&h,e=>k?`${Math.max(1/e.transform[2],1)}`:void 0),[N,h]),r6),M=(0,v.useRef)(null),P=t??av[n];(0,v.useEffect)(()=>{if(S.current&&E)return M.current||(M.current=rZ({domNode:S.current,nodeId:E,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:i}=C.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:i}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:i}=C.getState(),a=[],l={x:e.x,y:e.y},s=r.get(E);if(s&&s.expandParent&&s.parentId){let t=s.origin??i,n=e.width??s.measured.width??0,u=e.height??s.measured.height??0,c=rb([{id:s.id,parentId:s.parentId,rect:{width:n,height:u,...nB({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:u},s.parentId,r,t)}}],r,o,i);a.push(...c),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*u,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:E,type:"position",position:{...l}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:E,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(let e of t){let t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{C.getState().triggerNodeChanges([{id:E,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),M.current.update({controlPosition:P,boundaries:{minWidth:l,minHeight:s,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:x,onResizeEnd:w,shouldResize:p}),()=>{M.current?.destroy()}},[P,l,s,u,c,d,m,x,w,p]);let R=P.split("-");return(0,y.jsx)("div",{className:b(["react-flow__resize-control","nodrag",...R,n,r]),ref:S,style:{...o,scale:_,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}),e.s(["Background",()=>at,"BaseEdge",()=>ix,"Controls",()=>ac,"Handle",()=>o4,"ReactFlow",()=>i4,"ReactFlowProvider",()=>i2,"applyNodeChanges",()=>oP],53271);var ab=e.i(31406),aw=e.i(60112),ak=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),aj=ak((e,t)=>{var n=Object.defineProperty,r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,r)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?n(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r},i=r((e,t)=>{function n(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function i(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}return o+"\x01"+i+"\x01"+(void 0===r?"\0":r)}function a(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var n=t;void 0!==n;n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=n.parent(o);return void 0===i||t.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,o){return r.length>1?n.setEdge(e,o,t):n.setEdge(e,o),o}),this}setEdge(){var e,t,r,o,a=!1,l=arguments[0];"object"==typeof l&&null!==l&&"v"in l?(e=l.v,t=l.w,r=l.name,2==arguments.length&&(o=arguments[1],a=!0)):(e=l,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,void 0!==r&&(r=""+r);var s=i(this._isDirected,e,t,r);if(Object.hasOwn(this._edgeLabels,s))return a&&(this._edgeLabels[s]=o),this;if(void 0!==r&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=a?o:this._defaultEdgeLabelFn(e,t,r);var u=function(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var l={v:o,w:i};return r&&(l.name=r),l}(this._isDirected,e,t,r);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this}edge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var o=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),l=this._edgeObjs[o];return l&&(e=l.v,t=l.w,delete this._edgeLabels[o],delete this._edgeObjs[o],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}}}),a=r((e,t)=>{t.exports="3.0.2"}),l=r((e,t)=>{t.exports={Graph:i(),version:a()}}),s=r((e,t)=>{var n=i();t.exports={write:function(e){var t,n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return void 0!==n&&(o.value=n),void 0!==r&&(o.parent=r),o}),edges:(n=e).edges().map(function(e){var t=n.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==t&&(r.value=t),r})};return void 0!==e.graph()&&(r.value=structuredClone(e.graph())),r},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),u=r((e,t)=>{t.exports=function(e,t,r,o){return function(e,t,n,r){var o={},i=!0,a=0,l=e.nodes(),s=function(e){var t=n(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},u=function(){l.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;s({v:n,w:r})})})};l.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=l.length,d=1;d<c&&(i=!1,a++,u(),i);d++);if(a===c-1&&(i=!1,u(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),r||n,o||function(t){return e.outEdges(t)})};var n=()=>1}),c=r((e,t)=>{t.exports=function(e){var t,n={},r=[];return e.nodes().forEach(function(o){t=[],function r(o){Object.hasOwn(n,o)||(n[o]=!0,t.push(o),e.successors(o).forEach(r),e.predecessors(o).forEach(r))}(o),t.length&&r.push(t)}),r}}),d=r((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(!Object.hasOwn(n,e=String(e))){var r=this._arr,o=r.length;return n[e]=o,r.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}}}),f=r((e,t)=>{var n=d();t.exports=function(e,t,o,i){return function(e,t,r,o){var i,a,l={},s=new n,u=function(e){var t=e.v!==i?e.v:e.w,n=l[t],o=r(e),u=a.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);u<n.distance&&(n.distance=u,n.predecessor=i,s.decrease(t,u))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;l[e]={distance:n},s.add(e,n)});s.size()>0&&(a=l[i=s.removeMin()]).distance!==1/0;)o(i).forEach(u);return l}(e,String(t),o||r,i||function(t){return e.outEdges(t)})};var r=()=>1}),h=r((e,t)=>{var n=f();t.exports=function(e,t,r){return e.nodes().reduce(function(o,i){return o[i]=n(e,i,t,r),o},{})}}),p=r((e,t)=>{t.exports=function(e,t,n){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[n].predecessor&&n!==t)throw Error("Invalid destination vertex");return{weight:e[n].distance,path:function(e,t,n){for(var r=[],o=n;o!==t;)r.push(o),o=e[o].predecessor;return r.push(t),r.reverse()}(e,t,n)}}}),m=r((e,t)=>{t.exports=function(e){var t=0,n=[],r={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(r,i)||function i(a){var l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(l.lowlink=Math.min(l.lowlink,r[e].index)):(i(e),l.lowlink=Math.min(l.lowlink,r[e].lowlink))}),l.lowlink===l.index){var s,u=[];do r[s=n.pop()].onStack=!1,u.push(s);while(a!==s)o.push(u)}}(i)}),o}}),g=r((e,t)=>{var n=m();t.exports=function(e){return n(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),x=r((e,t)=>{t.exports=function(e,t,r){var o,i,a,l,s;return o=e,i=t||n,a=r||function(t){return e.outEdges(t)},l={},(s=o.nodes()).forEach(function(e){l[e]={},l[e][e]={distance:0},s.forEach(function(t){e!==t&&(l[e][t]={distance:1/0})}),a(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=i(t);l[e][n]={distance:r,predecessor:e}})}),s.forEach(function(e){var t=l[e];s.forEach(function(n){var r=l[n];s.forEach(function(n){var o=r[e],i=t[n],a=r[n],l=o.distance+i.distance;l<a.distance&&(a.distance=l,a.predecessor=i.predecessor)})})}),l};var n=()=>1}),y=r((e,t)=>{function n(e){var t={},n={},o=[];if(e.sinks().forEach(function i(a){if(Object.hasOwn(n,a))throw new r;Object.hasOwn(t,a)||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],o.push(a))}),Object.keys(t).length!==e.nodeCount())throw new r;return o}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),v=r((e,t)=>{var n=y();t.exports=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),b=r((e,t)=>{t.exports=function(e,t,n,r,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,n,r,o,i,a,l){return Object.hasOwn(o,n)||(o[n]=!0,r||(l=a(l,n)),i(n).forEach(function(n){l=e(t,n,r,o,i,a,l)}),r&&(l=a(l,n))),l}(e,t,"post"===n,a,i,r,o)}),o}}),w=r((e,t)=>{var n=b();t.exports=function(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),k=r((e,t)=>{var n=w();t.exports=function(e,t){return n(e,t,"post")}}),j=r((e,t)=>{var n=w();t.exports=function(e,t){return n(e,t,"pre")}}),E=r((e,t)=>{var n=i(),r=d();t.exports=function(e,t){var o,i=new n,a={},l=new r;function s(e){var n=e.v===o?e.w:e.v,r=l.priority(n);if(void 0!==r){var i=t(e);i<r&&(a[n]=o,l.decrease(n,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){l.add(e,1/0),i.setNode(e)}),l.decrease(e.nodes()[0],0);for(var u=!1;l.size()>0;){if(Object.hasOwn(a,o=l.removeMin()))i.setEdge(o,a[o]);else{if(u)throw Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(o).forEach(s)}return i}}),C=r((e,t)=>{var n=f(),r=u();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return n(e,t,o,i);for(var a=!1,l=e.nodes(),s=0;s<l.length;s++){for(var u=i(l[s]),c=0;c<u.length;c++){var d=u[c],f=d.v===l[s]?d.v:d.w,h=f===d.v?d.w:d.v;0>o({v:f,w:h})&&(a=!0)}if(a)return r(e,t,o,i)}return n(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),S=r((e,t)=>{t.exports={bellmanFord:u(),components:c(),dijkstra:f(),dijkstraAll:h(),extractPath:p(),findCycles:g(),floydWarshall:x(),isAcyclic:v(),postorder:k(),preorder:j(),prim:E(),shortestPaths:C(),reduce:b(),tarjan:m(),topsort:y()}}),N=l();t.exports={Graph:N.Graph,json:s(),alg:S(),version:N.version}}),aE=ak((e,t)=>{function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return n(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}}}),aC=ak((e,t)=>{var n=aj().Graph,r=aE();t.exports=function(e,t){var l,s;let u,c,d,f,h;if(1>=e.nodeCount())return[];let p=(l=e,s=t||o,u=new n,c=0,d=0,l.nodes().forEach(e=>{u.setNode(e,{v:e,in:0,out:0})}),l.edges().forEach(e=>{let t=u.edge(e.v,e.w)||0,n=s(e);u.setEdge(e.v,e.w,t+n),d=Math.max(d,u.node(e.v).out+=n),c=Math.max(c,u.node(e.w).in+=n)}),f=(function(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t})(d+c+3).map(()=>new r),h=c+1,u.nodes().forEach(e=>{a(f,h,u.node(e))}),{graph:u,buckets:f,zeroIdx:h});return(function(e,t,n){let r=[],o=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)i(e,t,n,l);for(;l=o.dequeue();)i(e,t,n,l);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(l=t[o].dequeue()){r=r.concat(i(e,t,n,l,!0));break}}}return r})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,n,r,o){let i=o?[]:void 0;return e.inEdges(r.v).forEach(r=>{let l=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=l,a(t,n,s)}),e.outEdges(r.v).forEach(r=>{let o=e.edge(r),i=r.w,l=e.node(i);l.in-=o,a(t,n,l)}),e.removeNode(r.v),i}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}}),aS=ak((e,t)=>{var n=aj().Graph;function r(e,t,n,r){for(var o=r;e.hasNode(o);)o=l(r);return n.dummy=t,e.setNode(o,n),o}t.exports={addBorderNode:function(e,t,n,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=o),r(e,"border",i,t)},addDummyNode:r,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t},buildLayerMatrix:function(e){let t=s(i(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),o=r.rank;void 0!==o&&(t[o][r.order]=n)}),t},intersectRect:function(e,t){let n,r,o=e.x,i=e.y,a=t.x-o,l=t.y-i,s=e.width/2,u=e.height/2;if(!a&&!l)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(l)*s>Math.abs(a)*u?(l<0&&(u=-u),n=u*a/l,r=u):(a<0&&(s=-s),n=s,r=s*l/a),{x:o+n,y:i+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n}));e.nodes().forEach(n=>{let r=e.node(n);Object.hasOwn(r,"rank")&&(r.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n},pick:function(e,t){let n={};for(let r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return u(e.nodes(),t)},range:s,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),n=[];e.nodes().forEach(r=>{let o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});let r=0,i=e.graph().nodeRankFactor;Array.from(n).forEach((t,n)=>{void 0===t&&n%i!=0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return u(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:l,zipObject:u};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let n=function(e,t=65535){let n=[];for(let r=0;r<e.length;r+=t){let o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?5e-324:n}))}var a=0;function l(e){return e+""+ ++a}function s(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let o=[];for(let t=e;r(t);t+=n)o.push(t);return o}function u(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),aN=ak((e,t)=>{var n=aC(),r=aS().uniqueId;t.exports={run:function(e){var t,o;let i,a,l;("greedy"===e.graph().acyclicer?n(e,(t=e,e=>t.edge(e).weight)):(i=[],a={},l={},(o=e).nodes().forEach(function e(t){Object.hasOwn(l,t)||(l[t]=!0,a[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(a,t.w)?i.push(t):e(t.w)}),delete a[t])}),i)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r("rev"))})},undo:function(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}}),a_=ak((e,t)=>{var n=aS();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let r,o,i,a=t.v,l=e.node(a).rank,s=t.w,u=e.node(s).rank,c=t.name,d=e.edge(t),f=d.labelRank;if(u!==l+1){for(e.removeEdge(t),i=0,++l;l<u;++i,++l)d.points=[],o={width:0,height:0,edgeLabel:d,edgeObj:t,rank:l},r=n.addDummyNode(e,"edge",o,"_d"),l===f&&(o.width=d.width,o.height=d.height,o.dummy="edge-label",o.labelpos=d.labelpos),e.setEdge(a,r,{weight:d.weight},c),0===i&&e.graph().dummyChains.push(r),a=r;e.setEdge(a,s,{weight:d.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,o;for(e.setEdge(n.edgeObj,r);n.dummy;)o=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=o,n=e.node(t)})}}}),aM=ak((e,t)=>{var{applyWithChunking:n}=aS();t.exports={longestPath:function(e){var t={};e.sources().forEach(function r(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var a=n(Math.min,e.outEdges(o).map(t=>null==t?1/0:r(t.w)-e.edge(t).minlen));return a===1/0&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),aP=ak((e,t)=>{var n=aj().Graph,r=aM().slack;t.exports=function(e){var t,o,i,a,l=new n({directed:!1}),s=e.nodes()[0],u=e.nodeCount();for(l.setNode(s,{});t=l,o=e,t.nodes().forEach(function e(n){o.nodeEdges(n).forEach(i=>{var a=i.v,l=n===a?i.w:a;t.hasNode(l)||r(o,i)||(t.setNode(l,{}),t.setEdge(n,l,{}),e(l))})}),t.nodeCount()<u;)i=function(e,t){return t.edges().reduce((n,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=r(t,o)),i<n[0]?[i,o]:n},[1/0,null])[1]}(l,e),a=l.hasNode(i.v)?r(e,i):-r(e,i),function(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}(l,e,a);return l}}),aR=ak((e,t)=>{var n=aP(),r=aM().slack,o=aM().longestPath,i=aj().alg.preorder,a=aj().alg.postorder,l=aS().simplify;function s(e){o(e=l(e));var t,r,i=n(e);for(d(i),u(i,e);t=f(i);)r=h(i,e,t),p(i,e,t,r)}function u(e,t){var n=a(e,e.nodes());(n=n.slice(0,n.length-1)).forEach(n=>{var r,o,i,a;return r=e,o=t,i=n,a=r.node(i).parent,void(r.edge(i,a).cutvalue=c(r,o,i))})}function c(e,t,n){var r=e.node(n).parent,o=!0,i=t.edge(n,r),a=0;return i||(o=!1,i=t.edge(r,n)),a=i.weight,t.nodeEdges(n).forEach(i=>{var l=i.v===n,s=l?i.w:i.v;if(s!==r){var u,c,d,f=l===o,h=t.edge(i).weight;if(a+=f?h:-h,u=e,c=n,d=s,u.hasEdge(c,d)){var p=e.edge(n,s).cutvalue;a+=f?-p:p}}}),a}function d(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,r,o,i){var a=r,l=t.node(o);return n[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(n,i)||(r=e(t,n,r,i,o))}),l.low=a,l.lim=r++,i?l.parent=i:delete l.parent,r}(e,{},1,t)}function f(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function h(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var a=e.node(o),l=e.node(i),s=a,u=!1;return a.lim>l.lim&&(s=l,u=!0),t.edges().filter(t=>u===m(e,e.node(t.v),s)&&u!==m(e,e.node(t.w),s)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function p(e,t,n,r){var o,a,l,s,c=n.v,f=n.w;e.removeEdge(c,f),e.setEdge(r.v,r.w,{}),d(e),u(e,t),o=e,a=t,l=o.nodes().find(e=>!a.node(e).parent),(s=(s=i(o,l)).slice(1)).forEach(e=>{var t=o.node(e).parent,n=a.edge(e,t),r=!1;n||(n=a.edge(t,e),r=!0),a.node(e).rank=a.node(t).rank+(r?n.minlen:-n.minlen)})}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=s,s.initLowLimValues=d,s.initCutValues=u,s.calcCutValue=c,s.leaveEdge=f,s.enterEdge=h,s.exchangeEdges=p}),aA=ak((e,t)=>{var n=aM().longestPath,r=aP(),o=aR();t.exports=function(e){var t,a=e.graph().ranker;if(a instanceof Function)return a(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":n(t=e),r(t);break;case"longest-path":i(e);case"none":}};var i=n}),aI=ak((e,t)=>{t.exports=function(e){var t;let n,r,o=(n={},r=0,(t=e).children().forEach(function e(o){let i=r;t.children(o).forEach(e),n[o]={low:i,lim:r++}}),n);e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeObj,i=function(e,t,n,r){let o=[],i=[],a=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim),s,u;s=n;do o.push(s=e.parent(s));while(s&&(t[s].low>a||l>t[s].lim))for(u=s,s=r;(s=e.parent(s))!==u;)i.push(s);return{path:o.concat(i.reverse()),lca:u}}(e,o,r.v,r.w),a=i.path,l=i.lca,s=0,u=a[0],c=!0;for(;t!==r.w;){if(n=e.node(t),c){for(;(u=a[s])!==l&&e.node(u).maxRank<n.rank;)s++;u===l&&(c=!1)}if(!c){for(;s<a.length-1&&e.node(u=a[s+1]).minRank<=n.rank;)s++;u=a[s]}e.setParent(t,u),t=e.successors(t)[0]}})}}),aD=ak((e,t)=>{var n=aS();t.exports={run:function(e){var t,r,o;let i=n.addDummyNode(e,"root",{},"_root"),a=(r={},(t=e).children().forEach(e=>(function e(n,o){var i=t.children(n);i&&i.length&&i.forEach(t=>e(t,o+1)),r[n]=o})(e,1)),r),l=Object.values(a),s=n.applyWithChunking(Math.max,l)-1,u=2*s+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=u);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,r,o,i,a,l,s){let u=t.children(s);if(!u.length){s!==r&&t.setEdge(r,s,{weight:0,minlen:o});return}let c=n.addBorderNode(t,"_bt"),d=n.addBorderNode(t,"_bb"),f=t.node(s);t.setParent(c,s),f.borderTop=c,t.setParent(d,s),f.borderBottom=d,u.forEach(n=>{e(t,r,o,i,a,l,n);let u=t.node(n),f=u.borderTop?u.borderTop:n,h=u.borderBottom?u.borderBottom:n,p=u.borderTop?i:2*i,m=f!==h?1:a-l[s]+1;t.setEdge(c,f,{weight:p,minlen:m,nestingEdge:!0}),t.setEdge(h,d,{weight:p,minlen:m,nestingEdge:!0})}),t.parent(s)||t.setEdge(r,c,{weight:0,minlen:a+l[s]})})(e,i,u,c,s,a,t)),e.graph().nodeRankFactor=u},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),aO=ak((e,t)=>{var n=aS();function r(e,t,r,o,i,a){let l=i[t][a-1],s=n.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},r);i[t][a]=s,e.setParent(s,o),l&&e.setEdge(l,s,{weight:1})}t.exports=function(e){e.children().forEach(function t(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)r(e,"borderLeft","_bl",n,i,t),r(e,"borderRight","_br",n,i,t)}})}}),aT=ak((e,t)=>{function n(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>r(e.edge(t)))}function r(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&n(e)},undo:function(e){var t,r;let a=e.graph().rankdir.toLowerCase();("bt"===a||"rl"===a)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let n=t.edge(e);n.points.forEach(o),Object.hasOwn(n,"y")&&o(n)})),("lr"===a||"rl"===a)&&((r=e).nodes().forEach(e=>i(r.node(e))),r.edges().forEach(e=>{let t=r.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),n(e))}}}),az=ak((e,t)=>{var n=aS();t.exports=function(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),o=r.map(t=>e.node(t).rank),i=n.applyWithChunking(Math.max,o),a=n.range(i+1).map(()=>[]);return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(function n(r){t[r]||(t[r]=!0,a[e.node(r).rank].push(r),e.successors(r).forEach(n))}),a}}),aL=ak((e,t)=>{var n=aS().zipObject;t.exports=function(e,t){let r=0;for(let o=1;o<t.length;++o)r+=function(e,t,r){let o=n(r,r.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<r.length;)a<<=1;let l=2*a-1;a-=1;let s=Array(l).fill(0),u=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;u+=e.weight*n}),u}(e,t[o-1],t[o]);return r}}),aB=ak((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}}),aF=ak((e,t)=>{var n=aS();t.exports=function(e,t){let r={};return e.forEach((e,t)=>{let n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)}),t.edges().forEach(e=>{let t=r[e.v],n=r[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(r[e.w]))}),function(e){let t=[];for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),n.out.forEach(function(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,["vs","i","barycenter","weight"]))}(Object.values(r).filter(e=>!e.indegree))}}),a$=ak((e,t)=>{var n=aS();function r(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}t.exports=function(e,t){var o;let i=n.partition(e,e=>Object.hasOwn(e,"barycenter")),a=i.lhs,l=i.rhs.sort((e,t)=>t.i-e.i),s=[],u=0,c=0,d=0;a.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),d=r(s,l,d),a.forEach(e=>{d+=e.vs.length,s.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,d=r(s,l,d)});let f={vs:s.flat(!0)};return c&&(f.barycenter=u/c,f.weight=c),f}}),aH=ak((e,t)=>{var n=aB(),r=aF(),o=a$();t.exports=function e(t,i,a,l){var s,u;let c=t.children(i),d=t.node(i),f=d?d.borderLeft:void 0,h=d?d.borderRight:void 0,p={};f&&(c=c.filter(e=>e!==f&&e!==h));let m=n(t,c);m.forEach(n=>{if(t.children(n.v).length){var r,o;let i=e(t,n.v,a,l);p[n.v]=i,Object.hasOwn(i,"barycenter")&&(r=n,o=i,void 0!==r.barycenter?(r.barycenter=(r.barycenter*r.weight+o.barycenter*o.weight)/(r.weight+o.weight),r.weight+=o.weight):(r.barycenter=o.barycenter,r.weight=o.weight))}});let g=r(m,a);s=g,u=p,s.forEach(e=>{e.vs=e.vs.flatMap(e=>u[e]?u[e].vs:e)});let x=o(g,l);if(f&&(x.vs=[f,x.vs,h].flat(!0),t.predecessors(f).length)){let e=t.node(t.predecessors(f)[0]),n=t.node(t.predecessors(h)[0]);Object.hasOwn(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+e.order+n.order)/(x.weight+2),x.weight+=2}return x}}),aV=ak((e,t)=>{var n=aj().Graph,r=aS();t.exports=function(e,t,o,i){i||(i=e.nodes());let a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),l=new n({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let r=e.node(n),i=e.parent(n);(r.rank===t||r.minRank<=t&&t<=r.maxRank)&&(l.setNode(n),l.setParent(n,i||a),e[o](n).forEach(t=>{let r=t.v===n?t.w:t.v,o=l.edge(r,n),i=void 0!==o?o.weight:0;l.setEdge(r,n,{weight:e.edge(t).weight+i})}),Object.hasOwn(r,"minRank")&&l.setNode(n,{borderLeft:r.borderLeft[t],borderRight:r.borderRight[t]}))}),l}}),aq=ak((e,t)=>{t.exports=function(e,t,n){let r={},o;n.forEach(n=>{let i=e.parent(n),a,l;for(;i;){if((a=e.parent(i))?(l=r[a],r[a]=i):(l=o,o=i),l&&l!==i)return void t.setEdge(l,i);i=a}})}}),aU=ak((e,t)=>{var n=az(),r=aL(),o=aH(),i=aV(),a=aq(),l=aj().Graph,s=aS();function u(e,t,n){let r=new Map,o=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if("number"==typeof n.rank&&o(n.rank,t),"number"==typeof n.minRank&&"number"==typeof n.maxRank)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&o(e,t)}return t.map(function(t){return i(e,t,n,r.get(t)||[])})}function c(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let d=s.maxRank(t),f=u(t,s.range(1,d+1),"inEdges"),h=u(t,s.range(d-1,-1,-1),"outEdges"),p=n(t);if(c(t,p),i.disableOptimalOrderHeuristic)return;let m=1/0,g,x=i.constraints||[];for(let e=0,n=0;n<4;++e,++n){(function(e,t,n){let r=new l;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,l=o(e,i,r,t);l.vs.forEach((t,n)=>e.node(t).order=n),a(e,r,l.vs)})})(e%2?f:h,e%4>=2,x),p=s.buildLayerMatrix(t);let i=r(t,p);i<m?(n=0,g=Object.assign({},p),m=i):i===m&&(g=structuredClone(p))}c(t,g)}}),aX=ak((e,t)=>{var n=aj().Graph,r=aS();function o(e,t){let n={};return t.length&&t.reduce(function(t,r){let o=0,i=0,l=t.length,s=r[r.length-1];return r.forEach((t,u)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=c?e.node(c).order:l;(c||t===s)&&(r.slice(i,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let i=e.node(r),l=i.order;(l<o||d<l)&&!(i.dummy&&e.node(t).dummy)&&a(n,r,t)})}),i=u+1,o=d)}),r}),n}function i(e,t){let n={};function o(t,o,i,l,s){let u;r.range(o,i).forEach(r=>{u=t[r],e.node(u).dummy&&e.predecessors(u).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<l||r.order>s)&&a(n,t,u)})})}return t.length&&t.reduce(function(t,n){let r=-1,i,a=0;return n.forEach((l,s)=>{if("border"===e.node(l).dummy){let t=e.predecessors(l);t.length&&(i=e.node(t[0]).order,o(n,a,s,r,i),a=s,r=i)}o(n,a,n.length,i,t.length)}),n}),n}function a(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function l(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function s(e,t,n,r){let o={},i={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){let r=((s=s.sort((e,t)=>a[e]-a[t])).length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=s[u];i[e]===e&&t<a[r]&&!l(n,e,r)&&(i[r]=e,i[e]=o[e]=o[r],t=a[r])}}})}),{root:o,align:i}}function u(e,t,r,o,i){var a,l,s,u,c,d,f;let h,p,m,g={},x=(a=e,l=t,s=r,u=i,h=new n,m=(c=(p=a.graph()).nodesep,d=p.edgesep,f=u,(e,t,n)=>{let r=e.node(t),o=e.node(n),i,a;if(i=0+r.width/2,Object.hasOwn(r,"labelpos"))switch(r.labelpos.toLowerCase()){case"l":a=-r.width/2;break;case"r":a=r.width/2}if(a&&(i+=f?a:-a),a=0,i+=(r.dummy?d:c)/2,i+=(o.dummy?d:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":a=o.width/2;break;case"r":a=-o.width/2}return a&&(i+=f?a:-a),a=0,i}),l.forEach(e=>{let t;e.forEach(e=>{let n=s[e];if(h.setNode(n),t){var r=s[t],o=h.edge(r,n);h.setEdge(r,n,Math.max(m(a,e,t),o||0))}t=e})}),h),y=i?"borderLeft":"borderRight";function v(e,t){let n=x.nodes().slice(),r={},o=n.pop();for(;o;){if(r[o])e(o);else for(let e of(r[o]=!0,n.push(o),t(o)))n.push(e);o=n.pop()}}return v(function(e){g[e]=x.inEdges(e).reduce((e,t)=>Math.max(e,g[t.v]+x.edge(t)),0)},x.predecessors.bind(x)),v(function(t){let n=x.outEdges(t).reduce((e,t)=>Math.min(e,g[t.w]-x.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==y&&(g[t]=Math.max(g[t],n))},x.successors.bind(x)),Object.keys(o).forEach(e=>g[e]=g[r[e]]),g}function c(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,o=1/0;Object.entries(n).forEach(([t,n])=>{var i,a;let l=(i=e,a=t,i.node(a).width/2);r=Math.max(n+l,r),o=Math.min(n-l,o)});let i=r-o;return i<t[0]&&(t=[i,n]),t},[1/0,null])[1]}function d(e,t){let n=Object.values(t),o=r.applyWithChunking(Math.min,n),i=r.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(a=>{let l=n+a,s=e[l];if(s===t)return;let u=Object.values(s),c=o-r.applyWithChunking(Math.min,u);"l"!==a&&(c=i-r.applyWithChunking(Math.max,u)),c&&(e[l]=r.mapValues(s,e=>e+c))})})}function f(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=r.buildLayerMatrix(e),n=Object.assign(o(e,t),i(e,t)),a={},l;["u","d"].forEach(o=>{l="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(l=l.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),c=s(e,l,n,i),d=u(e,l,c.root,c.align,"r"===t);"r"===t&&(d=r.mapValues(d,e=>-e)),a[o+t]=d})});let h=c(e,a);return d(a,h),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:s,horizontalCompaction:u,alignCoordinates:d,findSmallestWidthAlignment:c,balance:f}}),aW=ak((e,t)=>{var n=aS(),r=aX().positionX;t.exports=function(e){var t;let o,i,a,l;t=e=n.asNonCompoundGraph(e),o=n.buildLayerMatrix(t),i=t.graph().ranksep,a=t.graph().rankalign,l=0,o.forEach(e=>{let n=e.reduce((e,n)=>{let r=t.node(n).height;return e>r?e:r},0);e.forEach(e=>{let r=t.node(e);"top"===a?r.y=l+r.height/2:"bottom"===a?r.y=l+n-r.height/2:r.y=l+n/2}),l+=n+i}),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}}),aY=ak((e,t)=>{var n=aN(),r=a_(),o=aA(),i=aS().normalizeRanks,a=aI(),l=aS().removeEmptyRanks,s=aD(),u=aO(),c=aT(),d=aU(),f=aW(),h=aS(),p=aj().Graph;t.exports=function(e,t={}){let C=t.debugTiming?h.time:h.notime;return C("layout",()=>{let S=C(" buildLayoutGraph",()=>{var t;let n,r;return t=e,n=new p({multigraph:!0,compound:!0}),r=E(t.graph()),n.setGraph(Object.assign({},g,j(r,m),h.pick(r,x))),t.nodes().forEach(e=>{let r=j(E(t.node(e)),y);Object.keys(v).forEach(e=>{void 0===r[e]&&(r[e]=v[e])}),n.setNode(e,r),n.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let r=E(t.edge(e));n.setEdge(e,Object.assign({},w,j(r,b),h.pick(r,k)))}),n});return C(" runLayout",()=>{var e,p,m;return e=S,p=C,m=t,void(p(" makeSpaceForEdgeLabels",()=>{var t;let n;return n=(t=e).graph(),void(n.ranksep/=2,t.edges().forEach(e=>{let r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),p(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),p(" acyclic",()=>n.run(e)),p(" nestingGraph.run",()=>s.run(e)),p(" rank",()=>o(h.asNonCompoundGraph(e))),p(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};h.addDummyNode(t,"edge-proxy",r,"_ep")}})}),p(" removeEmptyRanks",()=>l(e)),p(" nestingGraph.cleanup",()=>s.cleanup(e)),p(" normalizeRanks",()=>i(e)),p(" assignRankMinMax",()=>{var t;let n;return n=0,void((t=e).nodes().forEach(e=>{let r=t.node(e);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,n=Math.max(n,r.maxRank))}),t.graph().maxRank=n)}),p(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),p(" normalize.run",()=>r.run(e)),p(" parentDummyChains",()=>a(e)),p(" addBorderSegments",()=>u(e)),p(" order",()=>d(e,m)),p(" insertSelfEdges",()=>{var t;return t=e,void h.buildLayerMatrix(t).forEach(e=>{var n=0;e.forEach((e,r)=>{var o=t.node(e);o.order=r+n,(o.selfEdges||[]).forEach(e=>{h.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),p(" adjustCoordinateSystem",()=>c.adjust(e)),p(" position",()=>f(e)),p(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,l=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-l},{x:o+5*a/6,y:i-l},{x:o+a,y:i},{x:o+5*a/6,y:i+l},{x:o+2*a/3,y:i+l}],n.label.x=n.x,n.label.y=n.y}})}),p(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(n.borderLeft[n.borderLeft.length-1]),a=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),p(" normalize.undo",()=>r.undo(e)),p(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}),p(" undoCoordinateSystem",()=>c.undo(e)),p(" translateGraph",()=>(function(e){let t=1/0,n=0,r=1/0,o=0,i=e.graph(),a=i.marginx||0,l=i.marginy||0;function s(e){let i=e.x,a=e.y,l=e.width,s=e.height;t=Math.min(t,i-l/2),n=Math.max(n,i+l/2),r=Math.min(r,a-s/2),o=Math.max(o,a+s/2)}e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&s(n)}),t-=a,r-=l,e.nodes().forEach(n=>{let o=e.node(n);o.x-=t,o.y-=r}),e.edges().forEach(n=>{let o=e.edge(n);o.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=r)}),i.width=n-t+a,i.height=o-r+l})(e)),p(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=o,a=r),n.points.unshift(h.intersectRect(r,i)),n.points.push(h.intersectRect(o,a))})}),p(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}),p(" acyclic.undo",()=>n.undo(e)))}),C(" updateInputGraph",()=>{var t,n;return t=e,n=S,void(t.nodes().forEach(e=>{let r=t.node(e),o=n.node(e);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,n.children(e).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(e=>{let r=t.edge(e),o=n.edge(e);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height)}),S})};var m=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},x=["acyclicer","ranker","rankdir","align","rankalign"],y=["width","height","rank"],v={width:0,height:0},b=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function j(e,t){return h.mapValues(h.pick(e,t),Number)}function E(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n}),t}}),aK=ak((e,t)=>{var n=aS(),r=aj().Graph;t.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),aG=ak((e,t)=>{t.exports="2.0.4"});let aZ=ak((e,t)=>{t.exports={graphlib:aj(),layout:aY(),debug:aK(),util:{time:aS().time,notime:aS().notime},version:aG()}})(),aQ={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function aJ(e,t){let n=e.data;return n&&"number"==typeof n.width&&"number"==typeof n.height?{width:n.width,height:n.height}:aQ[e.type??""]??t}function a0(e,t,n={}){let{direction:r="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:a=30}=n;if(0===e.length)return{nodes:[],edges:[]};let l=new aZ.graphlib.Graph({multigraph:!0});l.setDefaultEdgeLabel(()=>({})),l.setGraph({rankdir:r,ranksep:i,nodesep:a});let s=new Set;for(let e of t)s.add(e.source),s.add(e.target);let u=e.filter(e=>s.has(e.id)),c=e.filter(e=>!s.has(e.id));for(let e of u){let t=aJ(e,o);l.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)l.hasNode(e.source)&&l.hasNode(e.target)&&l.setEdge(e.source,e.target,{},e.id);aZ.layout(l);let{targetPosition:d,sourcePosition:f}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(r),h=[];for(let e of u){let t=l.node(e.id),n=aJ(e,o);h.push({...e,targetPosition:d,sourcePosition:f,position:{x:t.x-n.width/2,y:t.y-n.height/2}})}if(c.length>0){let e=0,t=1/0;for(let n of h){let r=aJ(n,o);e=Math.max(e,n.position.y+r.height),t=Math.min(t,n.position.x)}t===1/0&&(t=0);for(let n=0;n<c.length;n++){let r=c[n],i=aJ(r,o);h.push({...r,targetPosition:d,sourcePosition:f,position:{x:t,y:e+30+n*(i.height+20)}})}}return{nodes:h,edges:[...t]}}var a1=e.i(21023);let a2=(0,a1.createServerReference)("406caff046f96b31ff916a2d7a56b00e4e0ba42969",a1.callServer,void 0,a1.findSourceMapURL,"createFeature"),a5=(0,a1.createServerReference)("403d314dfbfa9e924edf1541ef2abe8b817e113d71",a1.callServer,void 0,a1.findSourceMapURL,"deleteFeature"),a3=(0,a1.createServerReference)("40cbce1b9c3b4e574ec0572abcf20fed0c5625fa87",a1.callServer,void 0,a1.findSourceMapURL,"addRepository"),a4=(0,a1.createServerReference)("40f04206c40969efebf2da1c4c41ba53b053aace88",a1.callServer,void 0,a1.findSourceMapURL,"deleteRepository");var a6=e.i(39443),a8=e.i(8361),a9=e.i(17406);function a7(e){switch(e){case a9.NotificationEventType.AgentStarted:case a9.NotificationEventType.PhaseCompleted:return"running";case a9.NotificationEventType.WaitingApproval:return"action-required";case a9.NotificationEventType.AgentCompleted:return"done";case a9.NotificationEventType.AgentFailed:case a9.NotificationEventType.PrChecksFailed:return"error";case a9.NotificationEventType.PrMerged:case a9.NotificationEventType.PrChecksPassed:return"done";case a9.NotificationEventType.PrClosed:return"action-required"}}let le={analyze:"requirements",requirements:"requirements",research:"research",plan:"implementation",implement:"implementation",merge:"review"},lt=0;function ln(e,t){let n=(0,ab.useRouter)(),[r,o]=(0,v.useState)(e),[i,a]=(0,v.useState)(t),l=(0,v.useRef)(t),s=(0,v.useCallback)(e=>{a(t=>{let n="function"==typeof e?e(t):e;return l.current=n,n})},[]),[u,c]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[h,p]=(0,v.useState)(!1),m=(0,a8.useSoundAction)("delete"),g=(0,a8.useSoundAction)("create"),x=(0,a8.useSoundAction)("click"),[y,b]=(0,v.useState)(null),w=e.map(e=>e.id).sort().join(","),k=t.map(e=>e.id).sort().join(","),j=(0,v.useRef)(new Map),E=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,v.useEffect)(()=>{o(t=>{let n=new Map(t.map(e=>[e.id,e])),r=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!r.has(e.id));return e.map(e=>{let t=n.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[w,e]),(0,v.useEffect)(()=>{s(t)},[k,t,s]);let{events:C}=(0,a6.useAgentEventsContext)();(0,v.useEffect)(()=>{let t=j.current;for(let n of e){if("featureNode"!==n.type)continue;let e=n.data,r=t.get(n.id);void 0!==r&&r!==e.state&&(C.some(t=>t.featureId===e.featureId&&a7(t.eventType)===e.state)||("done"===e.state?aw.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?aw.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{window.dispatchEvent(new CustomEvent("shep:select-feature",{detail:{featureId:e.featureId}}))}}}):"error"===e.state&&aw.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(n.id,e.state)}},[E,e,C]);let S=(0,v.useRef)(0),N=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(N.current),[]),(0,v.useEffect)(()=>{if(C.length<=S.current)return;let e=C.slice(S.current);for(let t of(S.current=C.length,e)){let e=a7(t.eventType),n=function(e){if(e)return le[e]}(t.phaseName);o(r=>r.map(r=>{if("featureNode"!==r.type)return r;let o=r.data;return o.featureId!==t.featureId?r:{...r,data:{...o,state:e,...void 0!==n&&{lifecycle:n}}}})),c(r=>r?.featureId!==t.featureId?r:{...r,state:e,...void 0!==n&&{lifecycle:n}})}clearTimeout(N.current),N.current=setTimeout(()=>n.refresh(),3e3)},[C,n]),(0,v.useEffect)(()=>{if(!r.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>n.refresh(),5e3);return()=>clearInterval(e)},[r,n]);let _=(0,v.useCallback)(e=>{o(t=>oM(e,t))},[]),M=(0,v.useCallback)(()=>{c(null)},[]),P=(0,v.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&(x.play(),f(!1),c(e))}},[x]);(0,v.useEffect)(()=>{let e=e=>{"Escape"===e.key&&M()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[M]);let R=(0,v.useCallback)(e=>{e.source&&e.target&&o(t=>{let n=t.find(t=>t.id===e.source);return n?.type!=="repositoryNode"||s(n=>n.some(n=>{let r=t.find(e=>e.id===n.source);return r?.type==="repositoryNode"&&n.target===e.target})?n:[...n,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[s]),A=(0,v.useCallback)((e,t,n)=>{let r=`feature-${Date.now()}-${lt++}`,i={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${r.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return o(t=>{let n,o=e?new Set(l.current.filter(t=>t.source===e).map(e=>e.target)):new Set,a=t.filter(e=>o.has(e.id));if(a.length>0){let e=a.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],r=e.length>1?e[1]-e[0]:160;n={x:a[0].position.x,y:t+r}}else if(e){let r=t.find(t=>t.id===e);n=r?{x:r.position.x+488,y:r.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;n={x:400,y:t.length>0?e+160:200}}let s=n.y+140,u=new Set([e,...o]),c=t.filter(e=>u.has(e.id)).reduce((e,t)=>{let n="featureNode"===t.type?140:50;return Math.max(e,t.position.y+n)},0),d=Math.max(0,s-c),f=d>0?t.map(e=>u.has(e.id)||o.has(e.id)?e:e.position.y>=c?{...e,position:{...e.position,y:e.position.y+d}}:e):t;return[...e?f.map(t=>{if(t.id!==e)return t;let r=[...a.map(e=>e.position.y),n.y],o=(Math.min(...r)+Math.max(...r)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):f,{id:r,type:"featureNode",position:n,data:i}]}),e&&s(t=>[...t,{id:"dependencyEdge"===n?`dep-${e}-${r}`:`edge-${e}-${r}`,source:e,target:r,...n?{type:n}:{style:{strokeDasharray:"5 5"}}}]),"creating"!==i.state&&c(i),r},[s]),I=(0,v.useCallback)(()=>{x.play(),c(null),f(!0)},[x]),[D,O]=(0,v.useState)(),T=(0,v.useCallback)(e=>{let t=A(D?`feat-${D}`:y,{state:"creating",name:e.name,description:e.description,repositoryPath:e.repositoryPath},D?"dependencyEdge":void 0);f(!1),b(null),O(void 0),a2(e).then(e=>{if(e.error){o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.target!==t)),aw.toast.error(e.error);return}g.play(),n.refresh()}).catch(()=>{o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.target!==t)),aw.toast.error("Failed to create feature")})},[n,A,y,g,D,s]),z=(0,v.useCallback)(()=>{f(!1),O(void 0)},[]),L=(0,v.useCallback)(async e=>{p(!0);try{let t=await a5(e);if(t.error)return void aw.toast.error(t.error);c(null),o(t=>{let n=t.filter(t=>t.id!==e),r=i.filter(t=>t.source!==e&&t.target!==e),o=a0(n,r,{direction:"LR",ranksep:200,nodesep:60});return s(o.edges),o.nodes}),m.play(),aw.toast.success("Feature deleted successfully"),n.refresh()}catch{aw.toast.error("Failed to delete feature")}finally{p(!1)}},[n,i,m,s]),B=(0,v.useCallback)(async e=>{let t=`repo-${e}`;o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await a4(e);if(!t.success){aw.toast.error(t.error??"Failed to remove repository"),n.refresh();return}m.play(),aw.toast.success("Repository removed"),n.refresh()}catch{aw.toast.error("Failed to remove repository"),n.refresh()}},[n,m,s]),F=(0,v.useCallback)(e=>{x.play(),c(null),b(e),f(!0)},[x]),$=(0,v.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,n=i.find(t=>t.target===e),r=n?.source??null;x.play(),c(null),b(r),O(t),f(!0)},[i,x]),H=(0,v.useCallback)(e=>{o(t=>{let n=a0(t,i,{direction:e,ranksep:60,nodesep:20});return s(n.edges),n.nodes})},[i,s]),V=(0,v.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,i=0;o(n=>{let o=n.filter(e=>"repositoryNode"===e.type),a=n.find(e=>"addRepositoryNode"===e.type);a&&(i=a.position.y);let l={x:o[0]?.position.x??a?.position.x??50,y:a?a.position.y:0},s=a?a.position.y+50+15:l.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:s}}:e).concat({id:t,type:"repositoryNode",position:l,data:{name:r,repositoryPath:e,id:t}})}),a3({path:e,name:r}).then(e=>{if(e.error){o(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:i}}:e)),aw.toast.error(e.error);return}let r=e.repository,a=`repo-${r.id}`;o(e=>e.map(e=>e.id===t?{...e,id:a,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),s(e=>e.map(e=>({...e,source:e.source===t?a:e.source,target:e.target===t?a:e.target,id:e.id.replace(t,a)}))),g.play(),n.refresh()}).catch(()=>{o(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:i}}:e)),aw.toast.error("Failed to add repository")})},[n,g,s]),q=(0,v.useRef)(r);q.current=r;let U=(0,v.useCallback)(e=>{let t=q.current.find(t=>"featureNode"===t.type&&t.data.featureId===e);if(t){let e=t.data;"creating"!==e.state&&(f(!1),c(e))}},[]),X=y?r.find(e=>e.id===y):null;return{nodes:r,edges:i,selectedNode:u,isCreateDrawerOpen:d,pendingRepositoryPath:X?.data?.repositoryPath??"",pendingParentFeatureId:D,onNodesChange:_,handleConnect:R,clearSelection:M,handleNodeClick:P,handleAddFeature:I,handleAddFeatureToRepo:F,handleAddFeatureToFeature:$,handleAddRepository:V,handleLayout:H,handleCreateFeatureSubmit:T,closeCreateDrawer:z,handleDeleteFeature:L,handleDeleteRepository:B,isDeleting:h,createFeatureNode:A,selectFeatureById:U}}e.s(["useControlCenterState",()=>ln],17840)},48246,e=>{"use strict";var t=e.i(20314),n=e.i(53271),r=e.i(79054),o=e.i(3214),i=e.i(35364);e.i(54793);var a=e.i(7729),l=e.i(92002),s=e.i(3645);let u=(0,s.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),c=(0,s.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var d=e.i(81975);let f=(0,s.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]),h=(0,s.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);var p=e.i(31777),m=e.i(22528),g=e.i(5978),x=e.i(567),y=e.i(91967),v=e.i(86874),b="AlertDialog",[w,k]=(0,m.createContextScope)(b,[x.createDialogScope]),j=(0,x.createDialogScope)(),E=e=>{let{__scopeAlertDialog:n,...r}=e,o=j(n);return(0,t.jsx)(x.Root,{...o,...r,modal:!0})};E.displayName=b;var C=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Trigger,{...i,...o,ref:n})});C.displayName="AlertDialogTrigger";var S=e=>{let{__scopeAlertDialog:n,...r}=e,o=j(n);return(0,t.jsx)(x.Portal,{...o,...r})};S.displayName="AlertDialogPortal";var N=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Overlay,{...i,...o,ref:n})});N.displayName="AlertDialogOverlay";var _="AlertDialogContent",[M,P]=w(_),R=(0,v.createSlottable)("AlertDialogContent"),A=r.forwardRef((e,n)=>{let{__scopeAlertDialog:o,children:i,...a}=e,l=j(o),s=r.useRef(null),u=(0,g.useComposedRefs)(n,s),c=r.useRef(null);return(0,t.jsx)(x.WarningProvider,{contentName:_,titleName:I,docsSlug:"alert-dialog",children:(0,t.jsx)(M,{scope:o,cancelRef:c,children:(0,t.jsxs)(x.Content,{role:"alertdialog",...l,...a,ref:u,onOpenAutoFocus:(0,y.composeEventHandlers)(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(R,{children:i}),(0,t.jsx)(F,{contentRef:s})]})})})});A.displayName=_;var I="AlertDialogTitle",D=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Title,{...i,...o,ref:n})});D.displayName=I;var O="AlertDialogDescription",T=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Description,{...i,...o,ref:n})});T.displayName=O;var z=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Close,{...i,...o,ref:n})});z.displayName="AlertDialogAction";var L="AlertDialogCancel",B=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,{cancelRef:i}=P(L,r),a=j(r),l=(0,g.useComposedRefs)(n,i);return(0,t.jsx)(x.Close,{...a,...o,ref:l})});B.displayName=L;var F=({contentRef:e})=>{let t=`\`${_}\` requires a description for the component to be accessible for screen reader users.
4
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ay.displayName="MiniMap",(0,v.memo)(ay);let av={[g.Line]:"right",[g.Handle]:"bottom-right"};(0,v.memo)(function({nodeId:e,position:t,variant:n=g.Handle,className:r,style:o,children:i,color:a,minWidth:l=10,minHeight:s=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:p,onResizeStart:m,onResize:x,onResizeEnd:w}){let k,j=o5(),E="string"==typeof e?e:j,C=ot(),S=(0,v.useRef)(null),N=n===g.Handle,_=oe((0,v.useCallback)((k=N&&h,e=>k?`${Math.max(1/e.transform[2],1)}`:void 0),[N,h]),r6),M=(0,v.useRef)(null),P=t??av[n];(0,v.useEffect)(()=>{if(S.current&&E)return M.current||(M.current=rZ({domNode:S.current,nodeId:E,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:i}=C.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:i}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:i}=C.getState(),a=[],l={x:e.x,y:e.y},s=r.get(E);if(s&&s.expandParent&&s.parentId){let t=s.origin??i,n=e.width??s.measured.width??0,u=e.height??s.measured.height??0,c=rb([{id:s.id,parentId:s.parentId,rect:{width:n,height:u,...nB({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:u},s.parentId,r,t)}}],r,o,i);a.push(...c),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*u,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:E,type:"position",position:{...l}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:E,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(let e of t){let t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{C.getState().triggerNodeChanges([{id:E,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),M.current.update({controlPosition:P,boundaries:{minWidth:l,minHeight:s,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:x,onResizeEnd:w,shouldResize:p}),()=>{M.current?.destroy()}},[P,l,s,u,c,d,m,x,w,p]);let R=P.split("-");return(0,y.jsx)("div",{className:b(["react-flow__resize-control","nodrag",...R,n,r]),ref:S,style:{...o,scale:_,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}),e.s(["Background",()=>at,"BaseEdge",()=>ix,"Controls",()=>ac,"Handle",()=>o4,"ReactFlow",()=>i4,"ReactFlowProvider",()=>i2,"applyNodeChanges",()=>oP],53271);var ab=e.i(31406),aw=e.i(60112),ak=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),aj=ak((e,t)=>{var n=Object.defineProperty,r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,r)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?n(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r},i=r((e,t)=>{function n(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function i(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}return o+"\x01"+i+"\x01"+(void 0===r?"\0":r)}function a(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var n=t;void 0!==n;n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=n.parent(o);return void 0===i||t.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,o){return r.length>1?n.setEdge(e,o,t):n.setEdge(e,o),o}),this}setEdge(){var e,t,r,o,a=!1,l=arguments[0];"object"==typeof l&&null!==l&&"v"in l?(e=l.v,t=l.w,r=l.name,2==arguments.length&&(o=arguments[1],a=!0)):(e=l,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,void 0!==r&&(r=""+r);var s=i(this._isDirected,e,t,r);if(Object.hasOwn(this._edgeLabels,s))return a&&(this._edgeLabels[s]=o),this;if(void 0!==r&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=a?o:this._defaultEdgeLabelFn(e,t,r);var u=function(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var l={v:o,w:i};return r&&(l.name=r),l}(this._isDirected,e,t,r);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this}edge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var o=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),l=this._edgeObjs[o];return l&&(e=l.v,t=l.w,delete this._edgeLabels[o],delete this._edgeObjs[o],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}}}),a=r((e,t)=>{t.exports="3.0.2"}),l=r((e,t)=>{t.exports={Graph:i(),version:a()}}),s=r((e,t)=>{var n=i();t.exports={write:function(e){var t,n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return void 0!==n&&(o.value=n),void 0!==r&&(o.parent=r),o}),edges:(n=e).edges().map(function(e){var t=n.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==t&&(r.value=t),r})};return void 0!==e.graph()&&(r.value=structuredClone(e.graph())),r},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),u=r((e,t)=>{t.exports=function(e,t,r,o){return function(e,t,n,r){var o={},i=!0,a=0,l=e.nodes(),s=function(e){var t=n(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},u=function(){l.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;s({v:n,w:r})})})};l.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=l.length,d=1;d<c&&(i=!1,a++,u(),i);d++);if(a===c-1&&(i=!1,u(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),r||n,o||function(t){return e.outEdges(t)})};var n=()=>1}),c=r((e,t)=>{t.exports=function(e){var t,n={},r=[];return e.nodes().forEach(function(o){t=[],function r(o){Object.hasOwn(n,o)||(n[o]=!0,t.push(o),e.successors(o).forEach(r),e.predecessors(o).forEach(r))}(o),t.length&&r.push(t)}),r}}),d=r((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(!Object.hasOwn(n,e=String(e))){var r=this._arr,o=r.length;return n[e]=o,r.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}}}),f=r((e,t)=>{var n=d();t.exports=function(e,t,o,i){return function(e,t,r,o){var i,a,l={},s=new n,u=function(e){var t=e.v!==i?e.v:e.w,n=l[t],o=r(e),u=a.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);u<n.distance&&(n.distance=u,n.predecessor=i,s.decrease(t,u))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;l[e]={distance:n},s.add(e,n)});s.size()>0&&(a=l[i=s.removeMin()]).distance!==1/0;)o(i).forEach(u);return l}(e,String(t),o||r,i||function(t){return e.outEdges(t)})};var r=()=>1}),h=r((e,t)=>{var n=f();t.exports=function(e,t,r){return e.nodes().reduce(function(o,i){return o[i]=n(e,i,t,r),o},{})}}),p=r((e,t)=>{t.exports=function(e,t,n){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[n].predecessor&&n!==t)throw Error("Invalid destination vertex");return{weight:e[n].distance,path:function(e,t,n){for(var r=[],o=n;o!==t;)r.push(o),o=e[o].predecessor;return r.push(t),r.reverse()}(e,t,n)}}}),m=r((e,t)=>{t.exports=function(e){var t=0,n=[],r={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(r,i)||function i(a){var l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(l.lowlink=Math.min(l.lowlink,r[e].index)):(i(e),l.lowlink=Math.min(l.lowlink,r[e].lowlink))}),l.lowlink===l.index){var s,u=[];do r[s=n.pop()].onStack=!1,u.push(s);while(a!==s)o.push(u)}}(i)}),o}}),g=r((e,t)=>{var n=m();t.exports=function(e){return n(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),x=r((e,t)=>{t.exports=function(e,t,r){var o,i,a,l,s;return o=e,i=t||n,a=r||function(t){return e.outEdges(t)},l={},(s=o.nodes()).forEach(function(e){l[e]={},l[e][e]={distance:0},s.forEach(function(t){e!==t&&(l[e][t]={distance:1/0})}),a(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=i(t);l[e][n]={distance:r,predecessor:e}})}),s.forEach(function(e){var t=l[e];s.forEach(function(n){var r=l[n];s.forEach(function(n){var o=r[e],i=t[n],a=r[n],l=o.distance+i.distance;l<a.distance&&(a.distance=l,a.predecessor=i.predecessor)})})}),l};var n=()=>1}),y=r((e,t)=>{function n(e){var t={},n={},o=[];if(e.sinks().forEach(function i(a){if(Object.hasOwn(n,a))throw new r;Object.hasOwn(t,a)||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],o.push(a))}),Object.keys(t).length!==e.nodeCount())throw new r;return o}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),v=r((e,t)=>{var n=y();t.exports=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),b=r((e,t)=>{t.exports=function(e,t,n,r,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,n,r,o,i,a,l){return Object.hasOwn(o,n)||(o[n]=!0,r||(l=a(l,n)),i(n).forEach(function(n){l=e(t,n,r,o,i,a,l)}),r&&(l=a(l,n))),l}(e,t,"post"===n,a,i,r,o)}),o}}),w=r((e,t)=>{var n=b();t.exports=function(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),k=r((e,t)=>{var n=w();t.exports=function(e,t){return n(e,t,"post")}}),j=r((e,t)=>{var n=w();t.exports=function(e,t){return n(e,t,"pre")}}),E=r((e,t)=>{var n=i(),r=d();t.exports=function(e,t){var o,i=new n,a={},l=new r;function s(e){var n=e.v===o?e.w:e.v,r=l.priority(n);if(void 0!==r){var i=t(e);i<r&&(a[n]=o,l.decrease(n,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){l.add(e,1/0),i.setNode(e)}),l.decrease(e.nodes()[0],0);for(var u=!1;l.size()>0;){if(Object.hasOwn(a,o=l.removeMin()))i.setEdge(o,a[o]);else{if(u)throw Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(o).forEach(s)}return i}}),C=r((e,t)=>{var n=f(),r=u();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return n(e,t,o,i);for(var a=!1,l=e.nodes(),s=0;s<l.length;s++){for(var u=i(l[s]),c=0;c<u.length;c++){var d=u[c],f=d.v===l[s]?d.v:d.w,h=f===d.v?d.w:d.v;0>o({v:f,w:h})&&(a=!0)}if(a)return r(e,t,o,i)}return n(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),S=r((e,t)=>{t.exports={bellmanFord:u(),components:c(),dijkstra:f(),dijkstraAll:h(),extractPath:p(),findCycles:g(),floydWarshall:x(),isAcyclic:v(),postorder:k(),preorder:j(),prim:E(),shortestPaths:C(),reduce:b(),tarjan:m(),topsort:y()}}),N=l();t.exports={Graph:N.Graph,json:s(),alg:S(),version:N.version}}),aE=ak((e,t)=>{function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return n(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}}}),aC=ak((e,t)=>{var n=aj().Graph,r=aE();t.exports=function(e,t){var l,s;let u,c,d,f,h;if(1>=e.nodeCount())return[];let p=(l=e,s=t||o,u=new n,c=0,d=0,l.nodes().forEach(e=>{u.setNode(e,{v:e,in:0,out:0})}),l.edges().forEach(e=>{let t=u.edge(e.v,e.w)||0,n=s(e);u.setEdge(e.v,e.w,t+n),d=Math.max(d,u.node(e.v).out+=n),c=Math.max(c,u.node(e.w).in+=n)}),f=(function(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t})(d+c+3).map(()=>new r),h=c+1,u.nodes().forEach(e=>{a(f,h,u.node(e))}),{graph:u,buckets:f,zeroIdx:h});return(function(e,t,n){let r=[],o=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)i(e,t,n,l);for(;l=o.dequeue();)i(e,t,n,l);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(l=t[o].dequeue()){r=r.concat(i(e,t,n,l,!0));break}}}return r})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,n,r,o){let i=o?[]:void 0;return e.inEdges(r.v).forEach(r=>{let l=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=l,a(t,n,s)}),e.outEdges(r.v).forEach(r=>{let o=e.edge(r),i=r.w,l=e.node(i);l.in-=o,a(t,n,l)}),e.removeNode(r.v),i}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}}),aS=ak((e,t)=>{var n=aj().Graph;function r(e,t,n,r){for(var o=r;e.hasNode(o);)o=l(r);return n.dummy=t,e.setNode(o,n),o}t.exports={addBorderNode:function(e,t,n,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=o),r(e,"border",i,t)},addDummyNode:r,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t},buildLayerMatrix:function(e){let t=s(i(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),o=r.rank;void 0!==o&&(t[o][r.order]=n)}),t},intersectRect:function(e,t){let n,r,o=e.x,i=e.y,a=t.x-o,l=t.y-i,s=e.width/2,u=e.height/2;if(!a&&!l)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(l)*s>Math.abs(a)*u?(l<0&&(u=-u),n=u*a/l,r=u):(a<0&&(s=-s),n=s,r=s*l/a),{x:o+n,y:i+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n}));e.nodes().forEach(n=>{let r=e.node(n);Object.hasOwn(r,"rank")&&(r.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n},pick:function(e,t){let n={};for(let r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return u(e.nodes(),t)},range:s,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),n=[];e.nodes().forEach(r=>{let o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});let r=0,i=e.graph().nodeRankFactor;Array.from(n).forEach((t,n)=>{void 0===t&&n%i!=0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return u(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:l,zipObject:u};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let n=function(e,t=65535){let n=[];for(let r=0;r<e.length;r+=t){let o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?5e-324:n}))}var a=0;function l(e){return e+""+ ++a}function s(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let o=[];for(let t=e;r(t);t+=n)o.push(t);return o}function u(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),aN=ak((e,t)=>{var n=aC(),r=aS().uniqueId;t.exports={run:function(e){var t,o;let i,a,l;("greedy"===e.graph().acyclicer?n(e,(t=e,e=>t.edge(e).weight)):(i=[],a={},l={},(o=e).nodes().forEach(function e(t){Object.hasOwn(l,t)||(l[t]=!0,a[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(a,t.w)?i.push(t):e(t.w)}),delete a[t])}),i)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r("rev"))})},undo:function(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}}),a_=ak((e,t)=>{var n=aS();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let r,o,i,a=t.v,l=e.node(a).rank,s=t.w,u=e.node(s).rank,c=t.name,d=e.edge(t),f=d.labelRank;if(u!==l+1){for(e.removeEdge(t),i=0,++l;l<u;++i,++l)d.points=[],o={width:0,height:0,edgeLabel:d,edgeObj:t,rank:l},r=n.addDummyNode(e,"edge",o,"_d"),l===f&&(o.width=d.width,o.height=d.height,o.dummy="edge-label",o.labelpos=d.labelpos),e.setEdge(a,r,{weight:d.weight},c),0===i&&e.graph().dummyChains.push(r),a=r;e.setEdge(a,s,{weight:d.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,o;for(e.setEdge(n.edgeObj,r);n.dummy;)o=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=o,n=e.node(t)})}}}),aM=ak((e,t)=>{var{applyWithChunking:n}=aS();t.exports={longestPath:function(e){var t={};e.sources().forEach(function r(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var a=n(Math.min,e.outEdges(o).map(t=>null==t?1/0:r(t.w)-e.edge(t).minlen));return a===1/0&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),aP=ak((e,t)=>{var n=aj().Graph,r=aM().slack;t.exports=function(e){var t,o,i,a,l=new n({directed:!1}),s=e.nodes()[0],u=e.nodeCount();for(l.setNode(s,{});t=l,o=e,t.nodes().forEach(function e(n){o.nodeEdges(n).forEach(i=>{var a=i.v,l=n===a?i.w:a;t.hasNode(l)||r(o,i)||(t.setNode(l,{}),t.setEdge(n,l,{}),e(l))})}),t.nodeCount()<u;)i=function(e,t){return t.edges().reduce((n,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=r(t,o)),i<n[0]?[i,o]:n},[1/0,null])[1]}(l,e),a=l.hasNode(i.v)?r(e,i):-r(e,i),function(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}(l,e,a);return l}}),aR=ak((e,t)=>{var n=aP(),r=aM().slack,o=aM().longestPath,i=aj().alg.preorder,a=aj().alg.postorder,l=aS().simplify;function s(e){o(e=l(e));var t,r,i=n(e);for(d(i),u(i,e);t=f(i);)r=h(i,e,t),p(i,e,t,r)}function u(e,t){var n=a(e,e.nodes());(n=n.slice(0,n.length-1)).forEach(n=>{var r,o,i,a;return r=e,o=t,i=n,a=r.node(i).parent,void(r.edge(i,a).cutvalue=c(r,o,i))})}function c(e,t,n){var r=e.node(n).parent,o=!0,i=t.edge(n,r),a=0;return i||(o=!1,i=t.edge(r,n)),a=i.weight,t.nodeEdges(n).forEach(i=>{var l=i.v===n,s=l?i.w:i.v;if(s!==r){var u,c,d,f=l===o,h=t.edge(i).weight;if(a+=f?h:-h,u=e,c=n,d=s,u.hasEdge(c,d)){var p=e.edge(n,s).cutvalue;a+=f?-p:p}}}),a}function d(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,r,o,i){var a=r,l=t.node(o);return n[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(n,i)||(r=e(t,n,r,i,o))}),l.low=a,l.lim=r++,i?l.parent=i:delete l.parent,r}(e,{},1,t)}function f(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function h(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var a=e.node(o),l=e.node(i),s=a,u=!1;return a.lim>l.lim&&(s=l,u=!0),t.edges().filter(t=>u===m(e,e.node(t.v),s)&&u!==m(e,e.node(t.w),s)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function p(e,t,n,r){var o,a,l,s,c=n.v,f=n.w;e.removeEdge(c,f),e.setEdge(r.v,r.w,{}),d(e),u(e,t),o=e,a=t,l=o.nodes().find(e=>!a.node(e).parent),(s=(s=i(o,l)).slice(1)).forEach(e=>{var t=o.node(e).parent,n=a.edge(e,t),r=!1;n||(n=a.edge(t,e),r=!0),a.node(e).rank=a.node(t).rank+(r?n.minlen:-n.minlen)})}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=s,s.initLowLimValues=d,s.initCutValues=u,s.calcCutValue=c,s.leaveEdge=f,s.enterEdge=h,s.exchangeEdges=p}),aA=ak((e,t)=>{var n=aM().longestPath,r=aP(),o=aR();t.exports=function(e){var t,a=e.graph().ranker;if(a instanceof Function)return a(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":n(t=e),r(t);break;case"longest-path":i(e);case"none":}};var i=n}),aI=ak((e,t)=>{t.exports=function(e){var t;let n,r,o=(n={},r=0,(t=e).children().forEach(function e(o){let i=r;t.children(o).forEach(e),n[o]={low:i,lim:r++}}),n);e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeObj,i=function(e,t,n,r){let o=[],i=[],a=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim),s,u;s=n;do o.push(s=e.parent(s));while(s&&(t[s].low>a||l>t[s].lim))for(u=s,s=r;(s=e.parent(s))!==u;)i.push(s);return{path:o.concat(i.reverse()),lca:u}}(e,o,r.v,r.w),a=i.path,l=i.lca,s=0,u=a[0],c=!0;for(;t!==r.w;){if(n=e.node(t),c){for(;(u=a[s])!==l&&e.node(u).maxRank<n.rank;)s++;u===l&&(c=!1)}if(!c){for(;s<a.length-1&&e.node(u=a[s+1]).minRank<=n.rank;)s++;u=a[s]}e.setParent(t,u),t=e.successors(t)[0]}})}}),aD=ak((e,t)=>{var n=aS();t.exports={run:function(e){var t,r,o;let i=n.addDummyNode(e,"root",{},"_root"),a=(r={},(t=e).children().forEach(e=>(function e(n,o){var i=t.children(n);i&&i.length&&i.forEach(t=>e(t,o+1)),r[n]=o})(e,1)),r),l=Object.values(a),s=n.applyWithChunking(Math.max,l)-1,u=2*s+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=u);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,r,o,i,a,l,s){let u=t.children(s);if(!u.length){s!==r&&t.setEdge(r,s,{weight:0,minlen:o});return}let c=n.addBorderNode(t,"_bt"),d=n.addBorderNode(t,"_bb"),f=t.node(s);t.setParent(c,s),f.borderTop=c,t.setParent(d,s),f.borderBottom=d,u.forEach(n=>{e(t,r,o,i,a,l,n);let u=t.node(n),f=u.borderTop?u.borderTop:n,h=u.borderBottom?u.borderBottom:n,p=u.borderTop?i:2*i,m=f!==h?1:a-l[s]+1;t.setEdge(c,f,{weight:p,minlen:m,nestingEdge:!0}),t.setEdge(h,d,{weight:p,minlen:m,nestingEdge:!0})}),t.parent(s)||t.setEdge(r,c,{weight:0,minlen:a+l[s]})})(e,i,u,c,s,a,t)),e.graph().nodeRankFactor=u},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),aO=ak((e,t)=>{var n=aS();function r(e,t,r,o,i,a){let l=i[t][a-1],s=n.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},r);i[t][a]=s,e.setParent(s,o),l&&e.setEdge(l,s,{weight:1})}t.exports=function(e){e.children().forEach(function t(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)r(e,"borderLeft","_bl",n,i,t),r(e,"borderRight","_br",n,i,t)}})}}),aT=ak((e,t)=>{function n(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>r(e.edge(t)))}function r(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&n(e)},undo:function(e){var t,r;let a=e.graph().rankdir.toLowerCase();("bt"===a||"rl"===a)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let n=t.edge(e);n.points.forEach(o),Object.hasOwn(n,"y")&&o(n)})),("lr"===a||"rl"===a)&&((r=e).nodes().forEach(e=>i(r.node(e))),r.edges().forEach(e=>{let t=r.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),n(e))}}}),az=ak((e,t)=>{var n=aS();t.exports=function(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),o=r.map(t=>e.node(t).rank),i=n.applyWithChunking(Math.max,o),a=n.range(i+1).map(()=>[]);return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(function n(r){t[r]||(t[r]=!0,a[e.node(r).rank].push(r),e.successors(r).forEach(n))}),a}}),aL=ak((e,t)=>{var n=aS().zipObject;t.exports=function(e,t){let r=0;for(let o=1;o<t.length;++o)r+=function(e,t,r){let o=n(r,r.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<r.length;)a<<=1;let l=2*a-1;a-=1;let s=Array(l).fill(0),u=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;u+=e.weight*n}),u}(e,t[o-1],t[o]);return r}}),aB=ak((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}}),aF=ak((e,t)=>{var n=aS();t.exports=function(e,t){let r={};return e.forEach((e,t)=>{let n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)}),t.edges().forEach(e=>{let t=r[e.v],n=r[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(r[e.w]))}),function(e){let t=[];for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),n.out.forEach(function(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,["vs","i","barycenter","weight"]))}(Object.values(r).filter(e=>!e.indegree))}}),a$=ak((e,t)=>{var n=aS();function r(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}t.exports=function(e,t){var o;let i=n.partition(e,e=>Object.hasOwn(e,"barycenter")),a=i.lhs,l=i.rhs.sort((e,t)=>t.i-e.i),s=[],u=0,c=0,d=0;a.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),d=r(s,l,d),a.forEach(e=>{d+=e.vs.length,s.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,d=r(s,l,d)});let f={vs:s.flat(!0)};return c&&(f.barycenter=u/c,f.weight=c),f}}),aH=ak((e,t)=>{var n=aB(),r=aF(),o=a$();t.exports=function e(t,i,a,l){var s,u;let c=t.children(i),d=t.node(i),f=d?d.borderLeft:void 0,h=d?d.borderRight:void 0,p={};f&&(c=c.filter(e=>e!==f&&e!==h));let m=n(t,c);m.forEach(n=>{if(t.children(n.v).length){var r,o;let i=e(t,n.v,a,l);p[n.v]=i,Object.hasOwn(i,"barycenter")&&(r=n,o=i,void 0!==r.barycenter?(r.barycenter=(r.barycenter*r.weight+o.barycenter*o.weight)/(r.weight+o.weight),r.weight+=o.weight):(r.barycenter=o.barycenter,r.weight=o.weight))}});let g=r(m,a);s=g,u=p,s.forEach(e=>{e.vs=e.vs.flatMap(e=>u[e]?u[e].vs:e)});let x=o(g,l);if(f&&(x.vs=[f,x.vs,h].flat(!0),t.predecessors(f).length)){let e=t.node(t.predecessors(f)[0]),n=t.node(t.predecessors(h)[0]);Object.hasOwn(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+e.order+n.order)/(x.weight+2),x.weight+=2}return x}}),aV=ak((e,t)=>{var n=aj().Graph,r=aS();t.exports=function(e,t,o,i){i||(i=e.nodes());let a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),l=new n({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let r=e.node(n),i=e.parent(n);(r.rank===t||r.minRank<=t&&t<=r.maxRank)&&(l.setNode(n),l.setParent(n,i||a),e[o](n).forEach(t=>{let r=t.v===n?t.w:t.v,o=l.edge(r,n),i=void 0!==o?o.weight:0;l.setEdge(r,n,{weight:e.edge(t).weight+i})}),Object.hasOwn(r,"minRank")&&l.setNode(n,{borderLeft:r.borderLeft[t],borderRight:r.borderRight[t]}))}),l}}),aq=ak((e,t)=>{t.exports=function(e,t,n){let r={},o;n.forEach(n=>{let i=e.parent(n),a,l;for(;i;){if((a=e.parent(i))?(l=r[a],r[a]=i):(l=o,o=i),l&&l!==i)return void t.setEdge(l,i);i=a}})}}),aU=ak((e,t)=>{var n=az(),r=aL(),o=aH(),i=aV(),a=aq(),l=aj().Graph,s=aS();function u(e,t,n){let r=new Map,o=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if("number"==typeof n.rank&&o(n.rank,t),"number"==typeof n.minRank&&"number"==typeof n.maxRank)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&o(e,t)}return t.map(function(t){return i(e,t,n,r.get(t)||[])})}function c(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let d=s.maxRank(t),f=u(t,s.range(1,d+1),"inEdges"),h=u(t,s.range(d-1,-1,-1),"outEdges"),p=n(t);if(c(t,p),i.disableOptimalOrderHeuristic)return;let m=1/0,g,x=i.constraints||[];for(let e=0,n=0;n<4;++e,++n){(function(e,t,n){let r=new l;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,l=o(e,i,r,t);l.vs.forEach((t,n)=>e.node(t).order=n),a(e,r,l.vs)})})(e%2?f:h,e%4>=2,x),p=s.buildLayerMatrix(t);let i=r(t,p);i<m?(n=0,g=Object.assign({},p),m=i):i===m&&(g=structuredClone(p))}c(t,g)}}),aX=ak((e,t)=>{var n=aj().Graph,r=aS();function o(e,t){let n={};return t.length&&t.reduce(function(t,r){let o=0,i=0,l=t.length,s=r[r.length-1];return r.forEach((t,u)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=c?e.node(c).order:l;(c||t===s)&&(r.slice(i,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let i=e.node(r),l=i.order;(l<o||d<l)&&!(i.dummy&&e.node(t).dummy)&&a(n,r,t)})}),i=u+1,o=d)}),r}),n}function i(e,t){let n={};function o(t,o,i,l,s){let u;r.range(o,i).forEach(r=>{u=t[r],e.node(u).dummy&&e.predecessors(u).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<l||r.order>s)&&a(n,t,u)})})}return t.length&&t.reduce(function(t,n){let r=-1,i,a=0;return n.forEach((l,s)=>{if("border"===e.node(l).dummy){let t=e.predecessors(l);t.length&&(i=e.node(t[0]).order,o(n,a,s,r,i),a=s,r=i)}o(n,a,n.length,i,t.length)}),n}),n}function a(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function l(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function s(e,t,n,r){let o={},i={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){let r=((s=s.sort((e,t)=>a[e]-a[t])).length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=s[u];i[e]===e&&t<a[r]&&!l(n,e,r)&&(i[r]=e,i[e]=o[e]=o[r],t=a[r])}}})}),{root:o,align:i}}function u(e,t,r,o,i){var a,l,s,u,c,d,f;let h,p,m,g={},x=(a=e,l=t,s=r,u=i,h=new n,m=(c=(p=a.graph()).nodesep,d=p.edgesep,f=u,(e,t,n)=>{let r=e.node(t),o=e.node(n),i,a;if(i=0+r.width/2,Object.hasOwn(r,"labelpos"))switch(r.labelpos.toLowerCase()){case"l":a=-r.width/2;break;case"r":a=r.width/2}if(a&&(i+=f?a:-a),a=0,i+=(r.dummy?d:c)/2,i+=(o.dummy?d:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":a=o.width/2;break;case"r":a=-o.width/2}return a&&(i+=f?a:-a),a=0,i}),l.forEach(e=>{let t;e.forEach(e=>{let n=s[e];if(h.setNode(n),t){var r=s[t],o=h.edge(r,n);h.setEdge(r,n,Math.max(m(a,e,t),o||0))}t=e})}),h),y=i?"borderLeft":"borderRight";function v(e,t){let n=x.nodes().slice(),r={},o=n.pop();for(;o;){if(r[o])e(o);else for(let e of(r[o]=!0,n.push(o),t(o)))n.push(e);o=n.pop()}}return v(function(e){g[e]=x.inEdges(e).reduce((e,t)=>Math.max(e,g[t.v]+x.edge(t)),0)},x.predecessors.bind(x)),v(function(t){let n=x.outEdges(t).reduce((e,t)=>Math.min(e,g[t.w]-x.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==y&&(g[t]=Math.max(g[t],n))},x.successors.bind(x)),Object.keys(o).forEach(e=>g[e]=g[r[e]]),g}function c(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,o=1/0;Object.entries(n).forEach(([t,n])=>{var i,a;let l=(i=e,a=t,i.node(a).width/2);r=Math.max(n+l,r),o=Math.min(n-l,o)});let i=r-o;return i<t[0]&&(t=[i,n]),t},[1/0,null])[1]}function d(e,t){let n=Object.values(t),o=r.applyWithChunking(Math.min,n),i=r.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(a=>{let l=n+a,s=e[l];if(s===t)return;let u=Object.values(s),c=o-r.applyWithChunking(Math.min,u);"l"!==a&&(c=i-r.applyWithChunking(Math.max,u)),c&&(e[l]=r.mapValues(s,e=>e+c))})})}function f(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=r.buildLayerMatrix(e),n=Object.assign(o(e,t),i(e,t)),a={},l;["u","d"].forEach(o=>{l="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(l=l.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),c=s(e,l,n,i),d=u(e,l,c.root,c.align,"r"===t);"r"===t&&(d=r.mapValues(d,e=>-e)),a[o+t]=d})});let h=c(e,a);return d(a,h),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:s,horizontalCompaction:u,alignCoordinates:d,findSmallestWidthAlignment:c,balance:f}}),aW=ak((e,t)=>{var n=aS(),r=aX().positionX;t.exports=function(e){var t;let o,i,a,l;t=e=n.asNonCompoundGraph(e),o=n.buildLayerMatrix(t),i=t.graph().ranksep,a=t.graph().rankalign,l=0,o.forEach(e=>{let n=e.reduce((e,n)=>{let r=t.node(n).height;return e>r?e:r},0);e.forEach(e=>{let r=t.node(e);"top"===a?r.y=l+r.height/2:"bottom"===a?r.y=l+n-r.height/2:r.y=l+n/2}),l+=n+i}),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}}),aY=ak((e,t)=>{var n=aN(),r=a_(),o=aA(),i=aS().normalizeRanks,a=aI(),l=aS().removeEmptyRanks,s=aD(),u=aO(),c=aT(),d=aU(),f=aW(),h=aS(),p=aj().Graph;t.exports=function(e,t={}){let C=t.debugTiming?h.time:h.notime;return C("layout",()=>{let S=C(" buildLayoutGraph",()=>{var t;let n,r;return t=e,n=new p({multigraph:!0,compound:!0}),r=E(t.graph()),n.setGraph(Object.assign({},g,j(r,m),h.pick(r,x))),t.nodes().forEach(e=>{let r=j(E(t.node(e)),y);Object.keys(v).forEach(e=>{void 0===r[e]&&(r[e]=v[e])}),n.setNode(e,r),n.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let r=E(t.edge(e));n.setEdge(e,Object.assign({},w,j(r,b),h.pick(r,k)))}),n});return C(" runLayout",()=>{var e,p,m;return e=S,p=C,m=t,void(p(" makeSpaceForEdgeLabels",()=>{var t;let n;return n=(t=e).graph(),void(n.ranksep/=2,t.edges().forEach(e=>{let r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),p(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),p(" acyclic",()=>n.run(e)),p(" nestingGraph.run",()=>s.run(e)),p(" rank",()=>o(h.asNonCompoundGraph(e))),p(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};h.addDummyNode(t,"edge-proxy",r,"_ep")}})}),p(" removeEmptyRanks",()=>l(e)),p(" nestingGraph.cleanup",()=>s.cleanup(e)),p(" normalizeRanks",()=>i(e)),p(" assignRankMinMax",()=>{var t;let n;return n=0,void((t=e).nodes().forEach(e=>{let r=t.node(e);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,n=Math.max(n,r.maxRank))}),t.graph().maxRank=n)}),p(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),p(" normalize.run",()=>r.run(e)),p(" parentDummyChains",()=>a(e)),p(" addBorderSegments",()=>u(e)),p(" order",()=>d(e,m)),p(" insertSelfEdges",()=>{var t;return t=e,void h.buildLayerMatrix(t).forEach(e=>{var n=0;e.forEach((e,r)=>{var o=t.node(e);o.order=r+n,(o.selfEdges||[]).forEach(e=>{h.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),p(" adjustCoordinateSystem",()=>c.adjust(e)),p(" position",()=>f(e)),p(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,l=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-l},{x:o+5*a/6,y:i-l},{x:o+a,y:i},{x:o+5*a/6,y:i+l},{x:o+2*a/3,y:i+l}],n.label.x=n.x,n.label.y=n.y}})}),p(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(n.borderLeft[n.borderLeft.length-1]),a=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),p(" normalize.undo",()=>r.undo(e)),p(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}),p(" undoCoordinateSystem",()=>c.undo(e)),p(" translateGraph",()=>(function(e){let t=1/0,n=0,r=1/0,o=0,i=e.graph(),a=i.marginx||0,l=i.marginy||0;function s(e){let i=e.x,a=e.y,l=e.width,s=e.height;t=Math.min(t,i-l/2),n=Math.max(n,i+l/2),r=Math.min(r,a-s/2),o=Math.max(o,a+s/2)}e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&s(n)}),t-=a,r-=l,e.nodes().forEach(n=>{let o=e.node(n);o.x-=t,o.y-=r}),e.edges().forEach(n=>{let o=e.edge(n);o.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=r)}),i.width=n-t+a,i.height=o-r+l})(e)),p(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=o,a=r),n.points.unshift(h.intersectRect(r,i)),n.points.push(h.intersectRect(o,a))})}),p(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}),p(" acyclic.undo",()=>n.undo(e)))}),C(" updateInputGraph",()=>{var t,n;return t=e,n=S,void(t.nodes().forEach(e=>{let r=t.node(e),o=n.node(e);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,n.children(e).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(e=>{let r=t.edge(e),o=n.edge(e);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height)}),S})};var m=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},x=["acyclicer","ranker","rankdir","align","rankalign"],y=["width","height","rank"],v={width:0,height:0},b=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function j(e,t){return h.mapValues(h.pick(e,t),Number)}function E(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n}),t}}),aK=ak((e,t)=>{var n=aS(),r=aj().Graph;t.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),aG=ak((e,t)=>{t.exports="2.0.4"});let aZ=ak((e,t)=>{t.exports={graphlib:aj(),layout:aY(),debug:aK(),util:{time:aS().time,notime:aS().notime},version:aG()}})(),aQ={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function aJ(e,t){let n=e.data;return n&&"number"==typeof n.width&&"number"==typeof n.height?{width:n.width,height:n.height}:aQ[e.type??""]??t}function a0(e,t,n={}){let{direction:r="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:a=30}=n;if(0===e.length)return{nodes:[],edges:[]};let l=new aZ.graphlib.Graph({multigraph:!0});l.setDefaultEdgeLabel(()=>({})),l.setGraph({rankdir:r,ranksep:i,nodesep:a});let s=new Set;for(let e of t)s.add(e.source),s.add(e.target);let u=e.filter(e=>s.has(e.id)),c=e.filter(e=>!s.has(e.id));for(let e of u){let t=aJ(e,o);l.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)l.hasNode(e.source)&&l.hasNode(e.target)&&l.setEdge(e.source,e.target,{},e.id);aZ.layout(l);let{targetPosition:d,sourcePosition:f}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(r),h=[];for(let e of u){let t=l.node(e.id),n=aJ(e,o);h.push({...e,targetPosition:d,sourcePosition:f,position:{x:t.x-n.width/2,y:t.y-n.height/2}})}if(c.length>0){let e=0,t=1/0;for(let n of h){let r=aJ(n,o);e=Math.max(e,n.position.y+r.height),t=Math.min(t,n.position.x)}t===1/0&&(t=0);for(let n=0;n<c.length;n++){let r=c[n],i=aJ(r,o);h.push({...r,targetPosition:d,sourcePosition:f,position:{x:t,y:e+30+n*(i.height+20)}})}}return{nodes:h,edges:[...t]}}var a1=e.i(21023);let a2=(0,a1.createServerReference)("4009cfef5e3392805f561a9304e43b8d388b29177f",a1.callServer,void 0,a1.findSourceMapURL,"createFeature"),a5=(0,a1.createServerReference)("404bf2faddeceacfdd335d16ada005d6b30c51b992",a1.callServer,void 0,a1.findSourceMapURL,"deleteFeature"),a3=(0,a1.createServerReference)("40855dec31849b5c0c28e5f6082eac11aceb58a7b7",a1.callServer,void 0,a1.findSourceMapURL,"addRepository"),a4=(0,a1.createServerReference)("406a13d633eb2132d39b8f66f9031ae1860d8b780e",a1.callServer,void 0,a1.findSourceMapURL,"deleteRepository");var a6=e.i(39443),a8=e.i(8361),a9=e.i(17406);function a7(e){switch(e){case a9.NotificationEventType.AgentStarted:case a9.NotificationEventType.PhaseCompleted:return"running";case a9.NotificationEventType.WaitingApproval:return"action-required";case a9.NotificationEventType.AgentCompleted:return"done";case a9.NotificationEventType.AgentFailed:case a9.NotificationEventType.PrChecksFailed:return"error";case a9.NotificationEventType.PrMerged:case a9.NotificationEventType.PrChecksPassed:return"done";case a9.NotificationEventType.PrClosed:return"action-required"}}let le={analyze:"requirements",requirements:"requirements",research:"research",plan:"implementation",implement:"implementation",merge:"review"},lt=0;function ln(e,t){let n=(0,ab.useRouter)(),[r,o]=(0,v.useState)(e),[i,a]=(0,v.useState)(t),l=(0,v.useRef)(t),s=(0,v.useCallback)(e=>{a(t=>{let n="function"==typeof e?e(t):e;return l.current=n,n})},[]),[u,c]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[h,p]=(0,v.useState)(!1),m=(0,a8.useSoundAction)("delete"),g=(0,a8.useSoundAction)("create"),x=(0,a8.useSoundAction)("click"),[y,b]=(0,v.useState)(null),w=e.map(e=>e.id).sort().join(","),k=t.map(e=>e.id).sort().join(","),j=(0,v.useRef)(new Map),E=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,v.useEffect)(()=>{o(t=>{let n=new Map(t.map(e=>[e.id,e])),r=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!r.has(e.id));return e.map(e=>{let t=n.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[w,e]),(0,v.useEffect)(()=>{s(t)},[k,t,s]);let{events:C}=(0,a6.useAgentEventsContext)();(0,v.useEffect)(()=>{let t=j.current;for(let n of e){if("featureNode"!==n.type)continue;let e=n.data,r=t.get(n.id);void 0!==r&&r!==e.state&&(C.some(t=>t.featureId===e.featureId&&a7(t.eventType)===e.state)||("done"===e.state?aw.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?aw.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{window.dispatchEvent(new CustomEvent("shep:select-feature",{detail:{featureId:e.featureId}}))}}}):"error"===e.state&&aw.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(n.id,e.state)}},[E,e,C]);let S=(0,v.useRef)(0),N=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(N.current),[]),(0,v.useEffect)(()=>{if(C.length<=S.current)return;let e=C.slice(S.current);for(let t of(S.current=C.length,e)){let e=a7(t.eventType),n=function(e){if(e)return le[e]}(t.phaseName);o(r=>r.map(r=>{if("featureNode"!==r.type)return r;let o=r.data;return o.featureId!==t.featureId?r:{...r,data:{...o,state:e,...void 0!==n&&{lifecycle:n}}}})),c(r=>r?.featureId!==t.featureId?r:{...r,state:e,...void 0!==n&&{lifecycle:n}})}clearTimeout(N.current),N.current=setTimeout(()=>n.refresh(),3e3)},[C,n]),(0,v.useEffect)(()=>{if(!r.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>n.refresh(),5e3);return()=>clearInterval(e)},[r,n]);let _=(0,v.useCallback)(e=>{o(t=>oM(e,t))},[]),M=(0,v.useCallback)(()=>{c(null)},[]),P=(0,v.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&(x.play(),f(!1),c(e))}},[x]);(0,v.useEffect)(()=>{let e=e=>{"Escape"===e.key&&M()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[M]);let R=(0,v.useCallback)(e=>{e.source&&e.target&&o(t=>{let n=t.find(t=>t.id===e.source);return n?.type!=="repositoryNode"||s(n=>n.some(n=>{let r=t.find(e=>e.id===n.source);return r?.type==="repositoryNode"&&n.target===e.target})?n:[...n,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[s]),A=(0,v.useCallback)((e,t,n)=>{let r=`feature-${Date.now()}-${lt++}`,i={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${r.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return o(t=>{let n,o=e?new Set(l.current.filter(t=>t.source===e).map(e=>e.target)):new Set,a=t.filter(e=>o.has(e.id));if(a.length>0){let e=a.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],r=e.length>1?e[1]-e[0]:160;n={x:a[0].position.x,y:t+r}}else if(e){let r=t.find(t=>t.id===e);n=r?{x:r.position.x+488,y:r.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;n={x:400,y:t.length>0?e+160:200}}let s=n.y+140,u=new Set([e,...o]),c=t.filter(e=>u.has(e.id)).reduce((e,t)=>{let n="featureNode"===t.type?140:50;return Math.max(e,t.position.y+n)},0),d=Math.max(0,s-c),f=d>0?t.map(e=>u.has(e.id)||o.has(e.id)?e:e.position.y>=c?{...e,position:{...e.position,y:e.position.y+d}}:e):t;return[...e?f.map(t=>{if(t.id!==e)return t;let r=[...a.map(e=>e.position.y),n.y],o=(Math.min(...r)+Math.max(...r)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):f,{id:r,type:"featureNode",position:n,data:i}]}),e&&s(t=>[...t,{id:"dependencyEdge"===n?`dep-${e}-${r}`:`edge-${e}-${r}`,source:e,target:r,...n?{type:n}:{style:{strokeDasharray:"5 5"}}}]),"creating"!==i.state&&c(i),r},[s]),I=(0,v.useCallback)(()=>{x.play(),c(null),f(!0)},[x]),[D,O]=(0,v.useState)(),T=(0,v.useCallback)(e=>{let t=A(D?`feat-${D}`:y,{state:"creating",name:e.name,description:e.description,repositoryPath:e.repositoryPath},D?"dependencyEdge":void 0);f(!1),b(null),O(void 0),a2(e).then(e=>{if(e.error){o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.target!==t)),aw.toast.error(e.error);return}g.play(),n.refresh()}).catch(()=>{o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.target!==t)),aw.toast.error("Failed to create feature")})},[n,A,y,g,D,s]),z=(0,v.useCallback)(()=>{f(!1),O(void 0)},[]),L=(0,v.useCallback)(async e=>{p(!0);try{let t=await a5(e);if(t.error)return void aw.toast.error(t.error);c(null),o(t=>{let n=t.filter(t=>t.id!==e),r=i.filter(t=>t.source!==e&&t.target!==e),o=a0(n,r,{direction:"LR",ranksep:200,nodesep:60});return s(o.edges),o.nodes}),m.play(),aw.toast.success("Feature deleted successfully"),n.refresh()}catch{aw.toast.error("Failed to delete feature")}finally{p(!1)}},[n,i,m,s]),B=(0,v.useCallback)(async e=>{let t=`repo-${e}`;o(e=>e.filter(e=>e.id!==t)),s(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await a4(e);if(!t.success){aw.toast.error(t.error??"Failed to remove repository"),n.refresh();return}m.play(),aw.toast.success("Repository removed"),n.refresh()}catch{aw.toast.error("Failed to remove repository"),n.refresh()}},[n,m,s]),F=(0,v.useCallback)(e=>{x.play(),c(null),b(e),f(!0)},[x]),$=(0,v.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,n=i.find(t=>t.target===e),r=n?.source??null;x.play(),c(null),b(r),O(t),f(!0)},[i,x]),H=(0,v.useCallback)(e=>{o(t=>{let n=a0(t,i,{direction:e,ranksep:60,nodesep:20});return s(n.edges),n.nodes})},[i,s]),V=(0,v.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,i=0;o(n=>{let o=n.filter(e=>"repositoryNode"===e.type),a=n.find(e=>"addRepositoryNode"===e.type);a&&(i=a.position.y);let l={x:o[0]?.position.x??a?.position.x??50,y:a?a.position.y:0},s=a?a.position.y+50+15:l.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:s}}:e).concat({id:t,type:"repositoryNode",position:l,data:{name:r,repositoryPath:e,id:t}})}),a3({path:e,name:r}).then(e=>{if(e.error){o(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:i}}:e)),aw.toast.error(e.error);return}let r=e.repository,a=`repo-${r.id}`;o(e=>e.map(e=>e.id===t?{...e,id:a,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),s(e=>e.map(e=>({...e,source:e.source===t?a:e.source,target:e.target===t?a:e.target,id:e.id.replace(t,a)}))),g.play(),n.refresh()}).catch(()=>{o(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:i}}:e)),aw.toast.error("Failed to add repository")})},[n,g,s]),q=(0,v.useRef)(r);q.current=r;let U=(0,v.useCallback)(e=>{let t=q.current.find(t=>"featureNode"===t.type&&t.data.featureId===e);if(t){let e=t.data;"creating"!==e.state&&(f(!1),c(e))}},[]),X=y?r.find(e=>e.id===y):null;return{nodes:r,edges:i,selectedNode:u,isCreateDrawerOpen:d,pendingRepositoryPath:X?.data?.repositoryPath??"",pendingParentFeatureId:D,onNodesChange:_,handleConnect:R,clearSelection:M,handleNodeClick:P,handleAddFeature:I,handleAddFeatureToRepo:F,handleAddFeatureToFeature:$,handleAddRepository:V,handleLayout:H,handleCreateFeatureSubmit:T,closeCreateDrawer:z,handleDeleteFeature:L,handleDeleteRepository:B,isDeleting:h,createFeatureNode:A,selectFeatureById:U}}e.s(["useControlCenterState",()=>ln],17840)},48246,e=>{"use strict";var t=e.i(20314),n=e.i(53271),r=e.i(79054),o=e.i(3214),i=e.i(35364);e.i(54793);var a=e.i(7729),l=e.i(92002),s=e.i(3645);let u=(0,s.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),c=(0,s.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var d=e.i(81975);let f=(0,s.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]),h=(0,s.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);var p=e.i(31777),m=e.i(22528),g=e.i(5978),x=e.i(567),y=e.i(91967),v=e.i(86874),b="AlertDialog",[w,k]=(0,m.createContextScope)(b,[x.createDialogScope]),j=(0,x.createDialogScope)(),E=e=>{let{__scopeAlertDialog:n,...r}=e,o=j(n);return(0,t.jsx)(x.Root,{...o,...r,modal:!0})};E.displayName=b;var C=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Trigger,{...i,...o,ref:n})});C.displayName="AlertDialogTrigger";var S=e=>{let{__scopeAlertDialog:n,...r}=e,o=j(n);return(0,t.jsx)(x.Portal,{...o,...r})};S.displayName="AlertDialogPortal";var N=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Overlay,{...i,...o,ref:n})});N.displayName="AlertDialogOverlay";var _="AlertDialogContent",[M,P]=w(_),R=(0,v.createSlottable)("AlertDialogContent"),A=r.forwardRef((e,n)=>{let{__scopeAlertDialog:o,children:i,...a}=e,l=j(o),s=r.useRef(null),u=(0,g.useComposedRefs)(n,s),c=r.useRef(null);return(0,t.jsx)(x.WarningProvider,{contentName:_,titleName:I,docsSlug:"alert-dialog",children:(0,t.jsx)(M,{scope:o,cancelRef:c,children:(0,t.jsxs)(x.Content,{role:"alertdialog",...l,...a,ref:u,onOpenAutoFocus:(0,y.composeEventHandlers)(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(R,{children:i}),(0,t.jsx)(F,{contentRef:s})]})})})});A.displayName=_;var I="AlertDialogTitle",D=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Title,{...i,...o,ref:n})});D.displayName=I;var O="AlertDialogDescription",T=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Description,{...i,...o,ref:n})});T.displayName=O;var z=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,i=j(r);return(0,t.jsx)(x.Close,{...i,...o,ref:n})});z.displayName="AlertDialogAction";var L="AlertDialogCancel",B=r.forwardRef((e,n)=>{let{__scopeAlertDialog:r,...o}=e,{cancelRef:i}=P(L,r),a=j(r),l=(0,g.useComposedRefs)(n,i);return(0,t.jsx)(x.Close,{...a,...o,ref:l})});B.displayName=L;var F=({contentRef:e})=>{let t=`\`${_}\` requires a description for the component to be accessible for screen reader users.
5
5
 
6
6
  You can add a description to the \`${_}\` by passing a \`${O}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
7
7
 
8
8
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${_}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
9
9
 
10
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>z,"AlertDialog",()=>E,"AlertDialogAction",()=>z,"AlertDialogCancel",()=>B,"AlertDialogContent",()=>A,"AlertDialogDescription",()=>T,"AlertDialogOverlay",()=>N,"AlertDialogPortal",()=>S,"AlertDialogTitle",()=>D,"AlertDialogTrigger",()=>C,"Cancel",()=>B,"Content",()=>A,"Description",()=>T,"Overlay",()=>N,"Portal",()=>S,"Root",()=>E,"Title",()=>D,"Trigger",()=>C,"createAlertDialogScope",()=>k],28883);var $=e.i(28883),$=$;function H({...e}){return(0,t.jsx)($.Root,{"data-slot":"alert-dialog",...e})}function V({...e}){return(0,t.jsx)($.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function q({...e}){return(0,t.jsx)($.Portal,{"data-slot":"alert-dialog-portal",...e})}function U({className:e,...n}){return(0,t.jsx)($.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,p.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function X({className:e,size:n="default",...r}){return(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{}),(0,t.jsx)($.Content,{"data-slot":"alert-dialog-content","data-size":n,className:(0,p.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...r})]})}function W({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,p.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...n})}function Y({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,p.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...n})}function K({className:e,...n}){return(0,t.jsx)($.Title,{"data-slot":"alert-dialog-title",className:(0,p.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...n})}function G({className:e,...n}){return(0,t.jsx)($.Description,{"data-slot":"alert-dialog-description",className:(0,p.cn)("text-muted-foreground text-sm",e),...n})}function Z({className:e,variant:n="default",size:r="default",...o}){return(0,t.jsx)(i.Button,{variant:n,size:r,asChild:!0,children:(0,t.jsx)($.Action,{"data-slot":"alert-dialog-action",className:(0,p.cn)(e),...o})})}function Q({className:e,variant:n="outline",size:r="default",...o}){return(0,t.jsx)(i.Button,{variant:n,size:r,asChild:!0,children:(0,t.jsx)($.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,p.cn)(e),...o})})}var J=e.i(2828),ee=e.i(83428),et=e.i(51251),en=e.i(10942);let er=(0,s.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eo=e.i(54277);let ei={requirements:"REQUIREMENTS",research:"RESEARCH",implementation:"IMPLEMENTATION",review:"REVIEW",deploy:"DEPLOY & QA",maintain:"COMPLETED"},ea={requirements:"Analyzing",research:"Researching",implementation:"Implementing",review:"Reviewing",deploy:"Deploying",maintain:"Maintaining"},el={creating:{icon:ee.Loader2,borderClass:"border-l-blue-500",labelClass:"text-blue-500",progressClass:"bg-blue-500",badgeClass:"text-blue-700",badgeBgClass:"bg-blue-50",label:"Creating...",showProgressBar:!1},running:{icon:ee.Loader2,borderClass:"border-l-blue-500",labelClass:"text-blue-500",progressClass:"bg-blue-500",badgeClass:"text-blue-700",badgeBgClass:"bg-blue-50",label:"Running",showProgressBar:!1},"action-required":{icon:et.CircleAlert,borderClass:"border-l-amber-500",labelClass:"text-amber-500",progressClass:"bg-amber-500",badgeClass:"text-amber-700",badgeBgClass:"bg-amber-50",label:"User action required",showProgressBar:!1},done:{icon:en.CircleCheck,borderClass:"border-l-emerald-500",labelClass:"text-emerald-500",progressClass:"bg-emerald-500",badgeClass:"text-emerald-700",badgeBgClass:"bg-emerald-50",label:"Done",showProgressBar:!1},blocked:{icon:er,borderClass:"border-l-gray-400",labelClass:"text-gray-400",progressClass:"bg-gray-400",badgeClass:"text-gray-600",badgeBgClass:"bg-gray-100",label:"Blocked",showProgressBar:!1},error:{icon:eo.CircleX,borderClass:"border-l-red-500",labelClass:"text-red-500",progressClass:"bg-red-500",badgeClass:"text-red-700",badgeBgClass:"bg-red-50",label:"Error",showProgressBar:!1}};var es=e.i(98804);let eu=(0,s.default)("beaker",[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]]);function ec(e,n){function r({className:r}){return(0,t.jsx)(es.default,{src:e,alt:n,width:24,height:24,className:(0,p.cn)("rounded-sm object-contain",r)})}return r.displayName=`BrandIcon(${n})`,r}function ed(e){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor"})]})}function ef({className:e,...n}){return(0,t.jsx)(eu,{className:(0,p.cn)("h-6 w-6",e),...n})}ef.displayName="DevAgentIcon";let eh={"claude-code":ec("/icons/agents/claude-ai-icon.svg","Claude Code"),cursor:ec("/icons/agents/cursor.jpeg","Cursor"),"gemini-cli":ec("/icons/agents/gemini-cli.jpeg","Gemini CLI"),aider:ec("/icons/agents/aider.png","Aider"),continue:ec("/icons/agents/continue.jpeg","Continue"),dev:ef};function ep({agentType:e,className:n}){let r=e&&e in eh?eh[e]:ed;return(0,t.jsx)(r,{className:n})}function em(e){let t=el[e.state];switch(e.state){case"creating":return"Creating...";case"running":return ea[e.lifecycle];case"done":return e.runtime?`Completed in ${e.runtime}`:"Completed";case"blocked":return e.blockedBy?`Waiting on ${e.blockedBy}`:"Blocked";case"action-required":if("requirements"===e.lifecycle)return"Review Product Requirements";if("implementation"===e.lifecycle)return"Review Technical Planning";if("review"===e.lifecycle)return"Review Merge Request";return t.label;case"error":return e.errorMessage??"Something went wrong";default:return t.label}}function eg({data:e,selected:i}){let a,s,m=el[e.state],g=m.icon,[x,y]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(n.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Delete feature","data-testid":"feature-node-delete-button",onClick:e=>{e.stopPropagation(),y(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(h,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Delete feature"})]})})}),(0,t.jsx)(H,{open:x,onOpenChange:y,children:(0,t.jsxs)(X,{size:"sm",children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Delete feature?"}),(0,t.jsxs)(G,{children:["This will permanently delete ",(0,t.jsx)("strong",{children:e.name})," and all associated data including specs, branches, and progress."]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",onClick:()=>e.onDelete?.(e.featureId),children:"Delete"})]})]})})]}):null,(0,t.jsxs)("div",{"data-testid":"feature-node-card","aria-busy":"creating"===e.state?"true":void 0,className:(0,p.cn)("bg-card flex min-h-35 w-72 flex-col rounded-lg border p-3 shadow-sm",i&&"ring-primary ring-2"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{"data-testid":"feature-node-lifecycle-label",className:(0,p.cn)("text-[10px] font-semibold tracking-wider"),children:"blocked"===e.state?"BLOCKED":ei[e.lifecycle]}),e.onSettings?(0,t.jsx)("button",{type:"button","aria-label":"Settings","data-testid":"feature-node-settings-button",onClick:t=>{t.stopPropagation(),e.onSettings?.()},className:"nodrag text-muted-foreground hover:text-foreground -mt-1 -mr-1 p-1",children:(0,t.jsx)(u,{className:"h-3.5 w-3.5"})}):null]}),(0,t.jsx)("h3",{className:"mt-1 truncate text-sm font-bold",children:e.name}),e.description?(0,t.jsx)("p",{"data-testid":"feature-node-description",className:"text-muted-foreground mt-0.5 truncate text-xs",children:e.description}):null,(0,t.jsx)("div",{className:"mt-auto pt-2",children:"creating"===e.state?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 text-xs",children:[(0,t.jsx)(g,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:em(e)})]}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full"})})]}):"running"===e.state?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 text-xs",children:[(0,t.jsx)(ep,{agentType:e.agentType,className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:em(e)})]}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full"})})]}):m.showProgressBar?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-muted-foreground flex items-center justify-end text-[10px]",children:(0,t.jsxs)("span",{children:[e.progress,"%"]})}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all",m.progressClass),style:{width:`${e.progress}%`}})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:(0,t.jsx)("span",{children:e.featureId})}),(0,t.jsxs)("div",{"data-testid":"feature-node-badge",className:(a="action-required"!==e.state?null:"implementation"===e.lifecycle?{badgeClass:"text-indigo-700",badgeBgClass:"bg-indigo-50"}:"review"===e.lifecycle?{badgeClass:"text-emerald-700",badgeBgClass:"bg-emerald-50"}:null,(0,p.cn)("mt-1.5 flex items-center justify-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium",a?.badgeBgClass??m.badgeBgClass,a?.badgeClass??m.badgeClass)),children:[(s=function(e){let t=el[e.state];if("action-required"===e.state){if("requirements"===e.lifecycle)return c;if("implementation"===e.lifecycle)return d.Wrench;if("review"===e.lifecycle)return f}return t.icon}(e),(0,t.jsx)(s,{className:"h-3.5 w-3.5 shrink-0"})),(0,t.jsx)("span",{className:"truncate",children:em(e)})]})]})})]}),e.onAction?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,className:"h-0! w-0! border-0! bg-transparent!",children:(0,t.jsx)("button",{type:"button","aria-label":"Add","data-testid":"feature-node-action-button",onClick:t=>{t.stopPropagation(),e.onAction?.()},className:"nodrag absolute top-1/2 left-1/2 flex h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-blue-500 text-white opacity-0 shadow-md transition-opacity group-hover:opacity-100 hover:bg-blue-600",children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})}):e.showHandles?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,isConnectable:!1,className:"opacity-0!"}):null]})}let ex=(0,s.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),ey=(0,s.default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var ev=e.i(38573),eb=e.i(19933),ew=e.i(24042),ek=e.i(64970);e.i(81803);var ej=e.i(72714);e.i(99348);var eE=e.i(17466),eC=e.i(8537),eS=e.i(63629),eN=e.i(21023);let e_=(0,eN.createServerReference)("40c8357881b7209754173b264c064e68dc1fccc6c5",eN.callServer,void 0,eN.findSourceMapURL,"openIde"),eM=(0,eN.createServerReference)("40df943127843d139f09ef0c15e7af7962c1163a3c",eN.callServer,void 0,eN.findSourceMapURL,"openShell"),eP=(0,eN.createServerReference)("403aacc3b063b935fc97c13a4ddc2e39d5248cfce7",eN.callServer,void 0,eN.findSourceMapURL,"openFolder");function eR(e){let[t,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=p.current,t=m.current,n=g.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),n&&clearTimeout(n)}},[]);let x=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]),y=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t(e.repositoryPath);if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,r.useCallback)(()=>x(e_,n,u,p,t),[x,t]),openInShell:(0,r.useCallback)(()=>x(eM,i,d,m,o),[x,o]),openFolder:(0,r.useCallback)(()=>y(eP,l,h,g,a),[y,a]),ideLoading:t,shellLoading:o,folderLoading:a,ideError:s,shellError:c,folderError:f}}function eA({data:e}){let[i,a]=(0,r.useState)(!1),s=eR(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),u=(0,eC.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===u.status||"Ready"===u.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(n.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),a(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(h,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(H,{open:i,onOpenChange:a,children:(0,t.jsxs)(X,{size:"sm",children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Remove repository?"}),(0,t.jsxs)(G,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(ex,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,p.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open in IDE",onClick:s.openInIde,loading:s.ideLoading,error:!!s.ideError,icon:ey,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open in Shell",onClick:s.openInShell,loading:s.shellLoading,error:!!s.shellError,icon:ev.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open Folder",onClick:s.openFolder,loading:s.folderLoading,error:!!s.folderError,icon:eb.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open Folder"})]})}),eS.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?u.stop:u.deploy,loading:u.deployLoading||u.stopLoading,error:!!u.deployError,icon:c?ek.Square:ew.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(eE.DeploymentStatusBadge,{status:u.status,url:u.url}):null]}):null]}):null,e.onAdd?(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650);var eI=e.i(45811),eD=e.i(25235);e.i(1354);var eO=e.i(1963);function eT(e){let[r]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(n.BaseEdge,{id:e.id,path:r,style:{strokeDasharray:"5 5"}})}function ez({nodes:e,edges:l,onNodesChange:s,onAddFeature:u,onNodeAction:c,onNodeSettings:d,onConnect:f,onNodeClick:h,onPaneClick:p,onRepositoryAdd:m,onRepositoryClick:g,onRepositoryDelete:x,onFeatureDelete:y,onRepositorySelect:v,onCanvasDrag:b,toolbar:w,emptyState:k}){let j=(0,r.useMemo)(()=>({featureNode:eg,repositoryNode:eA,addRepositoryNode:eO.AddRepositoryNode}),[]),E=(0,r.useMemo)(()=>({dependencyEdge:eT}),[]),C=(0,r.useCallback)(t=>{let n=e.find(e=>e.id===t.source);return n?.type!=="repositoryNode"||!l.some(n=>{let r=e.find(e=>e.id===n.source);return r?.type==="repositoryNode"&&n.target===t.target})},[e,l]),S=(0,r.useMemo)(()=>e.map(e=>({...e,data:{...e.data,showHandles:l.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:c?()=>c(e.id):void 0,onSettings:d?()=>d(e.id):void 0,onDelete:y}:{},..."repositoryNode"===e.type&&{onAdd:m?()=>m(e.id):void 0,onClick:g?()=>g(e.id):void 0,onDelete:x},..."addRepositoryNode"===e.type&&{onSelect:v?e=>v(e):void 0}}})),[e,l.length,c,d,y,m,g,x,v]);return 0===e.length?k?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:k}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(i.Button,{onClick:u,children:[(0,t.jsx)(o.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(n.ReactFlowProvider,{children:(0,t.jsxs)(n.ReactFlow,{nodes:S,edges:l,nodeTypes:j,edgeTypes:E,isValidConnection:C,onConnect:f,onNodesChange:s,onNodeClick:h,onPaneClick:p,onMoveStart:b,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(n.Background,{}),(0,t.jsx)(n.Controls,{}),w]})})})}var eL=e.i(60112),eB=e.i(30702);let eF=(0,s.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var e$=e.i(17406);let eH=(0,eN.createServerReference)("609912b2e71530227bd971713e722e2ddae870c834",eN.callServer,void 0,eN.findSourceMapURL,"approveFeature"),eV=(0,eN.createServerReference)("6056c8091c66cb6e17e1dc88724cdb36ef658aaa8b",eN.callServer,void 0,eN.findSourceMapURL,"rejectFeature"),eq=(0,eN.createServerReference)("403b2febb379fc46c91085af13c602491d955b01e2",eN.callServer,void 0,eN.findSourceMapURL,"getFeatureArtifact"),eU=(0,eN.createServerReference)("40ab7b59ff7a66389f880a241d232f328f3926f2fe",eN.callServer,void 0,eN.findSourceMapURL,"getResearchArtifact"),eX=(0,eN.createServerReference)("40ba6de692514b18656ea1b43673e1bffa26a02bf4",eN.callServer,void 0,eN.findSourceMapURL,"getMergeReviewData");var eW=e.i(8361),eY=e.i(11495),eK=e.i(81846),eG=e.i(94237);let eZ=(0,eG.cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),eQ=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function eJ({className:e,size:n="md",duration:r=5,...o}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,p.cn)(eZ({size:n}),e),...o,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),eQ.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}var e0=e.i(80986),e0=e0,e1=e.i(30090),e1=e1;function e2({status:e}){switch(e){case e$.CiStatus.Success:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(e0.default,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case e$.CiStatus.Pending:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(ee.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case e$.CiStatus.Failure:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(e1.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}let e5=(0,s.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var e3=e.i(33548),e4=e.i(23925),e6=e.i(36589),e8=e.i(87620),e9=e.i(87342),e7=e.i(66033),te=e.i(53532),tt=e.i(41687),tn=e.i(56720),tr=e.i(13123),to=e.i(52740),ti=e.i(39979),ta=e.i(85995),tl=e.i(51080),ts=e.i(29297),tu=e.i(73772),tc=e.i(13044),td=["Enter"," "],tf=["ArrowUp","PageDown","End"],th=["ArrowDown","PageUp","Home",...tf],tp={ltr:[...td,"ArrowRight"],rtl:[...td,"ArrowLeft"]},tm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tg="Menu",[tx,ty,tv]=(0,e9.createCollection)(tg),[tb,tw]=(0,m.createContextScope)(tg,[tv,to.createPopperScope,tl.createRovingFocusGroupScope]),tk=(0,to.createPopperScope)(),tj=(0,tl.createRovingFocusGroupScope)(),[tE,tC]=tb(tg),[tS,tN]=tb(tg),t_=e=>{let{__scopeMenu:n,open:o=!1,children:i,dir:a,onOpenChange:l,modal:s=!0}=e,u=tk(n),[c,d]=r.useState(null),f=r.useRef(!1),h=(0,ts.useCallbackRef)(l),p=(0,e7.useDirection)(a);return r.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(to.Root,{...u,children:(0,t.jsx)(tE,{scope:n,open:o,onOpenChange:h,content:c,onContentChange:d,children:(0,t.jsx)(tS,{scope:n,onClose:r.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:p,modal:s,children:i})})})};t_.displayName=tg;var tM=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e,i=tk(r);return(0,t.jsx)(to.Anchor,{...i,...o,ref:n})});tM.displayName="MenuAnchor";var tP="MenuPortal",[tR,tA]=tb(tP,{forceMount:void 0}),tI=e=>{let{__scopeMenu:n,forceMount:r,children:o,container:i}=e,a=tC(tP,n);return(0,t.jsx)(tR,{scope:n,forceMount:r,children:(0,t.jsx)(ta.Presence,{present:r||a.open,children:(0,t.jsx)(ti.Portal,{asChild:!0,container:i,children:o})})})};tI.displayName=tP;var tD="MenuContent",[tO,tT]=tb(tD),tz=r.forwardRef((e,n)=>{let r=tA(tD,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,a=tC(tD,e.__scopeMenu),l=tN(tD,e.__scopeMenu);return(0,t.jsx)(tx.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(ta.Presence,{present:o||a.open,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeMenu,children:l.modal?(0,t.jsx)(tL,{...i,ref:n}):(0,t.jsx)(tB,{...i,ref:n})})})})}),tL=r.forwardRef((e,n)=>{let o=tC(tD,e.__scopeMenu),i=r.useRef(null),a=(0,g.useComposedRefs)(n,i);return r.useEffect(()=>{let e=i.current;if(e)return(0,tu.hideOthers)(e)},[]),(0,t.jsx)(t$,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),tB=r.forwardRef((e,n)=>{let r=tC(tD,e.__scopeMenu);return(0,t.jsx)(t$,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),tF=(0,v.createSlot)("MenuContent.ScrollLock"),t$=r.forwardRef((e,n)=>{let{__scopeMenu:o,loop:i=!1,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:s,disableOutsidePointerEvents:u,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:x,...v}=e,b=tC(tD,o),w=tN(tD,o),k=tk(o),j=tj(o),E=ty(o),[C,S]=r.useState(null),N=r.useRef(null),_=(0,g.useComposedRefs)(n,N,b.onContentChange),M=r.useRef(0),P=r.useRef(""),R=r.useRef(0),A=r.useRef(null),I=r.useRef("right"),D=r.useRef(0),O=x?tc.RemoveScroll:r.Fragment;r.useEffect(()=>()=>window.clearTimeout(M.current),[]),(0,tt.useFocusGuards)();let T=r.useCallback(e=>{var t,n;return I.current===A.current?.side&&(t=e,!!(n=A.current?.area)&&function(e,t){let{x:n,y:r}=e,o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let a=t[e],l=t[i],s=a.x,u=a.y,c=l.x,d=l.y;u>r!=d>r&&n<(c-s)*(r-u)/(d-u)+s&&(o=!o)}return o}({x:t.clientX,y:t.clientY},n))},[]);return(0,t.jsx)(tO,{scope:o,searchRef:P,onItemEnter:r.useCallback(e=>{T(e)&&e.preventDefault()},[T]),onItemLeave:r.useCallback(e=>{T(e)||(N.current?.focus(),S(null))},[T]),onTriggerLeave:r.useCallback(e=>{T(e)&&e.preventDefault()},[T]),pointerGraceTimerRef:R,onPointerGraceIntentChange:r.useCallback(e=>{A.current=e},[]),children:(0,t.jsx)(O,{...x?{as:tF,allowPinchZoom:!0}:void 0,children:(0,t.jsx)(tn.FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:(0,y.composeEventHandlers)(l,e=>{e.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,t.jsx)(te.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:(0,t.jsx)(tl.Root,{asChild:!0,...j,dir:w.dir,orientation:"vertical",loop:i,currentTabStopId:C,onCurrentTabStopIdChange:S,onEntryFocus:(0,y.composeEventHandlers)(c,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(to.Content,{role:"menu","aria-orientation":"vertical","data-state":ni(b.open),"data-radix-menu-content":"",dir:w.dir,...k,...v,ref:_,style:{outline:"none",...v.style},onKeyDown:(0,y.composeEventHandlers)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;if(t){var o;let t,i,a,l,s,u;"Tab"===e.key&&e.preventDefault(),!n&&r&&(o=e.key,t=P.current+o,i=E().filter(e=>!e.disabled),a=document.activeElement,l=i.find(e=>e.ref.current===a)?.textValue,s=function(e,t,n){var r;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=(r=Math.max(i,0),e.map((t,n)=>e[(r+n)%e.length]));1===o.length&&(a=a.filter(e=>e!==n));let l=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}(i.map(e=>e.textValue),t,l),u=i.find(e=>e.textValue===s)?.ref.current,function e(t){P.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(t),u&&setTimeout(()=>u.focus()))}let i=N.current;if(e.target!==i||!th.includes(e.key))return;e.preventDefault();let a=E().filter(e=>!e.disabled).map(e=>e.ref.current);tf.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,y.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),P.current="")}),onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(e=>{let t=e.target,n=D.current!==e.clientX;e.currentTarget.contains(t)&&n&&(I.current=e.clientX>D.current?"right":"left",D.current=e.clientX)}))})})})})})})});tz.displayName=tD;var tH=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{role:"group",...o,ref:n})});tH.displayName="MenuGroup";var tV=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{...o,ref:n})});tV.displayName="MenuLabel";var tq="MenuItem",tU="menu.itemSelect",tX=r.forwardRef((e,n)=>{let{disabled:o=!1,onSelect:i,...a}=e,l=r.useRef(null),s=tN(tq,e.__scopeMenu),u=tT(tq,e.__scopeMenu),c=(0,g.useComposedRefs)(n,l),d=r.useRef(!1);return(0,t.jsx)(tW,{...a,ref:c,disabled:o,onClick:(0,y.composeEventHandlers)(e.onClick,()=>{let e=l.current;if(!o&&e){let t=new CustomEvent(tU,{bubbles:!0,cancelable:!0});e.addEventListener(tU,e=>i?.(e),{once:!0}),(0,e8.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,y.composeEventHandlers)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==u.searchRef.current;o||t&&" "===e.key||td.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});tX.displayName=tq;var tW=r.forwardRef((e,n)=>{let{__scopeMenu:o,disabled:i=!1,textValue:a,...l}=e,s=tT(tq,o),u=tj(o),c=r.useRef(null),d=(0,g.useComposedRefs)(n,c),[f,h]=r.useState(!1),[p,m]=r.useState("");return r.useEffect(()=>{let e=c.current;e&&m((e.textContent??"").trim())},[l.children]),(0,t.jsx)(tx.ItemSlot,{scope:o,disabled:i,textValue:a??p,children:(0,t.jsx)(tl.Item,{asChild:!0,...u,focusable:!i,children:(0,t.jsx)(e8.Primitive.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:d,onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,y.composeEventHandlers)(e.onPointerLeave,ns(e=>s.onItemLeave(e))),onFocus:(0,y.composeEventHandlers)(e.onFocus,()=>h(!0)),onBlur:(0,y.composeEventHandlers)(e.onBlur,()=>h(!1))})})})}),tY=r.forwardRef((e,n)=>{let{checked:r=!1,onCheckedChange:o,...i}=e;return(0,t.jsx)(t2,{scope:e.__scopeMenu,checked:r,children:(0,t.jsx)(tX,{role:"menuitemcheckbox","aria-checked":na(r)?"mixed":r,...i,ref:n,"data-state":nl(r),onSelect:(0,y.composeEventHandlers)(i.onSelect,()=>o?.(!!na(r)||!r),{checkForDefaultPrevented:!1})})})});tY.displayName="MenuCheckboxItem";var tK="MenuRadioGroup",[tG,tZ]=tb(tK,{value:void 0,onValueChange:()=>{}}),tQ=r.forwardRef((e,n)=>{let{value:r,onValueChange:o,...i}=e,a=(0,ts.useCallbackRef)(o);return(0,t.jsx)(tG,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,t.jsx)(tH,{...i,ref:n})})});tQ.displayName=tK;var tJ="MenuRadioItem",t0=r.forwardRef((e,n)=>{let{value:r,...o}=e,i=tZ(tJ,e.__scopeMenu),a=r===i.value;return(0,t.jsx)(t2,{scope:e.__scopeMenu,checked:a,children:(0,t.jsx)(tX,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":nl(a),onSelect:(0,y.composeEventHandlers)(o.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});t0.displayName=tJ;var t1="MenuItemIndicator",[t2,t5]=tb(t1,{checked:!1}),t3=r.forwardRef((e,n)=>{let{__scopeMenu:r,forceMount:o,...i}=e,a=t5(t1,r);return(0,t.jsx)(ta.Presence,{present:o||na(a.checked)||!0===a.checked,children:(0,t.jsx)(e8.Primitive.span,{...i,ref:n,"data-state":nl(a.checked)})})});t3.displayName=t1;var t4=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});t4.displayName="MenuSeparator";var t6=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e,i=tk(r);return(0,t.jsx)(to.Arrow,{...i,...o,ref:n})});t6.displayName="MenuArrow";var t8="MenuSub",[t9,t7]=tb(t8),ne=e=>{let{__scopeMenu:n,children:o,open:i=!1,onOpenChange:a}=e,l=tC(t8,n),s=tk(n),[u,c]=r.useState(null),[d,f]=r.useState(null),h=(0,ts.useCallbackRef)(a);return r.useEffect(()=>(!1===l.open&&h(!1),()=>h(!1)),[l.open,h]),(0,t.jsx)(to.Root,{...s,children:(0,t.jsx)(tE,{scope:n,open:i,onOpenChange:h,content:d,onContentChange:f,children:(0,t.jsx)(t9,{scope:n,contentId:(0,tr.useId)(),triggerId:(0,tr.useId)(),trigger:u,onTriggerChange:c,children:o})})})};ne.displayName=t8;var nt="MenuSubTrigger",nn=r.forwardRef((e,n)=>{let o=tC(nt,e.__scopeMenu),i=tN(nt,e.__scopeMenu),a=t7(nt,e.__scopeMenu),l=tT(nt,e.__scopeMenu),s=r.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:c}=l,d={__scopeMenu:e.__scopeMenu},f=r.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return r.useEffect(()=>f,[f]),r.useEffect(()=>{let e=u.current;return()=>{window.clearTimeout(e),c(null)}},[u,c]),(0,t.jsx)(tM,{asChild:!0,...d,children:(0,t.jsx)(tW,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":a.contentId,"data-state":ni(o.open),...e,ref:(0,g.composeRefs)(n,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(t=>{l.onItemEnter(t),!t.defaultPrevented&&(e.disabled||o.open||s.current||(l.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100)))})),onPointerLeave:(0,y.composeEventHandlers)(e.onPointerLeave,ns(e=>{f();let t=o.content?.getBoundingClientRect();if(t){let n=o.content?.dataset.side,r="right"===n,i=t[r?"left":"right"],a=t[r?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,t=>{let n=""!==l.searchRef.current;e.disabled||n&&" "===t.key||tp[i.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});nn.displayName=nt;var nr="MenuSubContent",no=r.forwardRef((e,n)=>{let o=tA(tD,e.__scopeMenu),{forceMount:i=o.forceMount,...a}=e,l=tC(tD,e.__scopeMenu),s=tN(tD,e.__scopeMenu),u=t7(nr,e.__scopeMenu),c=r.useRef(null),d=(0,g.useComposedRefs)(n,c);return(0,t.jsx)(tx.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(ta.Presence,{present:i||l.open,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(t$,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:d,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:(0,y.composeEventHandlers)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=tm[s.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});function ni(e){return e?"open":"closed"}function na(e){return"indeterminate"===e}function nl(e){return na(e)?"indeterminate":e?"checked":"unchecked"}function ns(e){return t=>"mouse"===t.pointerType?e(t):void 0}no.displayName=nr;var nu="DropdownMenu",[nc,nd]=(0,m.createContextScope)(nu,[tw]),nf=tw(),[nh,np]=nc(nu),nm=e=>{let{__scopeDropdownMenu:n,children:o,dir:i,open:a,defaultOpen:l,onOpenChange:s,modal:u=!0}=e,c=nf(n),d=r.useRef(null),[f,h]=(0,e6.useControllableState)({prop:a,defaultProp:l??!1,onChange:s,caller:nu});return(0,t.jsx)(nh,{scope:n,triggerId:(0,tr.useId)(),triggerRef:d,contentId:(0,tr.useId)(),open:f,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),modal:u,children:(0,t.jsx)(t_,{...c,open:f,onOpenChange:h,dir:i,modal:u,children:o})})};nm.displayName=nu;var ng="DropdownMenuTrigger",nx=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,a=np(ng,r),l=nf(r);return(0,t.jsx)(tM,{asChild:!0,...l,children:(0,t.jsx)(e8.Primitive.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:(0,g.composeRefs)(n,a.triggerRef),onPointerDown:(0,y.composeEventHandlers)(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{!o&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});nx.displayName=ng;var ny=e=>{let{__scopeDropdownMenu:n,...r}=e,o=nf(n);return(0,t.jsx)(tI,{...o,...r})};ny.displayName="DropdownMenuPortal";var nv="DropdownMenuContent",nb=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:o,...i}=e,a=np(nv,o),l=nf(o),s=r.useRef(!1);return(0,t.jsx)(tz,{id:a.contentId,"aria-labelledby":a.triggerId,...l,...i,ref:n,onCloseAutoFocus:(0,y.composeEventHandlers)(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,y.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nb.displayName=nv;var nw=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tH,{...i,...o,ref:n})});nw.displayName="DropdownMenuGroup";var nk=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tV,{...i,...o,ref:n})});nk.displayName="DropdownMenuLabel";var nj=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tX,{...i,...o,ref:n})});nj.displayName="DropdownMenuItem";var nE=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tY,{...i,...o,ref:n})});nE.displayName="DropdownMenuCheckboxItem";var nC=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tQ,{...i,...o,ref:n})});nC.displayName="DropdownMenuRadioGroup";var nS=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t0,{...i,...o,ref:n})});nS.displayName="DropdownMenuRadioItem";var nN=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t3,{...i,...o,ref:n})});nN.displayName="DropdownMenuItemIndicator";var n_=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t4,{...i,...o,ref:n})});n_.displayName="DropdownMenuSeparator";var nM=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t6,{...i,...o,ref:n})});nM.displayName="DropdownMenuArrow";var nP=e=>{let{__scopeDropdownMenu:n,children:r,open:o,onOpenChange:i,defaultOpen:a}=e,l=nf(n),[s,u]=(0,e6.useControllableState)({prop:o,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return(0,t.jsx)(ne,{...l,open:s,onOpenChange:u,children:r})},nR=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(nn,{...i,...o,ref:n})});nR.displayName="DropdownMenuSubTrigger";var nA=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(no,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nA.displayName="DropdownMenuSubContent",e.s(["Arrow",()=>nM,"CheckboxItem",()=>nE,"Content",()=>nb,"DropdownMenu",()=>nm,"DropdownMenuArrow",()=>nM,"DropdownMenuCheckboxItem",()=>nE,"DropdownMenuContent",()=>nb,"DropdownMenuGroup",()=>nw,"DropdownMenuItem",()=>nj,"DropdownMenuItemIndicator",()=>nN,"DropdownMenuLabel",()=>nk,"DropdownMenuPortal",()=>ny,"DropdownMenuRadioGroup",()=>nC,"DropdownMenuRadioItem",()=>nS,"DropdownMenuSeparator",()=>n_,"DropdownMenuSub",()=>nP,"DropdownMenuSubContent",()=>nA,"DropdownMenuSubTrigger",()=>nR,"DropdownMenuTrigger",()=>nx,"Group",()=>nw,"Item",()=>nj,"ItemIndicator",()=>nN,"Label",()=>nk,"Portal",()=>ny,"RadioGroup",()=>nC,"RadioItem",()=>nS,"Root",()=>nm,"Separator",()=>n_,"Sub",()=>nP,"SubContent",()=>nA,"SubTrigger",()=>nR,"Trigger",()=>nx,"createDropdownMenuScope",()=>nd],61920);var nI=e.i(61920),nI=nI;let nD=(0,s.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),nO=(0,s.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),nT=nI.Root,nz=nI.Trigger;nI.Group,nI.Portal,nI.Sub,nI.RadioGroup,r.forwardRef(({className:e,inset:n,children:r,...o},i)=>(0,t.jsxs)(nI.SubTrigger,{ref:i,className:(0,p.cn)("focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,(0,t.jsx)(nD,{className:"ml-auto"})]})).displayName=nI.SubTrigger.displayName,r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nI.SubContent,{ref:r,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",e),...n})).displayName=nI.SubContent.displayName;let nL=r.forwardRef(({className:e,sideOffset:n=4,...r},o)=>(0,t.jsx)(nI.Portal,{children:(0,t.jsx)(nI.Content,{ref:o,sideOffset:n,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...r})}));nL.displayName=nI.Content.displayName;let nB=r.forwardRef(({className:e,inset:n,...r},o)=>(0,t.jsx)(nI.Item,{ref:o,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r}));nB.displayName=nI.Item.displayName,r.forwardRef(({className:e,children:n,checked:r,...o},i)=>(0,t.jsxs)(nI.CheckboxItem,{ref:i,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(nI.ItemIndicator,{children:(0,t.jsx)(e4.Check,{className:"h-4 w-4"})})}),n]})).displayName=nI.CheckboxItem.displayName,r.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(nI.RadioItem,{ref:o,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(nI.ItemIndicator,{children:(0,t.jsx)(nO,{className:"h-2 w-2 fill-current"})})}),n]})).displayName=nI.RadioItem.displayName;let nF=r.forwardRef(({className:e,inset:n,...r},o)=>(0,t.jsx)(nI.Label,{ref:o,className:(0,p.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}));nF.displayName=nI.Label.displayName;let n$=r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nI.Separator,{ref:r,className:(0,p.cn)("bg-muted -mx-1 my-1 h-px",e),...n}));function nH({actions:e,repositoryPath:n,showSpecs:o}){let[a,l]=(0,r.useState)(!1),s=e.ideLoading||e.shellLoading||e.specsLoading,u=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(nT,{modal:!1,children:[(0,t.jsx)(nz,{asChild:!0,children:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:s,children:[s?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):u?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(eb.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(e5,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(nL,{align:"start",className:"w-48",children:[(0,t.jsx)(nF,{children:"Open in"}),(0,t.jsxs)(nB,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(ey,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(nB,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(ev.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(nB,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!o,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(eb.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(n$,{}),(0,t.jsxs)(nB,{onClick:()=>{navigator.clipboard.writeText(n),l(!0),setTimeout(()=>l(!1),2e3)},className:"gap-2",children:[a?(0,t.jsx)(e4.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(e3.Copy,{className:"size-4"}),a?"Copied!":"Copy path"]})]})]})}n$.displayName=nI.Separator.displayName;var nV=e.i(91891),nV=nV;let nq=(0,s.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),nU=(0,s.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),nX=(0,s.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),nW=(0,s.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var nY=e.i(1012),nY=nY,nK=e.i(98127);function nG({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,p.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var nZ=r.forwardRef((e,n)=>(0,t.jsx)(e8.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));nZ.displayName="Label",e.s(["Label",()=>nZ,"Root",()=>nZ],27572);var nQ=e.i(27572),nQ=nQ;let nJ=(0,eG.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),n0=r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nQ.Root,{ref:r,className:(0,p.cn)(nJ(),e),...n}));n0.displayName=nQ.Root.displayName;var nY=nY;let n1=(0,s.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var n2=e.i(77624),n5="Checkbox",[n3,n4]=(0,m.createContextScope)(n5),[n6,n8]=n3(n5);function n9(e){let{__scopeCheckbox:n,checked:o,children:i,defaultChecked:a,disabled:l,form:s,name:u,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[p,m]=(0,e6.useControllableState)({prop:o,defaultProp:a??!1,onChange:c,caller:n5}),[g,x]=r.useState(null),[y,v]=r.useState(null),b=r.useRef(!1),w=!g||!!s||!!g.closest("form"),k={checked:p,disabled:l,setChecked:m,control:g,setControl:x,name:u,form:s,value:f,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:!ra(a)&&a,isFormControl:w,bubbleInput:y,setBubbleInput:v};return(0,t.jsx)(n6,{scope:n,...k,children:"function"==typeof h?h(k):i})}var n7="CheckboxTrigger",re=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...i},a)=>{let{control:l,value:s,disabled:u,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:x}=n8(n7,e),v=(0,g.useComposedRefs)(a,f),b=r.useRef(c);return r.useEffect(()=>{let e=l?.form;if(e){let t=()=>h(b.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,h]),(0,t.jsx)(e8.Primitive.button,{type:"button",role:"checkbox","aria-checked":ra(c)?"mixed":c,"aria-required":d,"data-state":rl(c),"data-disabled":u?"":void 0,disabled:u,value:s,...i,ref:v,onKeyDown:(0,y.composeEventHandlers)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,y.composeEventHandlers)(o,e=>{h(e=>!!ra(e)||!e),x&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});re.displayName=n7;var rt=r.forwardRef((e,n)=>{let{__scopeCheckbox:r,name:o,checked:i,defaultChecked:a,required:l,disabled:s,value:u,onCheckedChange:c,form:d,...f}=e;return(0,t.jsx)(n9,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:s,required:l,onCheckedChange:c,name:o,form:d,value:u,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(re,{...f,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(ri,{__scopeCheckbox:r})]})})});rt.displayName=n5;var rn="CheckboxIndicator",rr=r.forwardRef((e,n)=>{let{__scopeCheckbox:r,forceMount:o,...i}=e,a=n8(rn,r);return(0,t.jsx)(ta.Presence,{present:o||ra(a.checked)||!0===a.checked,children:(0,t.jsx)(e8.Primitive.span,{"data-state":rl(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})});rr.displayName=rn;var ro="CheckboxBubbleInput",ri=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{let i,{control:a,hasConsumerStoppedPropagationRef:l,checked:s,defaultChecked:u,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:m,setBubbleInput:x}=n8(ro,e),y=(0,g.useComposedRefs)(o,x),v=(i=r.useRef({value:s,previous:s}),r.useMemo(()=>(i.current.value!==s&&(i.current.previous=i.current.value,i.current.value=s),i.current.previous),[s])),b=(0,n2.useSize)(a);r.useEffect(()=>{if(!m)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!l.current;if(v!==s&&e){let n=new Event("click",{bubbles:t});m.indeterminate=ra(s),e.call(m,!ra(s)&&s),m.dispatchEvent(n)}},[m,v,s,l]);let w=r.useRef(!ra(s)&&s);return(0,t.jsx)(e8.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??w.current,required:c,disabled:d,name:f,value:h,form:p,...n,tabIndex:-1,ref:y,style:{...n.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function ra(e){return"indeterminate"===e}function rl(e){return ra(e)?"indeterminate":e?"checked":"unchecked"}ri.displayName=ro,e.s(["Checkbox",()=>rt,"CheckboxIndicator",()=>rr,"Indicator",()=>rr,"Root",()=>rt,"createCheckboxScope",()=>n4,"unstable_BubbleInput",()=>ri,"unstable_CheckboxBubbleInput",()=>ri,"unstable_CheckboxProvider",()=>n9,"unstable_CheckboxTrigger",()=>re,"unstable_Provider",()=>n9,"unstable_Trigger",()=>re],57696);var rs=e.i(57696),rs=rs;function ru({className:e,...n}){return(0,t.jsx)(rs.Root,{"data-slot":"checkbox",className:(0,p.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:(0,t.jsx)(rs.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:"indeterminate"===n.checked?(0,t.jsx)(n1,{className:"size-3.5"}):(0,t.jsx)(nY.default,{className:"size-3.5"})})})}function rc({id:e,label:n,description:r,checked:o,onCheckedChange:i,disabled:a}){return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ru,{id:e,className:"mt-0.75",checked:o,onCheckedChange:e=>i(!0===e),disabled:a}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(n0,{htmlFor:e,className:"cursor-pointer text-sm font-medium",children:n}),r?(0,t.jsx)(n0,{htmlFor:e,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:r}):null]})]})}function rd({label:e,description:n,parentAriaLabel:r,options:o,value:i,onValueChange:a,disabled:l}){let s=o.filter(e=>i[e.id]).length,u=s===o.length,c=s>0&&!u,d=`${e.toLowerCase().replace(/\s+/g,"-")}-group`;return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ru,{id:d,className:"mt-0.75",checked:c?"indeterminate":u,onCheckedChange:()=>{let e=s<o.length,t={};for(let n of o)t[n.id]=e;a(t)},disabled:l,"aria-label":r??`${e} select all`}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(n0,{htmlFor:d,className:"cursor-pointer text-sm font-medium",children:e}),n?(0,t.jsx)(n0,{htmlFor:d,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:n}):null]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 pl-6",children:o.map(e=>(0,t.jsx)(rc,{id:e.id,label:e.label,description:e.description,checked:i[e.id]??!1,onCheckedChange:t=>{var n;return n=e.id,void a({...i,[n]:t})},disabled:l},e.id))})]})}var rf="Popover",[rh,rp]=(0,m.createContextScope)(rf,[to.createPopperScope]),rm=(0,to.createPopperScope)(),[rg,rx]=rh(rf),ry=e=>{let{__scopePopover:n,children:o,open:i,defaultOpen:a,onOpenChange:l,modal:s=!1}=e,u=rm(n),c=r.useRef(null),[d,f]=r.useState(!1),[h,p]=(0,e6.useControllableState)({prop:i,defaultProp:a??!1,onChange:l,caller:rf});return(0,t.jsx)(to.Root,{...u,children:(0,t.jsx)(rg,{scope:n,contentId:(0,tr.useId)(),triggerRef:c,open:h,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:d,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:s,children:o})})};ry.displayName=rf;var rv="PopoverAnchor",rb=r.forwardRef((e,n)=>{let{__scopePopover:o,...i}=e,a=rx(rv,o),l=rm(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=a;return r.useEffect(()=>(s(),()=>u()),[s,u]),(0,t.jsx)(to.Anchor,{...l,...i,ref:n})});rb.displayName=rv;var rw="PopoverTrigger",rk=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rx(rw,r),a=rm(r),l=(0,g.useComposedRefs)(n,i.triggerRef),s=(0,t.jsx)(e8.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rT(i.open),...o,ref:l,onClick:(0,y.composeEventHandlers)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,t.jsx)(to.Anchor,{asChild:!0,...a,children:s})});rk.displayName=rw;var rj="PopoverPortal",[rE,rC]=rh(rj,{forceMount:void 0}),rS=e=>{let{__scopePopover:n,forceMount:r,children:o,container:i}=e,a=rx(rj,n);return(0,t.jsx)(rE,{scope:n,forceMount:r,children:(0,t.jsx)(ta.Presence,{present:r||a.open,children:(0,t.jsx)(ti.Portal,{asChild:!0,container:i,children:o})})})};rS.displayName=rj;var rN="PopoverContent",r_=r.forwardRef((e,n)=>{let r=rC(rN,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,a=rx(rN,e.__scopePopover);return(0,t.jsx)(ta.Presence,{present:o||a.open,children:a.modal?(0,t.jsx)(rP,{...i,ref:n}):(0,t.jsx)(rR,{...i,ref:n})})});r_.displayName=rN;var rM=(0,v.createSlot)("PopoverContent.RemoveScroll"),rP=r.forwardRef((e,n)=>{let o=rx(rN,e.__scopePopover),i=r.useRef(null),a=(0,g.useComposedRefs)(n,i),l=r.useRef(!1);return r.useEffect(()=>{let e=i.current;if(e)return(0,tu.hideOthers)(e)},[]),(0,t.jsx)(tc.RemoveScroll,{as:rM,allowPinchZoom:!0,children:(0,t.jsx)(rA,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,y.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),l.current||o.triggerRef.current?.focus()}),onPointerDownOutside:(0,y.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;l.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),rR=r.forwardRef((e,n)=>{let o=rx(rN,e.__scopePopover),i=r.useRef(!1),a=r.useRef(!1);return(0,t.jsx)(rA,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rA=r.forwardRef((e,n)=>{let{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,...f}=e,h=rx(rN,r),p=rm(r);return(0,tt.useFocusGuards)(),(0,t.jsx)(tn.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,t.jsx)(te.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:(0,t.jsx)(to.Content,{"data-state":rT(h.open),role:"dialog",id:h.contentId,...p,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rI="PopoverClose",rD=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rx(rI,r);return(0,t.jsx)(e8.Primitive.button,{type:"button",...o,ref:n,onClick:(0,y.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});rD.displayName=rI;var rO=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rm(r);return(0,t.jsx)(to.Arrow,{...i,...o,ref:n})});function rT(e){return e?"open":"closed"}rO.displayName="PopoverArrow",e.s(["Anchor",()=>rb,"Arrow",()=>rO,"Close",()=>rD,"Content",()=>r_,"Popover",()=>ry,"PopoverAnchor",()=>rb,"PopoverArrow",()=>rO,"PopoverClose",()=>rD,"PopoverContent",()=>r_,"PopoverPortal",()=>rS,"PopoverTrigger",()=>rk,"Portal",()=>rS,"Root",()=>ry,"Trigger",()=>rk,"createPopoverScope",()=>rp],89920);var rz=e.i(89920),rz=rz;let rL=rz.Root,rB=rz.Trigger;rz.Anchor;let rF=r.forwardRef(({className:e,align:n="center",sideOffset:r=4,...o},i)=>(0,t.jsx)(rz.Portal,{children:(0,t.jsx)(rz.Content,{ref:i,align:n,sideOffset:r,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));async function r$(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}rF.displayName=rz.Content.displayName;let rH=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],rV={allowPrd:!1,allowPlan:!1,allowMerge:!1};function rq({open:e,onClose:n,onSubmit:o,repositoryPath:a,isSubmitting:l=!1,workflowDefaults:s,features:u,initialParentId:c}){let d=(0,eW.useSoundAction)("create"),f=s?.approvalGates??rV,h=s?.push??!1,p=s?.openPr??!1,[m,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),[v,b]=(0,r.useState)([]),[w,k]=(0,r.useState)({...f}),[j,E]=(0,r.useState)(h),[C,S]=(0,r.useState)(p),[N,_]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{s&&(k({...s.approvalGates}),E(s.push),S(s.openPr))},[s]),(0,r.useEffect)(()=>{e&&c&&_(c)},[e,c]);let M=(0,r.useCallback)(()=>{g(""),y(""),b([]),k({...f}),E(h),S(p),_(void 0)},[f,h,p]),P=(0,r.useCallback)(()=>{M(),n()},[n,M]),R=(0,r.useCallback)(e=>{if(e.preventDefault(),!m.trim())return;d.play();let t=x.trim()||void 0;o({name:m.trim(),description:t,attachments:v,repositoryPath:a,approvalGates:{allowPrd:w.allowPrd??!1,allowPlan:w.allowPlan??!1,allowMerge:w.allowMerge??!1},push:j||C,openPr:C,...N?{parentId:N}:{}}),M()},[m,x,v,w,a,o,j,C,N,d,M]),A=(0,r.useCallback)(async()=>{try{let e=await r$();e&&b(t=>[...t,...e])}catch{}},[]),I=(0,r.useCallback)(e=>{b(t=>t.filter(t=>t.path!==e))},[]),D=u&&u.length>0;return(0,t.jsx)(eY.BaseDrawer,{open:e,onClose:P,size:"md",modal:!1,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(eI.DrawerTitle,{children:"NEW FEATURE"})]}),(0,t.jsx)(eI.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(eK.Badge,{variant:"secondary",children:"Creating..."})})})]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:P,disabled:l,children:"Cancel"}),(0,t.jsx)(i.Button,{type:"submit",form:"create-feature-form",disabled:!m.trim()||l,children:l?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsxs)("form",{id:"create-feature-form",onSubmit:R,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"feature-name",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"FEATURE NAME"}),(0,t.jsx)(nK.Input,{id:"feature-name",placeholder:"e.g. GitHub OAuth Login",value:m,onChange:e=>g(e.target.value),required:!0,disabled:l})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIPTION"}),(0,t.jsx)(nG,{id:"feature-description",placeholder:"Describe what this feature does...",value:x,onChange:e=>y(e.target.value),rows:4,disabled:l})]}),D?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(rU,{features:u,value:N,onChange:_,disabled:l})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"APPROVE"}),(0,t.jsx)(rd,{label:"Autonomous Mode",description:"YOLO!",parentAriaLabel:"Auto approve all",options:rH,value:w,onValueChange:k,disabled:l})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(rc,{id:"push",label:"Push",description:"Push branch to remote after implementation.",checked:j||C,onCheckedChange:E,disabled:C||l}),(0,t.jsx)(rc,{id:"open-pr",label:"Create PR",description:"Open a pull request after pushing.",checked:C,onCheckedChange:S,disabled:l})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:["ATTACHMENTS",v.length>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60 ml-1.5",children:["(",v.length,")"]})]}),(0,t.jsxs)(i.Button,{type:"button",variant:"outline",size:"xs",onClick:A,disabled:l,children:[(0,t.jsx)(nV.default,{className:"size-3"}),"Add Files"]})]}),v.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:v.map(e=>(0,t.jsx)(rX,{file:e,onRemove:()=>I(e.path),disabled:l},e.path))})]})]})})})}function rU({features:e,value:n,onChange:o,disabled:i}){let[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(""),c=(0,r.useRef)(null),d=e.find(e=>e.id===n),f=s.trim()?e.filter(e=>e.name.toLowerCase().includes(s.toLowerCase())||e.id.toLowerCase().includes(s.toLowerCase())):e,h=(0,r.useCallback)(e=>{o(e),l(!1),u("")},[o]);return(0,r.useEffect)(()=>{a?setTimeout(()=>c.current?.focus(),0):u("")},[a]),(0,t.jsxs)(rL,{open:a,onOpenChange:l,children:[(0,t.jsx)(rB,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":a,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,p.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!d&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:d?`${d.name} (${d.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(nW,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(rF,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(nK.Input,{ref:c,placeholder:"Search features...",value:s,onChange:e=>u(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===n,onClick:()=>h(void 0),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===n&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(nY.default,{className:(0,p.cn)("h-4 w-4 shrink-0",void 0!==n&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===f.length&&s?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):f.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":n===e.id,onClick:()=>h(e.id),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",n===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(nY.default,{className:(0,p.cn)("h-4 w-4 shrink-0",n!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function rX({file:e,onRemove:n,disabled:r}){var o,a,l;let s,u=(s=(o=e.name).lastIndexOf("."))>=0?o.slice(s).toLowerCase():"",d=(a=u,rW.has(a)?nU:".pdf"===a?c:rY.has(a)?nX:nq),f=".pdf"===(l=u)?"bg-red-50 text-red-600":rW.has(l)?"bg-blue-50 text-blue-600":rY.has(l)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600";return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border p-2",children:[(0,t.jsx)("div",{className:(0,p.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded",f),children:(0,t.jsx)(d,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}(e.size)})]}),(0,t.jsx)(i.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:n,disabled:r,"aria-label":`Remove ${e.name}`,children:(0,t.jsx)(h,{className:"h-3 w-3"})})]})}let rW=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),rY=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]),rK=(0,s.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),rG=(0,s.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);function rZ({onReject:e,onApprove:n,approveLabel:o,approveIcon:a,revisionPlaceholder:l,isProcessing:s=!1,isRejecting:u=!1,children:c}){let[d,f]=(0,r.useState)(""),h=(0,eW.useSoundAction)("approve"),p=s||u;return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsxs)("form",{onSubmit:function(t){t.preventDefault();let n=d.trim();n&&e&&(e(n),f(""))},className:"flex items-center gap-2 p-4",children:[(0,t.jsx)(nK.Input,{type:"text",placeholder:l??"Ask AI to revise...","aria-label":l??"Ask AI to revise...",disabled:p,value:d,onChange:e=>f(e.target.value),className:"flex-1"}),(0,t.jsx)(i.Button,{type:"submit",variant:"secondary",size:"icon","aria-label":"Send",disabled:p,children:(0,t.jsx)(rG,{})}),(0,t.jsxs)(i.Button,{type:"button",disabled:p,onClick:()=>{h.play(),n()},children:[a,o]})]}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsxs)(i.Button,{type:"button",className:"flex-1",disabled:p,onClick:()=>{h.play(),n()},children:[a,o]})})]})}function rQ({data:e,selections:n,onSelect:o,onApprove:a,onReject:l,isProcessing:s=!1,isRejecting:u=!1,showHeader:c=!1}){let{question:d,context:f,questions:h,finalAction:m}=e,[g,x]=(0,r.useState)(0),y=(0,eW.useSoundAction)("select"),v=(0,eW.useSoundAction)("navigate"),b=h.length,w=g===b-1,k=h[g],j=(0,r.useMemo)(()=>Object.keys(n).length,[n]),E=(0,r.useCallback)((e,t)=>{y.play(),o(e,t),w||setTimeout(()=>x(e=>e+1),250)},[o,w,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:d}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:k.question}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,r)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${r+1}`,className:(0,p.cn)("h-1.5 rounded-full transition-all duration-200",r===g?"bg-primary w-4":"w-1.5",r!==g&&n[e.id]?"bg-primary/50":"",r===g||n[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),x(r)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:k.options.map((e,r)=>{let o=n[k.id]===e.id,i=String.fromCharCode(65+r);return(0,t.jsx)("button",{type:"button",className:(0,p.cn)("border-border w-full rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",o&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:s,onClick:()=>E(k.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[i,"."]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-0.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:e.label}),e.recommended?(0,t.jsx)(eK.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null,e.isNew?(0,t.jsx)(eK.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] text-white hover:bg-emerald-600/80",children:"New"}):null]}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]})]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===g||s,onClick:()=>{v.play(),x(e=>e-1)},children:[(0,t.jsx)(rK,{className:"mr-1 h-4 w-4"}),"Previous"]}),w?null:(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:s,onClick:()=>{v.play(),x(e=>e+1)},children:[n[k.id]?"Next":"Skip",(0,t.jsx)(nD,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(rZ,{onReject:l,onApprove:()=>a(m.id),approveLabel:m.label,approveIcon:(0,t.jsx)(e4.Check,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:s,isRejecting:u,children:(0,t.jsx)("div",{className:(0,p.cn)("bg-muted h-1.5 overflow-hidden",j>0&&j<b||s?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:s?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?j/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function rJ(){}function r0(){}let r1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r5={};function r3(e,t){return((t||r5).jsx?r2:r1).test(e)}let r4=/[ \t\n\f\r]/g;function r6(e){return""===e.replace(r4,"")}class r8{constructor(e,t){this.attribute=t,this.property=e}}r8.prototype.attribute="",r8.prototype.booleanish=!1,r8.prototype.boolean=!1,r8.prototype.commaOrSpaceSeparated=!1,r8.prototype.commaSeparated=!1,r8.prototype.defined=!1,r8.prototype.mustUseProperty=!1,r8.prototype.number=!1,r8.prototype.overloadedBoolean=!1,r8.prototype.property="",r8.prototype.spaceSeparated=!1,r8.prototype.space=void 0;let r9=0,r7=oa(),oe=oa(),ot=oa(),on=oa(),or=oa(),oo=oa(),oi=oa();function oa(){return 2**++r9}e.s(["boolean",0,r7,"booleanish",0,oe,"commaOrSpaceSeparated",0,oi,"commaSeparated",0,oo,"number",0,on,"overloadedBoolean",0,ot,"spaceSeparated",0,or],83954);var ol=e.i(83954);let os=Object.keys(ol);class ou extends r8{constructor(e,t,n,r){let o=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++o<os.length;){const e=os[o];!function(e,t,n){n&&(e[t]=n)}(this,os[o],(n&ol[e])===ol[e])}}}function oc(e){return e.toLowerCase()}ou.prototype.defined=!0;let od=/[A-Z]/g,of=/-[a-z]/g,oh=/^data[-\w.:]+$/i;function op(e){return"-"+e.toLowerCase()}function om(e){return e.charAt(1).toUpperCase()}let og={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class ox{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function oy(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ox(n,r,t)}function ov(e){let t={},n={};for(let[r,o]of Object.entries(e.properties)){let i=new ou(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[oc(r)]=r,n[oc(i.attribute)]=r}return new ox(t,n,e.space)}ox.prototype.normal={},ox.prototype.property={},ox.prototype.space=void 0;let ob=ov({properties:{ariaActiveDescendant:null,ariaAtomic:oe,ariaAutoComplete:null,ariaBusy:oe,ariaChecked:oe,ariaColCount:on,ariaColIndex:on,ariaColSpan:on,ariaControls:or,ariaCurrent:null,ariaDescribedBy:or,ariaDetails:null,ariaDisabled:oe,ariaDropEffect:or,ariaErrorMessage:null,ariaExpanded:oe,ariaFlowTo:or,ariaGrabbed:oe,ariaHasPopup:null,ariaHidden:oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:or,ariaLevel:on,ariaLive:null,ariaModal:oe,ariaMultiLine:oe,ariaMultiSelectable:oe,ariaOrientation:null,ariaOwns:or,ariaPlaceholder:null,ariaPosInSet:on,ariaPressed:oe,ariaReadOnly:oe,ariaRelevant:null,ariaRequired:oe,ariaRoleDescription:or,ariaRowCount:on,ariaRowIndex:on,ariaRowSpan:on,ariaSelected:oe,ariaSetSize:on,ariaSort:null,ariaValueMax:on,ariaValueMin:on,ariaValueNow:on,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function ow(e,t){return t in e?e[t]:t}function ok(e,t){return ow(e,t.toLowerCase())}let oj=ov({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:or,accessKey:or,action:null,allow:null,allowFullScreen:r7,allowPaymentRequest:r7,allowUserMedia:r7,alt:null,as:null,async:r7,autoCapitalize:null,autoComplete:or,autoFocus:r7,autoPlay:r7,blocking:or,capture:null,charSet:null,checked:r7,cite:null,className:or,cols:on,colSpan:null,content:null,contentEditable:oe,controls:r7,controlsList:or,coords:on|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:r7,defer:r7,dir:null,dirName:null,disabled:r7,download:ot,draggable:oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:r7,formTarget:null,headers:or,height:on,hidden:ot,high:on,href:null,hrefLang:null,htmlFor:or,httpEquiv:or,id:null,imageSizes:null,imageSrcSet:null,inert:r7,inputMode:null,integrity:null,is:null,isMap:r7,itemId:null,itemProp:or,itemRef:or,itemScope:r7,itemType:or,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:r7,low:on,manifest:null,max:null,maxLength:on,media:null,method:null,min:null,minLength:on,multiple:r7,muted:r7,name:null,nonce:null,noModule:r7,noValidate:r7,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:r7,optimum:on,pattern:null,ping:or,placeholder:null,playsInline:r7,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:r7,referrerPolicy:null,rel:or,required:r7,reversed:r7,rows:on,rowSpan:on,sandbox:or,scope:null,scoped:r7,seamless:r7,selected:r7,shadowRootClonable:r7,shadowRootDelegatesFocus:r7,shadowRootMode:null,shape:null,size:on,sizes:null,slot:null,span:on,spellCheck:oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:on,step:null,style:null,tabIndex:on,target:null,title:null,translate:null,type:null,typeMustMatch:r7,useMap:null,value:oe,width:on,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:or,axis:null,background:null,bgColor:null,border:on,borderColor:null,bottomMargin:on,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:r7,declare:r7,event:null,face:null,frame:null,frameBorder:null,hSpace:on,leftMargin:on,link:null,longDesc:null,lowSrc:null,marginHeight:on,marginWidth:on,noResize:r7,noHref:r7,noShade:r7,noWrap:r7,object:null,profile:null,prompt:null,rev:null,rightMargin:on,rules:null,scheme:null,scrolling:oe,standby:null,summary:null,text:null,topMargin:on,valueType:null,version:null,vAlign:null,vLink:null,vSpace:on,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:r7,disableRemotePlayback:r7,prefix:null,property:null,results:on,security:null,unselectable:null},space:"html",transform:ok}),oE=ov({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:oi,accentHeight:on,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:on,amplitude:on,arabicForm:null,ascent:on,attributeName:null,attributeType:null,azimuth:on,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:on,by:null,calcMode:null,capHeight:on,className:or,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:on,diffuseConstant:on,direction:null,display:null,dur:null,divisor:on,dominantBaseline:null,download:r7,dx:null,dy:null,edgeMode:null,editable:null,elevation:on,enableBackground:null,end:null,event:null,exponent:on,externalResourcesRequired:null,fill:null,fillOpacity:on,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:on,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:on,horizOriginX:on,horizOriginY:on,id:null,ideographic:on,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:on,k:on,k1:on,k2:on,k3:on,k4:on,kernelMatrix:oi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:on,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:on,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:on,overlineThickness:on,paintOrder:null,panose1:null,path:null,pathLength:on,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:or,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:on,pointsAtY:on,pointsAtZ:on,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oi,rev:oi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oi,requiredFeatures:oi,requiredFonts:oi,requiredFormats:oi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:on,specularExponent:on,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:on,strikethroughThickness:on,string:null,stroke:null,strokeDashArray:oi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:on,strokeOpacity:on,strokeWidth:null,style:null,surfaceScale:on,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oi,tabIndex:on,tableValues:null,target:null,targetX:on,targetY:on,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:on,underlineThickness:on,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:on,values:null,vAlphabetic:on,vMathematical:on,vectorEffect:null,vHanging:on,vIdeographic:on,version:null,vertAdvY:on,vertOriginX:on,vertOriginY:on,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:on,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ow}),oC=ov({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),oS=ov({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ok}),oN=ov({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),o_=oy([ob,oj,oC,oS,oN],"html"),oM=oy([ob,oE,oC,oS,oN],"svg");var oP=e.i(63185);let oR=oI("end"),oA=oI("start");function oI(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function oD(e){return e&&"object"==typeof e?"position"in e||"type"in e?oT(e.position):"start"in e||"end"in e?oT(e):"line"in e||"column"in e?oO(e):"":""}function oO(e){return oz(e&&e.line)+":"+oz(e&&e.column)}function oT(e){return oO(e&&e.start)+"-"+oO(e&&e.end)}function oz(e){return e&&"number"==typeof e?e:1}class oL extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=oD(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}oL.prototype.file="",oL.prototype.name="",oL.prototype.reason="",oL.prototype.message="",oL.prototype.stack="",oL.prototype.column=void 0,oL.prototype.line=void 0,oL.prototype.ancestors=void 0,oL.prototype.cause=void 0,oL.prototype.fatal=void 0,oL.prototype.place=void 0,oL.prototype.ruleId=void 0,oL.prototype.source=void 0;let oB={}.hasOwnProperty,oF=new Map,o$=/[A-Z]/g,oH=new Set(["table","tbody","thead","tfoot","tr"]),oV=new Set(["td","th"]),oq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oU(e,t,n){var r,o,i,a,l,s,u,c,d;let f,h,p,m,g,x,y,v,b,w,k;return"element"===t.type?(r=e,o=t,i=n,h=f=r.schema,"svg"===o.tagName.toLowerCase()&&"html"===f.space&&(r.schema=oM),r.ancestors.push(o),p=oK(r,o.tagName,!1),m=function(e,t){let n,r,o={};for(r in t.properties)if("children"!==r&&oB.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=oc(t),r=t,o=r8;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&oh.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(of,om);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!of.test(e)){let n=e.replace(od,op);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=ou}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var o;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(o=n)[o.length-1]?[...o,""]:o).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,oP.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new oL("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=oq+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)oB.call(e,t)&&(n[function(e){let t=e.replace(o$,oZ);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?og[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&oV.has(t.tagName)?n=a:o[r]=a}}return n&&((o.style||(o.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),o}(r,o),g=oY(r,o),oH.has(o.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&r6(e.value):r6(e))})),oX(r,m,p,o),oW(m,g),r.ancestors.pop(),r.schema=f,r.create(o,p,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return rJ("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}oG(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,l=t,s=n,y=x=a.schema,"svg"===l.name&&"html"===x.space&&(a.schema=oM),a.ancestors.push(l),v=null===l.name?a.Fragment:oK(a,l.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];rJ("ExpressionStatement"===t.type);let o=t.expression;rJ("ObjectExpression"===o.type);let i=o.properties[0];rJ("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else oG(e,t.position);else{let o,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];rJ("ExpressionStatement"===t.type),o=e.evaluater.evaluateExpression(t.expression)}else oG(e,t.position);else o=null===r.value||r.value;n[i]=o}return n}(a,l),w=oY(a,l),oX(a,b,v,l),oW(b,w),a.ancestors.pop(),a.schema=x,a.create(l,v,b,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oG(e,t.position)}(e,t):"root"===t.type?(u=e,c=t,d=n,oW(k={},oY(u,c)),u.create(c,u.Fragment,k,d)):"text"===t.type?t.value:void 0}function oX(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oW(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function oY(e,t){let n=[],r=-1,o=e.passKeys?new Map:oF;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}let l=oU(e,a,i);void 0!==l&&n.push(l)}return n}function oK(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),o=-1;for(;++o<n.length;){let t=r3(n[o])?{type:"Identifier",name:n[o]}:{type:"Literal",value:n[o]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(o&&"Literal"===t.type),optional:!1}:t}rJ(e,"always a result"),r=e}else r=r3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return oB.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);oG(e)}function oG(e,t){let n=new oL("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=oq+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oZ(e){return"-"+e.toLowerCase()}let oQ={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oJ={};function o0(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return o1(e.children,t,n)}return Array.isArray(e)?o1(e,t,n):""}function o1(e,t,n){let r=[],o=-1;for(;++o<e.length;)r[o]=o0(e[o],t,n);return r.join("")}function o2(e,t,n,r){let o,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(o=Array.from(r)).unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)(o=r.slice(a,a+1e4)).unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function o5(e,t){return e.length>0?(o2(e,e.length,0,t),e):t}let o3={}.hasOwnProperty,o4=is(/[A-Za-z]/),o6=is(/[\dA-Za-z]/),o8=is(/[#-'*+\--9=?A-Z^-~]/);function o9(e){return null!==e&&(e<32||127===e)}let o7=is(/\d/),ie=is(/[\dA-Fa-f]/),it=is(/[!-/:-@[-`{-~]/);function ir(e){return null!==e&&e<-2}function io(e){return null!==e&&(e<0||32===e)}function ii(e){return -2===e||-1===e||32===e}let ia=is(/\p{P}|\p{S}/u),il=is(/\s/);function is(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function iu(e,t,n,r){let o=r?r-1:1/0,i=0;return function(r){return ii(r)?(e.enter(n),function r(a){return ii(a)&&i++<o?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let ic={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let o=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=o),t=o,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return ir(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},id={tokenize:function(e){let t,n,r,o=this,i=[],a=0;return l;function l(t){if(a<i.length){let n=i[a];return o.containerState=n[1],e.attempt(n[0].continuation,s,u)(t)}return u(t)}function s(e){if(a++,o.containerState._closeFlow){let n;o.containerState._closeFlow=void 0,t&&x();let r=o.events.length,i=r;for(;i--;)if("exit"===o.events[i][0]&&"chunkFlow"===o.events[i][1].type){n=o.events[i][1].end;break}g(a);let l=r;for(;l<o.events.length;)o.events[l][1].end={...n},l++;return o2(o.events,i+1,0,o.events.slice(r)),o.events.length=l,u(e)}return l(e)}function u(n){if(a===i.length){if(!t)return f(n);if(t.currentConstruct&&t.currentConstruct.concrete)return p(n);o.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return o.containerState={},e.check(ih,c,d)(n)}function c(e){return t&&x(),g(a),f(e)}function d(e){return o.parser.lazy[o.now().line]=a!==i.length,r=o.now().offset,p(e)}function f(t){return o.containerState={},e.attempt(ih,h,p)(t)}function h(e){return a++,i.push([o.currentConstruct,o.containerState]),f(e)}function p(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||o.parser.flow(o.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return ir(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,o.interrupt=void 0,l):(e.consume(n),t)}(r)}function m(e,i){let l=o.sliceStream(e);if(i&&l.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(l),o.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let l=o.events.length,s=l;for(;s--;)if("exit"===o.events[s][0]&&"chunkFlow"===o.events[s][1].type){if(e){n=o.events[s][1].end;break}e=!0}for(g(a),i=l;i<o.events.length;)o.events[i][1].end={...n},i++;o2(o.events,s+1,0,o.events.slice(l)),o.events.length=i}}function g(t){let n=i.length;for(;n-- >t;){let t=i[n];o.containerState=t[1],t[0].exit.call(o,e)}i.length=t}function x(){t.write([null]),n=void 0,t=void 0,o.containerState._closeFlow=void 0}}},ih={tokenize:function(e,t,n){return iu(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ip={partial:!0,tokenize:function(e,t,n){return function(t){return ii(t)?iu(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||ir(e)?t(e):n(e)}}};class im{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&ig(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ig(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ig(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);ig(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ig(this.left,t.reverse())}}}function ig(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ix(e){let t,n,r,o,i,a,l,s={},u=-1,c=new im(e);for(;++u<c.length;){for(;u in s;)u=s[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,o=e.get(t)[1],i=e.get(t)[2],a=t-1,l=[],s=o._tokenizer;!s&&(s=i.parser[o.contentType](o.start),o._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let u=s.events,c=[],d={},f=-1,h=o,p=0,m=0,g=[0];for(;h;){for(;e.get(++a)[1]!==h;);l.push(a),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=o;++f<u.length;)"exit"===u[f][0]&&"enter"===u[f-1][0]&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(m=f+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){let t=u.slice(g[f],g[f+1]),n=l.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)d[p+c[f][0]]=p+c[f][1],p+=c[f][1]-c[f][0]-1;return d}(c,u)),u=s[u],l=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(o=c.get(r))[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),o[1].type="lineEnding",n=r);else if("linePrefix"===o[1].type||"listItemIndent"===o[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(i=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,i))}}return o2(e,0,1/0,c.slice(0)),!l}let iy={resolve:function(e){return ix(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):ir(t)?e.check(iv,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},iv={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,o,"linePrefix")};function o(o){if(null===o||ir(o))return n(o);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}},ib={tokenize:function(e){let t=this,n=e.attempt(ip,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,iu(e,e.attempt(this.parser.constructs.flow,r,e.attempt(iy,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},iw={resolveAll:iC()},ik=iE("string"),ij=iE("text");function iE(e){return{resolveAll:iC("text"===e?iS:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return s(e)?o(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),l)}function l(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),l)}function s(e){if(null===e)return!0;let t=r[e],o=-1;if(t)for(;++o<t.length;){let e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function iC(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function iS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,o=e[n-1][1],i=t.sliceStream(o),a=i.length,l=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)s++,l--;if(l)break;l=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:o.start._bufferIndex+l,_index:o.start._index+a,line:o.end.line,column:o.end.column-s,offset:o.end.offset-s},end:{...o.end}};o.end={...i.start},o.start.offset===o.end.offset?Object.assign(o,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function iN(e){return null===e||io(e)||il(e)?1:ia(e)?2:void 0}function i_(e,t,n){let r=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let iM={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,l,s,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[c][1].start};iP(d,-l),iP(f,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:l>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[c][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=o5(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=o5(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),s=o5(s,i_(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=o5(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,s=o5(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,o2(e,n-1,c-n+3,s),c=n+s.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,o=this.previous,i=iN(o);return function(a){return n=a,e.enter("attentionSequence"),function a(l){if(l===n)return e.consume(l),a;let s=e.exit("attentionSequence"),u=iN(l),c=!u||2===u&&i||r.includes(l),d=!i||2===i&&u||r.includes(o);return s._open=!!(42===n?c:c&&(i||!d)),s._close=!!(42===n?d:d&&(u||!c)),t(l)}(a)}}};function iP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let iR={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return ii(t)?iu(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(iR,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return ii(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},iA={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return it(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},iI=document.createElement("i");function iD(e){let t="&"+e+";";iI.innerHTML=t;let n=iI.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let iO={name:"characterReference",tokenize:function(e,t,n){let r,o,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,o=o6,u(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=ie,u):(e.enter("characterReferenceValue"),r=7,o=o7,u(t))}function u(l){if(59===l&&a){let r=e.exit("characterReferenceValue");return o!==o6||iD(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return o(l)&&a++<r?(e.consume(l),u):n(l)}}},iT={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},iz={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,o=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),ii(t)?iu(e,s,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(o){return o===r?(i++,e.consume(o),t):i>=l?(e.exit("codeFencedFenceSequence"),ii(o)?iu(e,u,"whitespace")(o):u(o)):n(o)}(t)):n(t)}function u(r){return null===r||ir(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,l=0;return function(t){var i;let u;return i=t,a=(u=o.events[o.events.length-1])&&"linePrefix"===u[1].type?u[2].sliceSerialize(u[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(o){return o===r?(l++,e.consume(o),t):l<3?n(o):(e.exit("codeFencedFenceSequence"),ii(o)?iu(e,s,"whitespace")(o):s(o))}(i)};function s(i){return null===i||ir(i)?(e.exit("codeFencedFence"),o.interrupt?t(i):e.check(iT,c,p)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(o){return null===o||ir(o)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(o)):ii(o)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),iu(e,u,"whitespace")(o)):96===o&&o===r?n(o):(e.consume(o),t)}(i))}function u(t){return null===t||ir(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(o){return null===o||ir(o)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(o)):96===o&&o===r?n(o):(e.consume(o),t)}(t))}function c(t){return e.attempt(i,p,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return a>0&&ii(t)?iu(e,h,"linePrefix",a+1)(t):h(t)}function h(t){return null===t||ir(t)?e.check(iT,c,p)(t):(e.enter("codeFlowValue"),function t(n){return null===n||ir(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function p(n){return e.exit("codeFenced"),t(n)}}},iL={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),iu(e,o,"linePrefix",5)(t)};function o(t){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?function t(n){return null===n?i(n):ir(n)?e.attempt(iB,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||ir(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},iB={partial:!0,tokenize:function(e,t,n){let r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):iu(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):ir(e)?o(e):n(e)}}};function iF(e,t,n,r,o,i,a,l,s){let u=s||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||o9(t)?n(t):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),p(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(l),d(t)):null===t||60===t||ir(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(o){return!c&&(null===o||41===o||io(o))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(o)):c<u&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||o9(o)?n(o):(e.consume(o),92===o?m:p)}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function i$(e,t,n,r,o,i){let a,l=this,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):ir(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||ir(t)||s++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a||(a=!ii(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function iH(e,t,n,r,o,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,l):n(t)};function l(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),l(a)):null===t?n(t):ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||ir(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function iV(e,t){let n;return function r(o){return ir(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ii(o)?iu(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function iq(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let iU={partial:!0,tokenize:function(e,t,n){return function(t){return io(t)?iV(e,r)(t):n(t)};function r(t){return iH(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ii(t)?iu(e,i,"whitespace")(t):i(t)}function i(e){return null===e||ir(e)?t(e):n(e)}}},iX=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],iW=["pre","script","style","textarea"],iY={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ip,t,n)}}},iK={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},iG={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&o2(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,i,a=e.length,l=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){l=2;break}}else"labelEnd"===n.type&&(o=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+l+2][1].end},end:{...e[o-2][1].start}};return i=o5(i=[["enter",s,t],["enter",u,t]],e.slice(r+1,r+l+3)),i=o5(i,[["enter",c,t]]),i=o5(i,i_(t.parser.constructs.insideSpan.null,e.slice(r+l+4,o-3),t)),i=o5(i,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),i=o5(i,e.slice(o+1)),i=o5(i,[["exit",s,t]]),o2(e,r,e.length,i),e},tokenize:function(e,t,n){let r,o,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?c(t):(o=i.parser.defined.includes(iq(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),l):n(t)};function l(t){return 40===t?e.attempt(iZ,u,o?u:c)(t):91===t?e.attempt(iQ,u,o?s:c)(t):o?u(t):c(t)}function s(t){return e.attempt(iJ,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},iZ={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return io(t)?iV(e,o)(t):o(t)}function o(t){return 41===t?u(t):iF(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return io(t)?iV(e,l)(t):u(t)}function a(e){return n(e)}function l(t){return 34===t||39===t||40===t?iH(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function s(t){return io(t)?iV(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},iQ={tokenize:function(e,t,n){let r=this;return function(t){return i$.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(iq(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},iJ={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},i0={name:"labelStartImage",resolveAll:iG.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},i1={name:"labelStartLink",resolveAll:iG.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},i2={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),iu(e,t,"linePrefix")}}},i5={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),o++,t):(e.exit("thematicBreakSequence"),ii(n)?iu(e,i,"whitespace")(n):i(n))}(a)):o>=3&&(null===a||ir(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},i3={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ip,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,iu(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ii(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i6,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,iu(e,e.attempt(i3,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){let o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:o7(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(i5,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(o){return o7(o)&&++a<10?(e.consume(o),t):(!r.interrupt||a<2)&&(r.containerState.marker?o===r.containerState.marker:41===o||46===o)?(e.exit("listItemValue"),l(o)):n(o)}(t)}return n(t)};function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(ip,r.interrupt?n:s,e.attempt(i4,c,u))}function s(e){return r.containerState.initialBlankLine=!0,i++,c(e)}function u(t){return ii(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},i4={partial:!0,tokenize:function(e,t,n){let r=this;return iu(e,function(e){let o=r.events[r.events.length-1];return!ii(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},i6={partial:!0,tokenize:function(e,t,n){let r=this;return iu(e,function(e){let o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},i8={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,o=this;return function(t){var a;let l,s=o.events.length;for(;s--;)if("lineEnding"!==o.events[s][1].type&&"linePrefix"!==o.events[s][1].type&&"content"!==o.events[s][1].type){l="paragraph"===o.events[s][1].type;break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),ii(n)?iu(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||ir(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,o=this;return function(t){var r;return e.enter("definition"),r=t,i$.call(o,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=iq(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return io(t)?iV(e,l)(t):l(t)}function l(t){return iF(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(iU,u,u)(t)}function u(t){return ii(t)?iu(e,c,"whitespace")(t):c(t)}function c(i){return null===i||ir(i)?(e.exit("definition"),o.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:i3,43:i3,45:i3,48:i3,49:i3,50:i3,51:i3,52:i3,53:i3,54:i3,55:i3,56:i3,57:i3,62:iR},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},o2(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(o){var i;return e.enter("atxHeading"),i=o,e.enter("atxHeadingSequence"),function o(i){return 35===i&&r++<6?(e.consume(i),o):null===i||io(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||ir(r)?(e.exit("atxHeading"),t(r)):ii(r)?iu(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||io(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:i5,45:[i8,i5],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,o,i,a,l,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),u};function u(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),o=!0,h):63===a?(e.consume(a),r=3,s.interrupt?t:A):o4(a)?(e.consume(a),i=String.fromCharCode(a),p):n(a)}function c(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,a=0,f):o4(o)?(e.consume(o),r=4,s.interrupt?t:A):n(o)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:A):n(r)}function f(r){let o="CDATA[";return r===o.charCodeAt(a++)?(e.consume(r),a===o.length)?s.interrupt?t:E:f:n(r)}function h(t){return o4(t)?(e.consume(t),i=String.fromCharCode(t),p):n(t)}function p(a){if(null===a||47===a||62===a||io(a)){let l=47===a,u=i.toLowerCase();return!l&&!o&&iW.includes(u)?(r=1,s.interrupt?t(a):E(a)):iX.includes(i.toLowerCase())?(r=6,l)?(e.consume(a),m):s.interrupt?t(a):E(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):o?function t(n){return ii(n)?(e.consume(n),t):k(n)}(a):g(a))}return 45===a||o6(a)?(e.consume(a),i+=String.fromCharCode(a),p):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:E):n(r)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||o4(t)?(e.consume(t),x):ii(t)?(e.consume(t),g):k(t)}function x(t){return 45===t||46===t||58===t||95===t||o6(t)?(e.consume(t),x):y(t)}function y(t){return 61===t?(e.consume(t),v):ii(t)?(e.consume(t),y):g(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,b):ii(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||io(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===l?(e.consume(t),l=null,w):null===t||ir(t)?n(t):(e.consume(t),b)}function w(e){return 47===e||62===e||ii(e)?g(e):n(e)}function k(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||ir(t)?E(t):ii(t)?(e.consume(t),j):n(t)}function E(t){return 45===t&&2===r?(e.consume(t),_):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),I):63===t&&3===r?(e.consume(t),A):93===t&&5===r?(e.consume(t),R):ir(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(iY,D,C)(t)):null===t||ir(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),E)}function C(t){return e.check(iK,S,D)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||ir(t)?C(t):(e.enter("htmlFlowData"),E(t))}function _(t){return 45===t?(e.consume(t),A):E(t)}function M(t){return 47===t?(e.consume(t),i="",P):E(t)}function P(t){if(62===t){let n=i.toLowerCase();return iW.includes(n)?(e.consume(t),I):E(t)}return o4(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),P):E(t)}function R(t){return 93===t?(e.consume(t),A):E(t)}function A(t){return 62===t?(e.consume(t),I):45===t&&2===r?(e.consume(t),A):E(t)}function I(t){return null===t||ir(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),I)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:i8,95:i5,96:iz,126:iz},"flowInitial",0,{[-2]:iL,[-1]:iL,32:iL},"insideSpan",0,{null:[iM,iw]},"string",0,{38:iO,92:iA},"text",0,{[-5]:i2,[-4]:i2,[-3]:i2,33:i0,38:iO,42:iM,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return o4(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(t){return 43===t||45===t||46===t||o6(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||o6(n))&&r++<32?(e.consume(n),t):(r=0,l(n))}(t)):l(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||o9(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),s):o8(t)?(e.consume(t),l):n(t)}function s(o){return o6(o)?function o(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||o6(i))&&r++<63){let n=45===i?t:o;return e.consume(i),n}return n(i)}(i)}(o):n(o)}}},{name:"htmlText",tokenize:function(e,t,n){let r,o,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),b):63===t?(e.consume(t),y):o4(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),o=0,h):o4(t)?(e.consume(t),x):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):ir(t)?(i=c,P(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?M(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(o++)?(e.consume(t),o===r.length?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):ir(t)?(i=p,P(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?M(t):93===t?(e.consume(t),g):p(t)}function x(t){return null===t||62===t?M(t):ir(t)?(i=x,P(t)):(e.consume(t),x)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):ir(t)?(i=y,P(t)):(e.consume(t),y)}function v(e){return 62===e?M(e):y(e)}function b(t){return o4(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||o6(t)?(e.consume(t),w):function t(n){return ir(n)?(i=t,P(n)):ii(n)?(e.consume(n),t):M(n)}(t)}function k(t){return 45===t||o6(t)?(e.consume(t),k):47===t||62===t||io(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),M):58===t||95===t||o4(t)?(e.consume(t),E):ir(t)?(i=j,P(t)):ii(t)?(e.consume(t),j):M(t)}function E(t){return 45===t||46===t||58===t||95===t||o6(t)?(e.consume(t),E):function t(n){return 61===n?(e.consume(n),C):ir(n)?(i=t,P(n)):ii(n)?(e.consume(n),t):j(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):ir(t)?(i=C,P(t)):ii(t)?(e.consume(t),C):(e.consume(t),N)}function S(t){return t===r?(e.consume(t),r=void 0,_):null===t?n(t):ir(t)?(i=S,P(t)):(e.consume(t),S)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||io(t)?j(t):(e.consume(t),N)}function _(e){return 47===e||62===e||io(e)?j(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return ii(t)?iu(e,A,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return e.enter("htmlTextData"),i(t)}}}],91:i1,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return ir(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},iA],93:iG,95:iM,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(("lineEnding"===e[3][1].type||"space"===e[o][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(o=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(o.type="codeTextData",l(a))}(s)):ir(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(s))}function l(t){return null===t||32===t||96===t||ir(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}}}}],19210);var i9=e.i(19210);let i7=/[\0\t\n\r]/g;function ae(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let at=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function an(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return ae(n.slice(t?2:1),t?16:10)}return iD(n)||e}let ar={}.hasOwnProperty;function ao(e){return{line:e.line,column:e.column,offset:e.offset}}function ai(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+oD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oD({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+oD({start:t.start,end:t.end})+") is still open")}function aa(e){let t=this;t.parser=function(n){var r,o;let i,a,l,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(o=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(p),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(h,o),codeText:r(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,o),htmlFlowData:u,htmlText:r(g,o),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(p),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=ae(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=iD(n);let o=this.stack[this.stack.length-1];o.value+=t},characterReference:function(e){this.stack.pop().position.end=ao(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iq(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(at,an),n.identifier=iq(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=ao(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),c.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iq(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let o=n[r];Array.isArray(o)?e(t,o):function(e,t){let n;for(n in t)if(ar.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,o)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:l,buffer:o,resume:s,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,o,i,a,l=t-1,s=-1,u=!1;for(;++l<=n;){let t=e[l];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=l;for(o=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||l,0,["exit",r,t[2]]),l++,n++}if("listItemPrefix"===t[1].type){let o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(l,0,["enter",o,t[2]]),l++,n++,i=void 0,a=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];ar.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},a),e[c][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ai).call(a,void 0,e[0])}for(r.position={start:ao(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ao(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ao(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ai).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+oD({start:e.start,end:e.end})+"): it’s not open");n.position.end=ao(e.end)}function s(){var e;return e=this.stack.pop(),o0(e,"boolean"!=typeof oJ.includeImageAlt||oJ.includeImageAlt,"boolean"!=typeof oJ.includeHtml||oJ.includeHtml)}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:ao(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ao(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function p(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(o)(function(e){for(;!ix(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,o=(o3.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){o3.call(o,r)||(o[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);o2(e,0,0,r)}(o[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([i9,...(e||{}).extensions||[]]),content:n(ic),defined:[],document:n(id),flow:n(ib),lazy:{},string:n(ik),text:n(ij)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},o={},i=[],a=[],l=[],s={attempt:p(function(e,t){m(e,t.from)}),check:p(h),consume:function(e){ir(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),l.push(n),n},exit:function(e){let t=l.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:p(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,o=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,o.push(i)}return o.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=o5(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==a[a.length-1])?[]:(m(t,0),u.events=i_(i,u.events,u),u.events)}},c=t.tokenize.call(u,s);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){let n,r=t.start._index,o=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(o,a)];else{if(n=e.slice(r,i),o>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(o):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function f(){let{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(e,t){t.restore()}function p(e,t){return function(n,o,i){var a;let c,d,h,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(c=e,d=0,0===e.length)?i:x(e[d])}function x(e){return function(n){let o,i,a,c,d;return(o=f(),i=u.previous,a=u.currentConstruct,c=u.events.length,d=Array.from(l),p={from:c,restore:function(){r=o,u.previous=i,u.currentConstruct=a,u.events.length=c,l=d,g()}},h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,s,y,v)(n)}}function y(t){return e(h,p),o}function v(e){return(p.restore(),++d<c.length)?x(c[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&o2(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function g(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}(t,e,n)}}})(o).document().write((a=1,l="",s=!0,function(e,t,n){let r,o,u,c,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,l="",s&&(65279===e.charCodeAt(0)&&u++,s=void 0);u<e.length;){if(i7.lastIndex=u,c=(r=i7.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){l=e.slice(u);break}if(10===d&&u===c&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),u<c&&(f.push(e.slice(u,c)),a+=c-u),d){case 0:f.push(65533),a++;break;case 9:for(o=4*Math.ceil(a/4),f.push(-2);a++<o;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:i=!0,a=1}u=c+1}return n&&(i&&f.push(-5),l&&f.push(l),f.push(null)),f})(n,r,!0))))}}let al="object"==typeof self?self:globalThis,as=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=o=>{if(t.has(o))return t.get(o);let[i,a]=e[o];switch(i){case 0:case -1:return n(a,o);case 1:{let e=n([],o);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},o);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{let e=n(new Map,o);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,o);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new al[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new al[i](a),o)})(0)},{toString:au}={},{keys:ac}=Object,ad=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=au.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},af=([e,t])=>0===e&&("function"===t||"symbol"===t),ah=(e,{json:t,lossy:n}={})=>{var r,o,i;let a,l,s=[];return(r=!(t||n),o=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},l=e=>{if(i.has(e))return i.get(e);let[t,n]=ad(e);switch(t){case 0:{let o=e;switch(n){case"bigint":t=8,o=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);o=null;break;case"undefined":return a([-1],e)}return a([t,o],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],o=a([t,r],e);for(let t of e)r.push(l(t));return o}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(o&&"toJSON"in e)return l(e.toJSON());let i=[],s=a([t,i],e);for(let t of ac(e))(r||!af(ad(e[t])))&&i.push([l(t),l(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],o=a([t,n],e);for(let[t,o]of e)(r||!(af(ad(t))||af(ad(o))))&&n.push([l(t),l(o)]);return o}case 6:{let n=[],o=a([t,n],e);for(let t of e)(r||!af(ad(t)))&&n.push(l(t));return o}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},ap="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?as(ah(e,t)):structuredClone(e):(e,t)=>as(ah(e,t));function am(e){let t=[],n=-1,r=0,o=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&o6(e.charCodeAt(n+1))&&o6(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ag(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ax(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let ay=function(e){var t,n;if(null==e)return ab;if("function"==typeof e)return av(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ay(e[n]);return av(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,av(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,av(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function av(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function ab(){return!0}let aw=[];function ak(e,t,n,r){var o,i,a;let l,s,u,c,d,f;"function"==typeof t&&"function"!=typeof n?(s=void 0,u=t,l=n):(s=t,u=n,l=r),o=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return u(e,r,n)},a=l,"function"==typeof o&&"function"!=typeof i?(a=i,i=o):c=o,d=ay(c),f=a?-1:1,(function e(t,n,r){let l=t&&"object"==typeof t?t:{};if("string"==typeof l.type){let e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var l;let s,u,c,h=aw;if((!o||d(t,n,r[r.length-1]||void 0))&&!1===(h=Array.isArray(l=i(t,r))?l:"number"==typeof l?[!0,l]:null==l?aw:[l])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(u=(a?t.children.length:-1)+f,c=r.concat(t);u>-1&&u<t.children.length;){if(!1===(s=e(t.children[u],u,c)())[0])return s;u="number"==typeof s[1]?s[1]:u+f}return h}})(e,void 0,[])()}function aj(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});let a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function aE(e){let t=e.spread;return null==t?e.children.length>1:t}function aC(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}let aS={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",o=String(t.identifier).toUpperCase(),i=am(o.toLowerCase()),a=e.footnoteOrder.indexOf(o),l=e.footnoteCounts.get(o);void 0===l?(l=0,e.footnoteOrder.push(o),n=e.footnoteOrder.length):n=a+1,l+=1,e.footnoteCounts.set(o,l);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aj(e,t);let o={src:am(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);let i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:am(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aj(e,t);let o={href:am(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);let i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:am(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=aE(n[r])}return t}(n):aE(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<r.length;){let e=r[l];(o||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){let e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),o=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=oA(t.children[1]),a=oR(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,l=-1,s=[];for(;++l<a;){let n=t.children[l],r={},a=i?i[l]:void 0;a&&(r.align=a);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),s.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),o=0,i=[];for(;r;)i.push(aC(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(aC(t.slice(o),o>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:aN,yaml:aN,definition:aN,footnoteDefinition:aN};function aN(){}let a_={}.hasOwnProperty,aM={};function aP(e,t){e.position&&(t.position=function(e){let t=oA(e),n=oR(e);if(t&&n)return{start:t,end:n}}(e))}function aR(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&o&&Object.assign(n.properties,ap(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function aA(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function aI(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function aD(e,t){let n,r,o,i,a=(n=t||aM,r=new Map,o=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let o=i.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=aI(o.value)),!Array.isArray(o)&&"element"===o.type)){let e=o.children[0];e&&"text"===e.type&&(e.value=aI(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:aR,definitionById:r,footnoteById:o,footnoteCounts:new Map,footnoteOrder:[],handlers:{...aS,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(a_.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=ap(n);return r.children=i.all(e),r}return ap(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(a_.call(n,"hProperties")||a_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:aP,wrap:aA},ak(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),l=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ag,r=e.options.footnoteBackLabel||ax,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],s=-1;for(;++s<e.footnoteOrder.length;){let o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;let i=e.all(o),a=String(o.identifier).toUpperCase(),u=am(a.toLowerCase()),c=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(o,p),l.push(p)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ap(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&(rJ("children"in u),u.children.push({type:"text",value:"\n"},s)),u}function aO(e,t){return e&&"run"in e?async function(n,r){let o=aD(n,{file:r,...t});await e.run(o,r)}:function(n,r){return aD(n,{file:r,...e||t})}}function aT(e){if(e)throw e}var az=e.i(75609);function aL(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let aB=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');aV(e);let r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(o=i):(l=-1,o=a));return r===o?o=a:o<0&&(o=e.length),e.slice(r,o)},aF=function(e){let t;if(aV(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},a$=function(e){let t;aV(e);let n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){let l=e.codePointAt(n);if(47===l){if(t){o=n+1;break}continue}r<0&&(t=!0,r=n+1),46===l?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===o+1?"":e.slice(i,r)},aH=function(...e){var t;let n,r,o,i=-1;for(;++i<e.length;)aV(e[i]),e[i]&&(o=void 0===o?e[i]:o+"/"+e[i]);return void 0===o?".":(aV(t=o),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,o="",i=0,a=-1,l=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===l);else if(a!==s-1&&2===l){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2)){if(o.length>2){if((r=o.lastIndexOf("/"))!==o.length-1){r<0?(o="",i=0):i=(o=o.slice(0,r)).length-1-o.lastIndexOf("/"),a=s,l=0;continue}}else if(o.length>0){o="",i=0,a=s,l=0;continue}}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,s):o=e.slice(a+1,s),i=s-a-1;a=s,l=0}else 46===n&&l>-1?l++:l=-1}return o}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function aV(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function aq(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let aU=["history","path","basename","stem","extname","dirname"];class aX{constructor(e){let t,n;t=e?aq(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<aU.length;){const e=aU[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)aU.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?aB(this.path):void 0}set basename(e){aY(e,"basename"),aW(e,"basename"),this.path=aH(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?aF(this.path):void 0}set dirname(e){aK(this.basename,"dirname"),this.path=aH(e||"",this.basename)}get extname(){return"string"==typeof this.path?a$(this.path):void 0}set extname(e){if(aW(e,"extname"),aK(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=aH(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){aq(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!aq(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),aY(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?aB(this.path,this.extname):void 0}set stem(e){aY(e,"stem"),aW(e,"stem"),this.path=aH(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new oL(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function aW(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function aY(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function aK(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let aG=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},aZ={}.hasOwnProperty;class aQ extends aG{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function o(i,...a){let l=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,l?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(o,r):i instanceof Error?r(i):o(i))};function r(e,...o){n||(n=!0,t(e,...o))}function o(e){r(null,e)}})(l,o)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new aQ,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,az.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(a2("data",this.frozen),this.namespace[e]=t,this):aZ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(a2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=a4(e),n=this.parser||this.Parser;return a0("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),a0("process",this.parser||this.Parser),a1("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){let i=a4(e),a=n.parse(i);function l(e,n){e||!n?o(e):r?r(n):(rJ(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var o,i;if(e||!t||!r)return l(e);let a=n.stringify(t,r);"string"==typeof(o=a)||(i=o)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,l(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),a0("processSync",this.parser||this.Parser),a1("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,aT(e),t=r}),a3("processSync","process",n),rJ(t,"we either bailed on an error or have a tree"),t}run(e,t,n){a5(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){rJ("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=a4(t);r.run(e,a,function(t,r,a){let l=r||e;t?i(t):o?o(l):(rJ(n,"`done` is defined if `resolve` is not"),n(void 0,l,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){aT(e),n=t,r=!0}),a3("runSync","run",r),rJ(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=a4(t),r=this.compiler||this.Compiler;return a1("stringify",r),a5(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(a2("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function o(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,az.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else o(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[o][1];aL(a)&&aL(r)&&(r=(0,az.default)(!0,a,r)),n[o]=[e,r,...i]}}}}let aJ=new aQ().freeze();function a0(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function a1(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function a2(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function a5(e){if(!aL(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function a3(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function a4(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new aX(e)}let a6=[],a8={allowDangerousHtml:!0},a9=/^(https?|ircs?|mailto|xmpp)$/i,a7=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function le(e){var n;let r,o,i,a,l,s=(r=(n=e).rehypePlugins||a6,o=n.remarkPlugins||a6,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...a8}:a8,aJ().use(aa).use(o).use(aO,i).use(r)),u=(a=e.children||"",l=new aX,"string"==typeof a?l.value=a:r0("Unexpected value `"+a+"` for `children` prop, expected `string`"),l);return function(e,n){let r=n.allowedElements,o=n.allowElement,i=n.components,a=n.disallowedElements,l=n.skipHtml,s=n.unwrapDisallowed,u=n.urlTransform||lt;for(let e of a7)Object.hasOwn(n,e.from)&&r0("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&r0("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),ak(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return l?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in oQ)if(Object.hasOwn(oQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=oQ[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&o&&"number"==typeof t&&(i=!o(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,o,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=l,r=t.jsxDEV,a=function(e,t,o,i){let a=Array.isArray(o.children),l=oA(e);return r(t,o,i,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");o=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:o;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?oM:o_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=oU(s,e,void 0);return u&&"string"!=typeof u?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(u),u),e)}function lt(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return -1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||a9.test(e.slice(0,t))?e:""}let ln=(0,s.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),lr=(0,s.default)("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"}]]),lo={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function li({decision:e,index:n}){let[o,i]=(0,r.useState)(!1),a=(0,eW.useSoundAction)("expand"),l=(0,eW.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(eK.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(le,{components:lo,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{o?l.play():a.play(),i(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(nD,{className:`h-3.5 w-3.5 transition-transform ${o?"rotate-90":""}`}),(0,t.jsx)(lr,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),o?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function la({data:e,onApprove:n,onReject:r,isProcessing:o=!1,isRejecting:i=!1}){let{summary:a,decisions:l}=e;return 0===l.length?null:(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),a?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:a}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(ln,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),l.map((e,n)=>(0,t.jsx)(li,{decision:e,index:n},e.title))]}),(0,t.jsx)(rZ,{onReject:r,onApprove:n,approveLabel:"Approve Plan",approveIcon:(0,t.jsx)(e4.Check,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:o,isRejecting:i})]})}let ll=(0,s.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ls=(0,s.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var lu=e.i(49228);let lc=(0,s.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function ld({phases:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(lr,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Implementation Phases"})]}),(0,t.jsx)("ol",{className:"space-y-2",children:e.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-emerald-100 text-[10px] font-bold text-emerald-700",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px] leading-relaxed",children:e.description}):null]})]},e.id))})]})})}function lf({data:e,onApprove:n,onReject:r,isProcessing:o=!1,isRejecting:i=!1}){let{pr:a,diffSummary:l,phases:s,branch:u,warning:c}=e;return(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:a?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),u?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(lu.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(eK.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:u.source}),(0,t.jsx)(lc,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(eK.Badge,{variant:"outline",className:"font-mono text-[11px]",children:u.target})]})}):null,a?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",a.number,(0,t.jsx)(eB.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eK.Badge,{variant:"outline",className:"text-xs",children:a.status})]}),a.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(e2,{status:a.ciStatus})]}):null,a.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eF,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a.commitHash.slice(0,7)})]})]}):null]})}):null,l?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(ls,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:l.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",l.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",l.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:l.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(ll,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:c})]})}):null,s&&s.length>0?(0,t.jsx)(ld,{phases:s}):null]}),(0,t.jsx)(rZ,{onReject:r,onApprove:n,approveLabel:"Approve Merge",approveIcon:o?(0,t.jsx)(ee.Loader2,{className:"mr-1.5 h-4 w-4 animate-spin"}):(0,t.jsx)(f,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:o,isRejecting:i})]})}function lh({view:e,onClose:n,onDelete:o,isDeleting:a,onCreateSubmit:l,isSubmitting:s}){let u,[c,d]=(0,r.useState)(null),[f,m]=(0,r.useState)({}),[g,x]=(0,r.useState)(!1),[y,v]=(0,r.useState)(null),[b,w]=(0,r.useState)(!1),[k,j]=(0,r.useState)(null),[E,C]=(0,r.useState)(!1),[S,N]=(0,r.useState)(!1),_=(0,eW.useSoundAction)("reject"),M=e?.type==="prd-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(m({}),d(null),!M)return;let e=!1;return x(!0),eq(M).then(t=>{if(!e){if(t.error)return void eL.toast.error(t.error);if(t.questionnaire){d(t.questionnaire);let e={};for(let n of t.questionnaire.questions){let t=n.options.find(e=>e.recommended);t&&(e[n.id]=t.id)}m(e)}}}).catch(()=>{e||eL.toast.error("Failed to load questionnaire")}).finally(()=>{e||x(!1)}),()=>{e=!0}},[M]);let P=e?.type==="tech-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(v(null),!P)return;let e=!1;return w(!0),eU(P).then(t=>{if(!e){if(t.error)return void eL.toast.error(t.error);t.techDecisions&&v(t.techDecisions)}}).catch(()=>{e||eL.toast.error("Failed to load tech decisions")}).finally(()=>{e||w(!1)}),()=>{e=!0}},[P]);let R=e?.type==="merge-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(j(null),!R)return;let e=!1;return C(!0),eX(R).then(t=>{if(!e){if("error"in t)return void eL.toast.error(t.error);j(t)}}).catch(()=>{e||eL.toast.error("Failed to load merge review data")}).finally(()=>{e||C(!1)}),()=>{e=!0}},[R]);let A=e?.type==="prd-review"||e?.type==="tech-review"||e?.type==="merge-review"?e.node:null,I=(0,r.useCallback)(async(e,t,r)=>{if(A?.featureId){N(!0);try{let o=await eV(A.featureId,e);if(!o.rejected)return void eL.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);_.play(),eL.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&eL.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),n(),r?.()}finally{N(!1)}}},[A,n,_]),D=(0,r.useCallback)(e=>I(e,"Requirements",()=>m({})),[I]),O=(0,r.useCallback)(e=>I(e,"Plan"),[I]),T=(0,r.useCallback)(e=>I(e,"Merge"),[I]),z=(0,r.useCallback)(async e=>{if(!A?.featureId)return;let t=await eH(A.featureId);t.approved?(eL.toast.success(`${e} approved — agent resuming`),n()):eL.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[A,n]),L=(0,r.useCallback)(async t=>{let r;if(e?.type!=="prd-review")return;if(c){let e=[];for(let[t,n]of Object.entries(f)){let r=c.questions.find(e=>e.id===t),o=r?.options.find(e=>e.id===n);r&&o&&e.push({questionId:r.question,selectedOption:o.label})}r={approved:!0,changedSelections:e}}let o=await eH(e.node.featureId,r);o.approved?(eL.toast.success("Requirements approved — agent resuming"),m({}),n()):eL.toast.error(o.error??"Failed to approve requirements")},[e,c,f,n]),B=(0,r.useCallback)(()=>z("Plan"),[z]),F=(0,r.useCallback)(()=>z("Merge"),[z]),$=e?.type==="feature-create",q=$?e:null,U=e?.type==="feature"||e?.type==="prd-review"||e?.type==="tech-review"||e?.type==="merge-review"?e.node:null,et=e?.type==="repository"?e.data:null,en=U?.repositoryPath&&U?.branch?{repositoryPath:U.repositoryPath,branch:U.branch,specPath:U.specPath}:null,er=function(e){let[t,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=p.current,t=m.current,n=g.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),n&&clearTimeout(n)}},[]);let x=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,r.useCallback)(()=>x(e_,n,u,p,t),[x,t]),openInShell:(0,r.useCallback)(()=>x(eM,i,d,m,o),[x,o]),openSpecsFolder:(0,r.useCallback)(async()=>{if(e?.specPath&&!a){g.current&&clearTimeout(g.current),l(!0),h(null);try{let t=await eP(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";h(e),g.current=setTimeout(()=>h(null),5e3)}}catch(e){h(e instanceof Error?e.message:"An unexpected error occurred"),g.current=setTimeout(()=>h(null),5e3)}finally{l(!1)}}},[e,a]),ideLoading:t,shellLoading:o,specsLoading:a,ideError:s,shellError:c,specsError:f}}(en),eo=eR(et?.repositoryPath?{repositoryPath:et.repositoryPath}:null),ea=U?.repositoryPath&&U.branch?{targetId:U.featureId,targetType:"feature",repositoryPath:U.repositoryPath,branch:U.branch}:null,es=et?.repositoryPath?{targetId:et.repositoryPath,targetType:"repository",repositoryPath:et.repositoryPath}:void 0,eu=(0,eC.useDeployAction)(ea),ec="Booting"===eu.status||"Ready"===eu.status;U?u=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-header",children:[(0,t.jsx)(eI.DrawerTitle,{children:U.name}),U.description?(0,t.jsx)(eI.DrawerDescription,{children:U.description}):U.featureId?(0,t.jsx)(eI.DrawerDescription,{className:"sr-only",children:U.featureId}):null]}),en?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,t.jsx)(nH,{actions:er,repositoryPath:en.repositoryPath,showSpecs:!!en.specPath}),eS.featureFlags.envDeploy&&ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(ej.ActionButton,{label:ec?"Stop Dev Server":"Start Dev Server",onClick:ec?eu.stop:eu.deploy,loading:eu.deployLoading||eu.stopLoading,error:!!eu.deployError,icon:ec?ek.Square:ew.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(J.TooltipContent,{children:ec?"Stop Dev Server":"Start Dev Server"})]})}),ec?(0,t.jsx)(eE.DeploymentStatusBadge,{status:eu.status,url:eu.url}):null]}):null,o&&U.featureId?(0,t.jsxs)(H,{children:[(0,t.jsx)(V,{asChild:!0,children:(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:a,className:"text-muted-foreground hover:text-destructive ml-auto","data-testid":"feature-drawer-delete",children:a?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(h,{className:"size-4"})})}),(0,t.jsxs)(X,{children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Delete feature?"}),(0,t.jsxs)(G,{children:["This will permanently delete ",(0,t.jsx)("strong",{children:U.name})," (",U.featureId,"). This action cannot be undone.","running"===U.state?(0,t.jsx)(t.Fragment,{children:" This feature has a running agent that will be stopped."}):null]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{disabled:a,children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",disabled:a,onClick:()=>o(U.featureId),children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting…"]}):"Delete"})]})]})]}):null]}):null]}):et&&(u=(0,t.jsxs)("div",{"data-testid":"repository-drawer-header",children:[(0,t.jsx)(eI.DrawerTitle,{children:et.name}),et.repositoryPath?(0,t.jsx)(eI.DrawerDescription,{className:"truncate font-mono text-xs",children:et.repositoryPath}):null]}));let ed=null;return e?.type==="feature"&&U?ed=(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:ei[U.lifecycle]}),(0,t.jsx)(lp,{data:U}),U.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[U.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all",el[U.state].progressClass),style:{width:`${U.progress}%`}})})]}):null]}),U.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsx)(lg,{pr:U.pr})]}):null,(0,t.jsx)(lx,{data:U})]}):e?.type==="prd-review"?ed=c?(0,t.jsx)(rQ,{data:c,selections:f,onSelect:(e,t)=>m(n=>({...n,[e]:t})),onApprove:L,onReject:D,isProcessing:g,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="tech-review"?ed=y?(0,t.jsx)(la,{data:y,onApprove:B,onReject:O,isProcessing:b,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="merge-review"?ed=k?(0,t.jsx)(lf,{data:k,onApprove:F,onReject:T,isProcessing:E,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="repository"&&et?.repositoryPath&&(ed=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"OPEN WITH"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(ej.ActionButton,{label:"Open in IDE",onClick:eo.openInIde,loading:eo.ideLoading,error:!!eo.ideError,icon:ey,variant:"outline",size:"sm"}),(0,t.jsx)(ej.ActionButton,{label:"Open in Shell",onClick:eo.openInShell,loading:eo.shellLoading,error:!!eo.shellError,icon:ev.Terminal,variant:"outline",size:"sm"}),(0,t.jsx)(ej.ActionButton,{label:"Open Folder",onClick:eo.openFolder,loading:eo.folderLoading,error:!!eo.folderError,icon:eb.FolderOpen,variant:"outline",size:"sm"})]})]})]})),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eY.BaseDrawer,{open:null!==e&&!$,onClose:n,size:"md",modal:!1,header:u,deployTarget:es,"data-testid":e?.type==="feature"?"feature-drawer":e?.type==="repository"?"repository-drawer":"review-drawer",children:ed}),(0,t.jsx)(rq,{open:$,onClose:n,onSubmit:l,repositoryPath:q?.repositoryPath??"",features:q?.features??[],workflowDefaults:q?.workflowDefaults,initialParentId:q?.initialParentId,isSubmitting:s})]})}function lp({data:e}){let n=el[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(eJ,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}let lm={[e$.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[e$.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[e$.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function lg({pr:e}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",className:"border-border mx-4 rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(eB.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eK.Badge,{className:lm[e.status],children:e.status})]}),e.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(e2,{status:e.ciStatus})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eF,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function lx({data:e}){return e.agentType??e.runtime??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.agentType?(0,t.jsx)(ly,{label:"Agent",value:e.agentType}):null,e.runtime?(0,t.jsx)(ly,{label:"Runtime",value:e.runtime}):null,e.blockedBy?(0,t.jsx)(ly,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(ly,{label:"Error",value:e.errorMessage}):null]})]}):null}function ly({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}let lv=(0,s.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var lb=e.i(60253);let lw="shep:notification-banner-dismissed";function lk(){let[e,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(lw)&&n(!0)},[]);let o=(0,r.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&n(!1)},[]),a=(0,r.useCallback)(()=>{localStorage.setItem(lw,"true"),n(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(lv,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(i.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-xs",onClick:a,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(lb.X,{})})]})]}):null}let lj=(0,eN.createServerReference)("007efbf78a113f3482394b5e8f8001bde6bdc43bc9",eN.callServer,void 0,eN.findSourceMapURL,"getWorkflowDefaults");var lE=e.i(5147);let lC=(0,s.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var lS=e.i(78986);let lN=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function l_({onRepositorySelect:e,className:n}){let[i,a]=(0,r.useState)(!1),[l,s]=(0,r.useState)(!1);async function u(){if(!l){s(!0);try{let t=await (0,lS.pickFolder)();t&&e?.(t)}finally{s(!1)}}}let c=(0,r.useCallback)(async()=>{await navigator.clipboard.writeText(lN.join("\n")),a(!0),setTimeout(()=>a(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,p.cn)("relative h-full w-full",n),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(ex,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:u,disabled:l,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[l?(0,t.jsx)(ee.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(o.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:l?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(lC,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:i?(0,t.jsx)(e4.Check,{className:"h-4 w-4"}):(0,t.jsx)(e3.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:lN.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var lM=e.i(17840);function lP({initialNodes:e,initialEdges:n}){let{nodes:o,edges:i,selectedNode:a,isCreateDrawerOpen:l,isDeleting:s,pendingRepositoryPath:u,onNodesChange:c,handleConnect:d,handleAddFeature:f,handleAddFeatureToRepo:h,handleAddFeatureToFeature:p,handleAddRepository:m,handleNodeClick:g,clearSelection:x,handleCreateFeatureSubmit:y,handleDeleteFeature:v,handleDeleteRepository:b,closeCreateDrawer:w,selectFeatureById:k,pendingParentFeatureId:j}=(0,lM.useControlCenterState)(e,n),{setFeatures:E}=(0,lE.useSidebarFeaturesContext)(),C=(0,r.useMemo)(()=>o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[o]);(0,r.useEffect)(()=>{E(o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,n=(0,lE.mapNodeStateToSidebarStatus)(t.state);return n?{featureId:t.featureId,name:t.name,status:n,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[C,o,E]);let S=(0,r.useMemo)(()=>o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return{id:t.featureId,name:t.name}}).filter(e=>e.id&&!e.id.startsWith("#")),[o]),[N,_]=(0,r.useState)();(0,r.useEffect)(()=>{lj().then(_).catch(()=>{})},[]);let[M,P]=(0,r.useState)(null),R=(0,r.useCallback)(()=>{x(),P(null),w()},[x,w]),A=(0,r.useCallback)(e=>{let t=o.find(t=>t.id===e);t?.type==="repositoryNode"&&(x(),P(t.data))},[o,x]),I=function({selectedNode:e,isCreateDrawerOpen:t,pendingRepositoryPath:n,pendingParentFeatureId:r,selectedRepoNode:o,features:i,workflowDefaults:a}){return t?{type:"feature-create",repositoryPath:n,initialParentId:r,features:i,workflowDefaults:a}:e?"requirements"===e.lifecycle&&"action-required"===e.state?{type:"prd-review",node:e}:"implementation"===e.lifecycle&&"action-required"===e.state?{type:"tech-review",node:e}:"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?{type:"merge-review",node:e}:{type:"feature",node:e}:o?{type:"repository",data:o}:null}({selectedNode:a,isCreateDrawerOpen:l,pendingRepositoryPath:u,pendingParentFeatureId:j,selectedRepoNode:M,features:S,workflowDefaults:N});return((0,r.useEffect)(()=>{let e=()=>f();return window.addEventListener("shep:open-create-drawer",e),()=>window.removeEventListener("shep:open-create-drawer",e)},[f]),(0,r.useEffect)(()=>{let e=e=>{m(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[m]),(0,r.useEffect)(()=>{let e=e=>{k(e.detail.featureId)};return window.addEventListener("shep:select-feature",e),()=>window.removeEventListener("shep:select-feature",e)},[k]),o.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lk,{}),(0,t.jsx)(ez,{nodes:o,edges:i,onNodesChange:c,onConnect:d,onAddFeature:f,onNodeAction:p,onNodeClick:g,onPaneClick:R,onRepositoryAdd:h,onRepositoryClick:A,onRepositoryDelete:b,onFeatureDelete:v,onRepositorySelect:m,emptyState:(0,t.jsx)(l_,{onRepositorySelect:m})}),(0,t.jsx)(lh,{view:I,onClose:R,onDelete:v,isDeleting:s,onCreateSubmit:y})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lk,{}),(0,t.jsx)(l_,{onRepositorySelect:m}),(0,t.jsx)(lh,{view:I,onClose:R,onDelete:v,isDeleting:s,onCreateSubmit:y})]})}function lR({initialNodes:e,initialEdges:r}){return(0,t.jsx)("div",{"data-testid":"control-center",className:"h-full w-full",children:(0,t.jsx)(n.ReactFlowProvider,{children:(0,t.jsx)(lP,{initialNodes:e,initialEdges:r})})})}e.s(["ControlCenter",()=>lR],48246)}]);
10
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>z,"AlertDialog",()=>E,"AlertDialogAction",()=>z,"AlertDialogCancel",()=>B,"AlertDialogContent",()=>A,"AlertDialogDescription",()=>T,"AlertDialogOverlay",()=>N,"AlertDialogPortal",()=>S,"AlertDialogTitle",()=>D,"AlertDialogTrigger",()=>C,"Cancel",()=>B,"Content",()=>A,"Description",()=>T,"Overlay",()=>N,"Portal",()=>S,"Root",()=>E,"Title",()=>D,"Trigger",()=>C,"createAlertDialogScope",()=>k],28883);var $=e.i(28883),$=$;function H({...e}){return(0,t.jsx)($.Root,{"data-slot":"alert-dialog",...e})}function V({...e}){return(0,t.jsx)($.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function q({...e}){return(0,t.jsx)($.Portal,{"data-slot":"alert-dialog-portal",...e})}function U({className:e,...n}){return(0,t.jsx)($.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,p.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function X({className:e,size:n="default",...r}){return(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{}),(0,t.jsx)($.Content,{"data-slot":"alert-dialog-content","data-size":n,className:(0,p.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...r})]})}function W({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,p.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...n})}function Y({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,p.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...n})}function K({className:e,...n}){return(0,t.jsx)($.Title,{"data-slot":"alert-dialog-title",className:(0,p.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...n})}function G({className:e,...n}){return(0,t.jsx)($.Description,{"data-slot":"alert-dialog-description",className:(0,p.cn)("text-muted-foreground text-sm",e),...n})}function Z({className:e,variant:n="default",size:r="default",...o}){return(0,t.jsx)(i.Button,{variant:n,size:r,asChild:!0,children:(0,t.jsx)($.Action,{"data-slot":"alert-dialog-action",className:(0,p.cn)(e),...o})})}function Q({className:e,variant:n="outline",size:r="default",...o}){return(0,t.jsx)(i.Button,{variant:n,size:r,asChild:!0,children:(0,t.jsx)($.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,p.cn)(e),...o})})}var J=e.i(2828),ee=e.i(83428),et=e.i(51251),en=e.i(10942);let er=(0,s.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eo=e.i(54277);let ei={requirements:"REQUIREMENTS",research:"RESEARCH",implementation:"IMPLEMENTATION",review:"REVIEW",deploy:"DEPLOY & QA",maintain:"COMPLETED"},ea={requirements:"Analyzing",research:"Researching",implementation:"Implementing",review:"Reviewing",deploy:"Deploying",maintain:"Maintaining"},el={creating:{icon:ee.Loader2,borderClass:"border-l-blue-500",labelClass:"text-blue-500",progressClass:"bg-blue-500",badgeClass:"text-blue-700",badgeBgClass:"bg-blue-50",label:"Creating...",showProgressBar:!1},running:{icon:ee.Loader2,borderClass:"border-l-blue-500",labelClass:"text-blue-500",progressClass:"bg-blue-500",badgeClass:"text-blue-700",badgeBgClass:"bg-blue-50",label:"Running",showProgressBar:!1},"action-required":{icon:et.CircleAlert,borderClass:"border-l-amber-500",labelClass:"text-amber-500",progressClass:"bg-amber-500",badgeClass:"text-amber-700",badgeBgClass:"bg-amber-50",label:"User action required",showProgressBar:!1},done:{icon:en.CircleCheck,borderClass:"border-l-emerald-500",labelClass:"text-emerald-500",progressClass:"bg-emerald-500",badgeClass:"text-emerald-700",badgeBgClass:"bg-emerald-50",label:"Done",showProgressBar:!1},blocked:{icon:er,borderClass:"border-l-gray-400",labelClass:"text-gray-400",progressClass:"bg-gray-400",badgeClass:"text-gray-600",badgeBgClass:"bg-gray-100",label:"Blocked",showProgressBar:!1},error:{icon:eo.CircleX,borderClass:"border-l-red-500",labelClass:"text-red-500",progressClass:"bg-red-500",badgeClass:"text-red-700",badgeBgClass:"bg-red-50",label:"Error",showProgressBar:!1}};var es=e.i(98804);let eu=(0,s.default)("beaker",[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]]);function ec(e,n){function r({className:r}){return(0,t.jsx)(es.default,{src:e,alt:n,width:24,height:24,className:(0,p.cn)("rounded-sm object-contain",r)})}return r.displayName=`BrandIcon(${n})`,r}function ed(e){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor"})]})}function ef({className:e,...n}){return(0,t.jsx)(eu,{className:(0,p.cn)("h-6 w-6",e),...n})}ef.displayName="DevAgentIcon";let eh={"claude-code":ec("/icons/agents/claude-ai-icon.svg","Claude Code"),cursor:ec("/icons/agents/cursor.jpeg","Cursor"),"gemini-cli":ec("/icons/agents/gemini-cli.jpeg","Gemini CLI"),aider:ec("/icons/agents/aider.png","Aider"),continue:ec("/icons/agents/continue.jpeg","Continue"),dev:ef};function ep({agentType:e,className:n}){let r=e&&e in eh?eh[e]:ed;return(0,t.jsx)(r,{className:n})}function em(e){let t=el[e.state];switch(e.state){case"creating":return"Creating...";case"running":return ea[e.lifecycle];case"done":return e.runtime?`Completed in ${e.runtime}`:"Completed";case"blocked":return e.blockedBy?`Waiting on ${e.blockedBy}`:"Blocked";case"action-required":if("requirements"===e.lifecycle)return"Review Product Requirements";if("implementation"===e.lifecycle)return"Review Technical Planning";if("review"===e.lifecycle)return"Review Merge Request";return t.label;case"error":return e.errorMessage??"Something went wrong";default:return t.label}}function eg({data:e,selected:i}){let a,s,m=el[e.state],g=m.icon,[x,y]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(n.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Delete feature","data-testid":"feature-node-delete-button",onClick:e=>{e.stopPropagation(),y(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(h,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Delete feature"})]})})}),(0,t.jsx)(H,{open:x,onOpenChange:y,children:(0,t.jsxs)(X,{size:"sm",children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Delete feature?"}),(0,t.jsxs)(G,{children:["This will permanently delete ",(0,t.jsx)("strong",{children:e.name})," and all associated data including specs, branches, and progress."]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",onClick:()=>e.onDelete?.(e.featureId),children:"Delete"})]})]})})]}):null,(0,t.jsxs)("div",{"data-testid":"feature-node-card","aria-busy":"creating"===e.state?"true":void 0,className:(0,p.cn)("bg-card flex min-h-35 w-72 flex-col rounded-lg border p-3 shadow-sm",i&&"ring-primary ring-2"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{"data-testid":"feature-node-lifecycle-label",className:(0,p.cn)("text-[10px] font-semibold tracking-wider"),children:"blocked"===e.state?"BLOCKED":ei[e.lifecycle]}),e.onSettings?(0,t.jsx)("button",{type:"button","aria-label":"Settings","data-testid":"feature-node-settings-button",onClick:t=>{t.stopPropagation(),e.onSettings?.()},className:"nodrag text-muted-foreground hover:text-foreground -mt-1 -mr-1 p-1",children:(0,t.jsx)(u,{className:"h-3.5 w-3.5"})}):null]}),(0,t.jsx)("h3",{className:"mt-1 truncate text-sm font-bold",children:e.name}),e.description?(0,t.jsx)("p",{"data-testid":"feature-node-description",className:"text-muted-foreground mt-0.5 truncate text-xs",children:e.description}):null,(0,t.jsx)("div",{className:"mt-auto pt-2",children:"creating"===e.state?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 text-xs",children:[(0,t.jsx)(g,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:em(e)})]}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full"})})]}):"running"===e.state?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 text-xs",children:[(0,t.jsx)(ep,{agentType:e.agentType,className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:em(e)})]}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full"})})]}):m.showProgressBar?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-muted-foreground flex items-center justify-end text-[10px]",children:(0,t.jsxs)("span",{children:[e.progress,"%"]})}),(0,t.jsx)("div",{"data-testid":"feature-node-progress-bar",className:"bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all",m.progressClass),style:{width:`${e.progress}%`}})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:(0,t.jsx)("span",{children:e.featureId})}),(0,t.jsxs)("div",{"data-testid":"feature-node-badge",className:(a="action-required"!==e.state?null:"implementation"===e.lifecycle?{badgeClass:"text-indigo-700",badgeBgClass:"bg-indigo-50"}:"review"===e.lifecycle?{badgeClass:"text-emerald-700",badgeBgClass:"bg-emerald-50"}:null,(0,p.cn)("mt-1.5 flex items-center justify-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium",a?.badgeBgClass??m.badgeBgClass,a?.badgeClass??m.badgeClass)),children:[(s=function(e){let t=el[e.state];if("action-required"===e.state){if("requirements"===e.lifecycle)return c;if("implementation"===e.lifecycle)return d.Wrench;if("review"===e.lifecycle)return f}return t.icon}(e),(0,t.jsx)(s,{className:"h-3.5 w-3.5 shrink-0"})),(0,t.jsx)("span",{className:"truncate",children:em(e)})]})]})})]}),e.onAction?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,className:"h-0! w-0! border-0! bg-transparent!",children:(0,t.jsx)("button",{type:"button","aria-label":"Add","data-testid":"feature-node-action-button",onClick:t=>{t.stopPropagation(),e.onAction?.()},className:"nodrag absolute top-1/2 left-1/2 flex h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-blue-500 text-white opacity-0 shadow-md transition-opacity group-hover:opacity-100 hover:bg-blue-600",children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})}):e.showHandles?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,isConnectable:!1,className:"opacity-0!"}):null]})}let ex=(0,s.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),ey=(0,s.default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var ev=e.i(38573),eb=e.i(19933),ew=e.i(24042),ek=e.i(64970);e.i(81803);var ej=e.i(72714);e.i(99348);var eE=e.i(17466),eC=e.i(8537),eS=e.i(63629),eN=e.i(21023);let e_=(0,eN.createServerReference)("40586c6e08c6e26189e7a5e793e5c00209887c279b",eN.callServer,void 0,eN.findSourceMapURL,"openIde"),eM=(0,eN.createServerReference)("4006427d5287b1d3973433061cea850f13646c9e07",eN.callServer,void 0,eN.findSourceMapURL,"openShell"),eP=(0,eN.createServerReference)("40e686944689a8f502a6159c14bf7caae017e1a60c",eN.callServer,void 0,eN.findSourceMapURL,"openFolder");function eR(e){let[t,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=p.current,t=m.current,n=g.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),n&&clearTimeout(n)}},[]);let x=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]),y=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t(e.repositoryPath);if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,r.useCallback)(()=>x(e_,n,u,p,t),[x,t]),openInShell:(0,r.useCallback)(()=>x(eM,i,d,m,o),[x,o]),openFolder:(0,r.useCallback)(()=>y(eP,l,h,g,a),[y,a]),ideLoading:t,shellLoading:o,folderLoading:a,ideError:s,shellError:c,folderError:f}}function eA({data:e}){let[i,a]=(0,r.useState)(!1),s=eR(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),u=(0,eC.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===u.status||"Ready"===u.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(n.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),a(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(h,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(H,{open:i,onOpenChange:a,children:(0,t.jsxs)(X,{size:"sm",children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Remove repository?"}),(0,t.jsxs)(G,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(ex,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,p.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open in IDE",onClick:s.openInIde,loading:s.ideLoading,error:!!s.ideError,icon:ey,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open in Shell",onClick:s.openInShell,loading:s.shellLoading,error:!!s.shellError,icon:ev.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:"Open Folder",onClick:s.openFolder,loading:s.folderLoading,error:!!s.folderError,icon:eb.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:"Open Folder"})]})}),eS.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(ej.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?u.stop:u.deploy,loading:u.deployLoading||u.stopLoading,error:!!u.deployError,icon:c?ek.Square:ew.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(J.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(eE.DeploymentStatusBadge,{status:u.status,url:u.url}):null]}):null]}):null,e.onAdd?(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(J.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(n.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650);var eI=e.i(45811),eD=e.i(25235);e.i(1354);var eO=e.i(1963);function eT(e){let[r]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(n.BaseEdge,{id:e.id,path:r,style:{strokeDasharray:"5 5"}})}function ez({nodes:e,edges:l,onNodesChange:s,onAddFeature:u,onNodeAction:c,onNodeSettings:d,onConnect:f,onNodeClick:h,onPaneClick:p,onRepositoryAdd:m,onRepositoryClick:g,onRepositoryDelete:x,onFeatureDelete:y,onRepositorySelect:v,onCanvasDrag:b,toolbar:w,emptyState:k}){let j=(0,r.useMemo)(()=>({featureNode:eg,repositoryNode:eA,addRepositoryNode:eO.AddRepositoryNode}),[]),E=(0,r.useMemo)(()=>({dependencyEdge:eT}),[]),C=(0,r.useCallback)(t=>{let n=e.find(e=>e.id===t.source);return n?.type!=="repositoryNode"||!l.some(n=>{let r=e.find(e=>e.id===n.source);return r?.type==="repositoryNode"&&n.target===t.target})},[e,l]),S=(0,r.useMemo)(()=>e.map(e=>({...e,data:{...e.data,showHandles:l.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:c?()=>c(e.id):void 0,onSettings:d?()=>d(e.id):void 0,onDelete:y}:{},..."repositoryNode"===e.type&&{onAdd:m?()=>m(e.id):void 0,onClick:g?()=>g(e.id):void 0,onDelete:x},..."addRepositoryNode"===e.type&&{onSelect:v?e=>v(e):void 0}}})),[e,l.length,c,d,y,m,g,x,v]);return 0===e.length?k?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:k}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(i.Button,{onClick:u,children:[(0,t.jsx)(o.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(n.ReactFlowProvider,{children:(0,t.jsxs)(n.ReactFlow,{nodes:S,edges:l,nodeTypes:j,edgeTypes:E,isValidConnection:C,onConnect:f,onNodesChange:s,onNodeClick:h,onPaneClick:p,onMoveStart:b,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(n.Background,{}),(0,t.jsx)(n.Controls,{}),w]})})})}var eL=e.i(60112),eB=e.i(30702);let eF=(0,s.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var e$=e.i(17406);let eH=(0,eN.createServerReference)("604c33fef1fd06c507a5a65e2499ec0ad197e665f0",eN.callServer,void 0,eN.findSourceMapURL,"approveFeature"),eV=(0,eN.createServerReference)("601d13360450eccda16c3440bd790cfc7b1887152b",eN.callServer,void 0,eN.findSourceMapURL,"rejectFeature"),eq=(0,eN.createServerReference)("40ef0bba49aa61001a6009ebf44c9d8f71efad216c",eN.callServer,void 0,eN.findSourceMapURL,"getFeatureArtifact"),eU=(0,eN.createServerReference)("40701f1088380107d159b1849990e3b1b215f79212",eN.callServer,void 0,eN.findSourceMapURL,"getResearchArtifact"),eX=(0,eN.createServerReference)("4085078afa0f7085c1fec31cfd996ce2618ac56a5a",eN.callServer,void 0,eN.findSourceMapURL,"getMergeReviewData");var eW=e.i(8361),eY=e.i(11495),eK=e.i(81846),eG=e.i(94237);let eZ=(0,eG.cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),eQ=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function eJ({className:e,size:n="md",duration:r=5,...o}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,p.cn)(eZ({size:n}),e),...o,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),eQ.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}var e0=e.i(80986),e0=e0,e1=e.i(30090),e1=e1;function e2({status:e}){switch(e){case e$.CiStatus.Success:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(e0.default,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case e$.CiStatus.Pending:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(ee.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case e$.CiStatus.Failure:return(0,t.jsxs)(eK.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(e1.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}let e5=(0,s.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var e3=e.i(33548),e4=e.i(23925),e6=e.i(36589),e8=e.i(87620),e9=e.i(87342),e7=e.i(66033),te=e.i(53532),tt=e.i(41687),tn=e.i(56720),tr=e.i(13123),to=e.i(52740),ti=e.i(39979),ta=e.i(85995),tl=e.i(51080),ts=e.i(29297),tu=e.i(73772),tc=e.i(13044),td=["Enter"," "],tf=["ArrowUp","PageDown","End"],th=["ArrowDown","PageUp","Home",...tf],tp={ltr:[...td,"ArrowRight"],rtl:[...td,"ArrowLeft"]},tm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tg="Menu",[tx,ty,tv]=(0,e9.createCollection)(tg),[tb,tw]=(0,m.createContextScope)(tg,[tv,to.createPopperScope,tl.createRovingFocusGroupScope]),tk=(0,to.createPopperScope)(),tj=(0,tl.createRovingFocusGroupScope)(),[tE,tC]=tb(tg),[tS,tN]=tb(tg),t_=e=>{let{__scopeMenu:n,open:o=!1,children:i,dir:a,onOpenChange:l,modal:s=!0}=e,u=tk(n),[c,d]=r.useState(null),f=r.useRef(!1),h=(0,ts.useCallbackRef)(l),p=(0,e7.useDirection)(a);return r.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(to.Root,{...u,children:(0,t.jsx)(tE,{scope:n,open:o,onOpenChange:h,content:c,onContentChange:d,children:(0,t.jsx)(tS,{scope:n,onClose:r.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:p,modal:s,children:i})})})};t_.displayName=tg;var tM=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e,i=tk(r);return(0,t.jsx)(to.Anchor,{...i,...o,ref:n})});tM.displayName="MenuAnchor";var tP="MenuPortal",[tR,tA]=tb(tP,{forceMount:void 0}),tI=e=>{let{__scopeMenu:n,forceMount:r,children:o,container:i}=e,a=tC(tP,n);return(0,t.jsx)(tR,{scope:n,forceMount:r,children:(0,t.jsx)(ta.Presence,{present:r||a.open,children:(0,t.jsx)(ti.Portal,{asChild:!0,container:i,children:o})})})};tI.displayName=tP;var tD="MenuContent",[tO,tT]=tb(tD),tz=r.forwardRef((e,n)=>{let r=tA(tD,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,a=tC(tD,e.__scopeMenu),l=tN(tD,e.__scopeMenu);return(0,t.jsx)(tx.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(ta.Presence,{present:o||a.open,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeMenu,children:l.modal?(0,t.jsx)(tL,{...i,ref:n}):(0,t.jsx)(tB,{...i,ref:n})})})})}),tL=r.forwardRef((e,n)=>{let o=tC(tD,e.__scopeMenu),i=r.useRef(null),a=(0,g.useComposedRefs)(n,i);return r.useEffect(()=>{let e=i.current;if(e)return(0,tu.hideOthers)(e)},[]),(0,t.jsx)(t$,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),tB=r.forwardRef((e,n)=>{let r=tC(tD,e.__scopeMenu);return(0,t.jsx)(t$,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),tF=(0,v.createSlot)("MenuContent.ScrollLock"),t$=r.forwardRef((e,n)=>{let{__scopeMenu:o,loop:i=!1,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:s,disableOutsidePointerEvents:u,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:x,...v}=e,b=tC(tD,o),w=tN(tD,o),k=tk(o),j=tj(o),E=ty(o),[C,S]=r.useState(null),N=r.useRef(null),_=(0,g.useComposedRefs)(n,N,b.onContentChange),M=r.useRef(0),P=r.useRef(""),R=r.useRef(0),A=r.useRef(null),I=r.useRef("right"),D=r.useRef(0),O=x?tc.RemoveScroll:r.Fragment;r.useEffect(()=>()=>window.clearTimeout(M.current),[]),(0,tt.useFocusGuards)();let T=r.useCallback(e=>{var t,n;return I.current===A.current?.side&&(t=e,!!(n=A.current?.area)&&function(e,t){let{x:n,y:r}=e,o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let a=t[e],l=t[i],s=a.x,u=a.y,c=l.x,d=l.y;u>r!=d>r&&n<(c-s)*(r-u)/(d-u)+s&&(o=!o)}return o}({x:t.clientX,y:t.clientY},n))},[]);return(0,t.jsx)(tO,{scope:o,searchRef:P,onItemEnter:r.useCallback(e=>{T(e)&&e.preventDefault()},[T]),onItemLeave:r.useCallback(e=>{T(e)||(N.current?.focus(),S(null))},[T]),onTriggerLeave:r.useCallback(e=>{T(e)&&e.preventDefault()},[T]),pointerGraceTimerRef:R,onPointerGraceIntentChange:r.useCallback(e=>{A.current=e},[]),children:(0,t.jsx)(O,{...x?{as:tF,allowPinchZoom:!0}:void 0,children:(0,t.jsx)(tn.FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:(0,y.composeEventHandlers)(l,e=>{e.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,t.jsx)(te.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:(0,t.jsx)(tl.Root,{asChild:!0,...j,dir:w.dir,orientation:"vertical",loop:i,currentTabStopId:C,onCurrentTabStopIdChange:S,onEntryFocus:(0,y.composeEventHandlers)(c,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(to.Content,{role:"menu","aria-orientation":"vertical","data-state":ni(b.open),"data-radix-menu-content":"",dir:w.dir,...k,...v,ref:_,style:{outline:"none",...v.style},onKeyDown:(0,y.composeEventHandlers)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;if(t){var o;let t,i,a,l,s,u;"Tab"===e.key&&e.preventDefault(),!n&&r&&(o=e.key,t=P.current+o,i=E().filter(e=>!e.disabled),a=document.activeElement,l=i.find(e=>e.ref.current===a)?.textValue,s=function(e,t,n){var r;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=(r=Math.max(i,0),e.map((t,n)=>e[(r+n)%e.length]));1===o.length&&(a=a.filter(e=>e!==n));let l=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}(i.map(e=>e.textValue),t,l),u=i.find(e=>e.textValue===s)?.ref.current,function e(t){P.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(t),u&&setTimeout(()=>u.focus()))}let i=N.current;if(e.target!==i||!th.includes(e.key))return;e.preventDefault();let a=E().filter(e=>!e.disabled).map(e=>e.ref.current);tf.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,y.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),P.current="")}),onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(e=>{let t=e.target,n=D.current!==e.clientX;e.currentTarget.contains(t)&&n&&(I.current=e.clientX>D.current?"right":"left",D.current=e.clientX)}))})})})})})})});tz.displayName=tD;var tH=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{role:"group",...o,ref:n})});tH.displayName="MenuGroup";var tV=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{...o,ref:n})});tV.displayName="MenuLabel";var tq="MenuItem",tU="menu.itemSelect",tX=r.forwardRef((e,n)=>{let{disabled:o=!1,onSelect:i,...a}=e,l=r.useRef(null),s=tN(tq,e.__scopeMenu),u=tT(tq,e.__scopeMenu),c=(0,g.useComposedRefs)(n,l),d=r.useRef(!1);return(0,t.jsx)(tW,{...a,ref:c,disabled:o,onClick:(0,y.composeEventHandlers)(e.onClick,()=>{let e=l.current;if(!o&&e){let t=new CustomEvent(tU,{bubbles:!0,cancelable:!0});e.addEventListener(tU,e=>i?.(e),{once:!0}),(0,e8.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,y.composeEventHandlers)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==u.searchRef.current;o||t&&" "===e.key||td.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});tX.displayName=tq;var tW=r.forwardRef((e,n)=>{let{__scopeMenu:o,disabled:i=!1,textValue:a,...l}=e,s=tT(tq,o),u=tj(o),c=r.useRef(null),d=(0,g.useComposedRefs)(n,c),[f,h]=r.useState(!1),[p,m]=r.useState("");return r.useEffect(()=>{let e=c.current;e&&m((e.textContent??"").trim())},[l.children]),(0,t.jsx)(tx.ItemSlot,{scope:o,disabled:i,textValue:a??p,children:(0,t.jsx)(tl.Item,{asChild:!0,...u,focusable:!i,children:(0,t.jsx)(e8.Primitive.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:d,onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,y.composeEventHandlers)(e.onPointerLeave,ns(e=>s.onItemLeave(e))),onFocus:(0,y.composeEventHandlers)(e.onFocus,()=>h(!0)),onBlur:(0,y.composeEventHandlers)(e.onBlur,()=>h(!1))})})})}),tY=r.forwardRef((e,n)=>{let{checked:r=!1,onCheckedChange:o,...i}=e;return(0,t.jsx)(t2,{scope:e.__scopeMenu,checked:r,children:(0,t.jsx)(tX,{role:"menuitemcheckbox","aria-checked":na(r)?"mixed":r,...i,ref:n,"data-state":nl(r),onSelect:(0,y.composeEventHandlers)(i.onSelect,()=>o?.(!!na(r)||!r),{checkForDefaultPrevented:!1})})})});tY.displayName="MenuCheckboxItem";var tK="MenuRadioGroup",[tG,tZ]=tb(tK,{value:void 0,onValueChange:()=>{}}),tQ=r.forwardRef((e,n)=>{let{value:r,onValueChange:o,...i}=e,a=(0,ts.useCallbackRef)(o);return(0,t.jsx)(tG,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,t.jsx)(tH,{...i,ref:n})})});tQ.displayName=tK;var tJ="MenuRadioItem",t0=r.forwardRef((e,n)=>{let{value:r,...o}=e,i=tZ(tJ,e.__scopeMenu),a=r===i.value;return(0,t.jsx)(t2,{scope:e.__scopeMenu,checked:a,children:(0,t.jsx)(tX,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":nl(a),onSelect:(0,y.composeEventHandlers)(o.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});t0.displayName=tJ;var t1="MenuItemIndicator",[t2,t5]=tb(t1,{checked:!1}),t3=r.forwardRef((e,n)=>{let{__scopeMenu:r,forceMount:o,...i}=e,a=t5(t1,r);return(0,t.jsx)(ta.Presence,{present:o||na(a.checked)||!0===a.checked,children:(0,t.jsx)(e8.Primitive.span,{...i,ref:n,"data-state":nl(a.checked)})})});t3.displayName=t1;var t4=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e;return(0,t.jsx)(e8.Primitive.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});t4.displayName="MenuSeparator";var t6=r.forwardRef((e,n)=>{let{__scopeMenu:r,...o}=e,i=tk(r);return(0,t.jsx)(to.Arrow,{...i,...o,ref:n})});t6.displayName="MenuArrow";var t8="MenuSub",[t9,t7]=tb(t8),ne=e=>{let{__scopeMenu:n,children:o,open:i=!1,onOpenChange:a}=e,l=tC(t8,n),s=tk(n),[u,c]=r.useState(null),[d,f]=r.useState(null),h=(0,ts.useCallbackRef)(a);return r.useEffect(()=>(!1===l.open&&h(!1),()=>h(!1)),[l.open,h]),(0,t.jsx)(to.Root,{...s,children:(0,t.jsx)(tE,{scope:n,open:i,onOpenChange:h,content:d,onContentChange:f,children:(0,t.jsx)(t9,{scope:n,contentId:(0,tr.useId)(),triggerId:(0,tr.useId)(),trigger:u,onTriggerChange:c,children:o})})})};ne.displayName=t8;var nt="MenuSubTrigger",nn=r.forwardRef((e,n)=>{let o=tC(nt,e.__scopeMenu),i=tN(nt,e.__scopeMenu),a=t7(nt,e.__scopeMenu),l=tT(nt,e.__scopeMenu),s=r.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:c}=l,d={__scopeMenu:e.__scopeMenu},f=r.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return r.useEffect(()=>f,[f]),r.useEffect(()=>{let e=u.current;return()=>{window.clearTimeout(e),c(null)}},[u,c]),(0,t.jsx)(tM,{asChild:!0,...d,children:(0,t.jsx)(tW,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":a.contentId,"data-state":ni(o.open),...e,ref:(0,g.composeRefs)(n,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:(0,y.composeEventHandlers)(e.onPointerMove,ns(t=>{l.onItemEnter(t),!t.defaultPrevented&&(e.disabled||o.open||s.current||(l.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100)))})),onPointerLeave:(0,y.composeEventHandlers)(e.onPointerLeave,ns(e=>{f();let t=o.content?.getBoundingClientRect();if(t){let n=o.content?.dataset.side,r="right"===n,i=t[r?"left":"right"],a=t[r?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,t=>{let n=""!==l.searchRef.current;e.disabled||n&&" "===t.key||tp[i.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});nn.displayName=nt;var nr="MenuSubContent",no=r.forwardRef((e,n)=>{let o=tA(tD,e.__scopeMenu),{forceMount:i=o.forceMount,...a}=e,l=tC(tD,e.__scopeMenu),s=tN(tD,e.__scopeMenu),u=t7(nr,e.__scopeMenu),c=r.useRef(null),d=(0,g.useComposedRefs)(n,c);return(0,t.jsx)(tx.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(ta.Presence,{present:i||l.open,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(t$,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:d,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:(0,y.composeEventHandlers)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=tm[s.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});function ni(e){return e?"open":"closed"}function na(e){return"indeterminate"===e}function nl(e){return na(e)?"indeterminate":e?"checked":"unchecked"}function ns(e){return t=>"mouse"===t.pointerType?e(t):void 0}no.displayName=nr;var nu="DropdownMenu",[nc,nd]=(0,m.createContextScope)(nu,[tw]),nf=tw(),[nh,np]=nc(nu),nm=e=>{let{__scopeDropdownMenu:n,children:o,dir:i,open:a,defaultOpen:l,onOpenChange:s,modal:u=!0}=e,c=nf(n),d=r.useRef(null),[f,h]=(0,e6.useControllableState)({prop:a,defaultProp:l??!1,onChange:s,caller:nu});return(0,t.jsx)(nh,{scope:n,triggerId:(0,tr.useId)(),triggerRef:d,contentId:(0,tr.useId)(),open:f,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),modal:u,children:(0,t.jsx)(t_,{...c,open:f,onOpenChange:h,dir:i,modal:u,children:o})})};nm.displayName=nu;var ng="DropdownMenuTrigger",nx=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,a=np(ng,r),l=nf(r);return(0,t.jsx)(tM,{asChild:!0,...l,children:(0,t.jsx)(e8.Primitive.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:(0,g.composeRefs)(n,a.triggerRef),onPointerDown:(0,y.composeEventHandlers)(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,y.composeEventHandlers)(e.onKeyDown,e=>{!o&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});nx.displayName=ng;var ny=e=>{let{__scopeDropdownMenu:n,...r}=e,o=nf(n);return(0,t.jsx)(tI,{...o,...r})};ny.displayName="DropdownMenuPortal";var nv="DropdownMenuContent",nb=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:o,...i}=e,a=np(nv,o),l=nf(o),s=r.useRef(!1);return(0,t.jsx)(tz,{id:a.contentId,"aria-labelledby":a.triggerId,...l,...i,ref:n,onCloseAutoFocus:(0,y.composeEventHandlers)(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,y.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nb.displayName=nv;var nw=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tH,{...i,...o,ref:n})});nw.displayName="DropdownMenuGroup";var nk=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tV,{...i,...o,ref:n})});nk.displayName="DropdownMenuLabel";var nj=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tX,{...i,...o,ref:n})});nj.displayName="DropdownMenuItem";var nE=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tY,{...i,...o,ref:n})});nE.displayName="DropdownMenuCheckboxItem";var nC=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(tQ,{...i,...o,ref:n})});nC.displayName="DropdownMenuRadioGroup";var nS=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t0,{...i,...o,ref:n})});nS.displayName="DropdownMenuRadioItem";var nN=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t3,{...i,...o,ref:n})});nN.displayName="DropdownMenuItemIndicator";var n_=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t4,{...i,...o,ref:n})});n_.displayName="DropdownMenuSeparator";var nM=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(t6,{...i,...o,ref:n})});nM.displayName="DropdownMenuArrow";var nP=e=>{let{__scopeDropdownMenu:n,children:r,open:o,onOpenChange:i,defaultOpen:a}=e,l=nf(n),[s,u]=(0,e6.useControllableState)({prop:o,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return(0,t.jsx)(ne,{...l,open:s,onOpenChange:u,children:r})},nR=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(nn,{...i,...o,ref:n})});nR.displayName="DropdownMenuSubTrigger";var nA=r.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...o}=e,i=nf(r);return(0,t.jsx)(no,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nA.displayName="DropdownMenuSubContent",e.s(["Arrow",()=>nM,"CheckboxItem",()=>nE,"Content",()=>nb,"DropdownMenu",()=>nm,"DropdownMenuArrow",()=>nM,"DropdownMenuCheckboxItem",()=>nE,"DropdownMenuContent",()=>nb,"DropdownMenuGroup",()=>nw,"DropdownMenuItem",()=>nj,"DropdownMenuItemIndicator",()=>nN,"DropdownMenuLabel",()=>nk,"DropdownMenuPortal",()=>ny,"DropdownMenuRadioGroup",()=>nC,"DropdownMenuRadioItem",()=>nS,"DropdownMenuSeparator",()=>n_,"DropdownMenuSub",()=>nP,"DropdownMenuSubContent",()=>nA,"DropdownMenuSubTrigger",()=>nR,"DropdownMenuTrigger",()=>nx,"Group",()=>nw,"Item",()=>nj,"ItemIndicator",()=>nN,"Label",()=>nk,"Portal",()=>ny,"RadioGroup",()=>nC,"RadioItem",()=>nS,"Root",()=>nm,"Separator",()=>n_,"Sub",()=>nP,"SubContent",()=>nA,"SubTrigger",()=>nR,"Trigger",()=>nx,"createDropdownMenuScope",()=>nd],61920);var nI=e.i(61920),nI=nI;let nD=(0,s.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),nO=(0,s.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),nT=nI.Root,nz=nI.Trigger;nI.Group,nI.Portal,nI.Sub,nI.RadioGroup,r.forwardRef(({className:e,inset:n,children:r,...o},i)=>(0,t.jsxs)(nI.SubTrigger,{ref:i,className:(0,p.cn)("focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,(0,t.jsx)(nD,{className:"ml-auto"})]})).displayName=nI.SubTrigger.displayName,r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nI.SubContent,{ref:r,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",e),...n})).displayName=nI.SubContent.displayName;let nL=r.forwardRef(({className:e,sideOffset:n=4,...r},o)=>(0,t.jsx)(nI.Portal,{children:(0,t.jsx)(nI.Content,{ref:o,sideOffset:n,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...r})}));nL.displayName=nI.Content.displayName;let nB=r.forwardRef(({className:e,inset:n,...r},o)=>(0,t.jsx)(nI.Item,{ref:o,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r}));nB.displayName=nI.Item.displayName,r.forwardRef(({className:e,children:n,checked:r,...o},i)=>(0,t.jsxs)(nI.CheckboxItem,{ref:i,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(nI.ItemIndicator,{children:(0,t.jsx)(e4.Check,{className:"h-4 w-4"})})}),n]})).displayName=nI.CheckboxItem.displayName,r.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(nI.RadioItem,{ref:o,className:(0,p.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(nI.ItemIndicator,{children:(0,t.jsx)(nO,{className:"h-2 w-2 fill-current"})})}),n]})).displayName=nI.RadioItem.displayName;let nF=r.forwardRef(({className:e,inset:n,...r},o)=>(0,t.jsx)(nI.Label,{ref:o,className:(0,p.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}));nF.displayName=nI.Label.displayName;let n$=r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nI.Separator,{ref:r,className:(0,p.cn)("bg-muted -mx-1 my-1 h-px",e),...n}));function nH({actions:e,repositoryPath:n,showSpecs:o}){let[a,l]=(0,r.useState)(!1),s=e.ideLoading||e.shellLoading||e.specsLoading,u=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(nT,{modal:!1,children:[(0,t.jsx)(nz,{asChild:!0,children:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:s,children:[s?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):u?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(eb.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(e5,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(nL,{align:"start",className:"w-48",children:[(0,t.jsx)(nF,{children:"Open in"}),(0,t.jsxs)(nB,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(ey,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(nB,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(ev.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(nB,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!o,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(et.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(eb.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(n$,{}),(0,t.jsxs)(nB,{onClick:()=>{navigator.clipboard.writeText(n),l(!0),setTimeout(()=>l(!1),2e3)},className:"gap-2",children:[a?(0,t.jsx)(e4.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(e3.Copy,{className:"size-4"}),a?"Copied!":"Copy path"]})]})]})}n$.displayName=nI.Separator.displayName;var nV=e.i(91891),nV=nV;let nq=(0,s.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),nU=(0,s.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),nX=(0,s.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),nW=(0,s.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var nY=e.i(1012),nY=nY,nK=e.i(98127);function nG({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,p.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var nZ=r.forwardRef((e,n)=>(0,t.jsx)(e8.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));nZ.displayName="Label",e.s(["Label",()=>nZ,"Root",()=>nZ],27572);var nQ=e.i(27572),nQ=nQ;let nJ=(0,eG.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),n0=r.forwardRef(({className:e,...n},r)=>(0,t.jsx)(nQ.Root,{ref:r,className:(0,p.cn)(nJ(),e),...n}));n0.displayName=nQ.Root.displayName;var nY=nY;let n1=(0,s.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var n2=e.i(77624),n5="Checkbox",[n3,n4]=(0,m.createContextScope)(n5),[n6,n8]=n3(n5);function n9(e){let{__scopeCheckbox:n,checked:o,children:i,defaultChecked:a,disabled:l,form:s,name:u,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[p,m]=(0,e6.useControllableState)({prop:o,defaultProp:a??!1,onChange:c,caller:n5}),[g,x]=r.useState(null),[y,v]=r.useState(null),b=r.useRef(!1),w=!g||!!s||!!g.closest("form"),k={checked:p,disabled:l,setChecked:m,control:g,setControl:x,name:u,form:s,value:f,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:!ra(a)&&a,isFormControl:w,bubbleInput:y,setBubbleInput:v};return(0,t.jsx)(n6,{scope:n,...k,children:"function"==typeof h?h(k):i})}var n7="CheckboxTrigger",re=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...i},a)=>{let{control:l,value:s,disabled:u,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:x}=n8(n7,e),v=(0,g.useComposedRefs)(a,f),b=r.useRef(c);return r.useEffect(()=>{let e=l?.form;if(e){let t=()=>h(b.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,h]),(0,t.jsx)(e8.Primitive.button,{type:"button",role:"checkbox","aria-checked":ra(c)?"mixed":c,"aria-required":d,"data-state":rl(c),"data-disabled":u?"":void 0,disabled:u,value:s,...i,ref:v,onKeyDown:(0,y.composeEventHandlers)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,y.composeEventHandlers)(o,e=>{h(e=>!!ra(e)||!e),x&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});re.displayName=n7;var rt=r.forwardRef((e,n)=>{let{__scopeCheckbox:r,name:o,checked:i,defaultChecked:a,required:l,disabled:s,value:u,onCheckedChange:c,form:d,...f}=e;return(0,t.jsx)(n9,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:s,required:l,onCheckedChange:c,name:o,form:d,value:u,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(re,{...f,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(ri,{__scopeCheckbox:r})]})})});rt.displayName=n5;var rn="CheckboxIndicator",rr=r.forwardRef((e,n)=>{let{__scopeCheckbox:r,forceMount:o,...i}=e,a=n8(rn,r);return(0,t.jsx)(ta.Presence,{present:o||ra(a.checked)||!0===a.checked,children:(0,t.jsx)(e8.Primitive.span,{"data-state":rl(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})});rr.displayName=rn;var ro="CheckboxBubbleInput",ri=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{let i,{control:a,hasConsumerStoppedPropagationRef:l,checked:s,defaultChecked:u,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:m,setBubbleInput:x}=n8(ro,e),y=(0,g.useComposedRefs)(o,x),v=(i=r.useRef({value:s,previous:s}),r.useMemo(()=>(i.current.value!==s&&(i.current.previous=i.current.value,i.current.value=s),i.current.previous),[s])),b=(0,n2.useSize)(a);r.useEffect(()=>{if(!m)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!l.current;if(v!==s&&e){let n=new Event("click",{bubbles:t});m.indeterminate=ra(s),e.call(m,!ra(s)&&s),m.dispatchEvent(n)}},[m,v,s,l]);let w=r.useRef(!ra(s)&&s);return(0,t.jsx)(e8.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??w.current,required:c,disabled:d,name:f,value:h,form:p,...n,tabIndex:-1,ref:y,style:{...n.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function ra(e){return"indeterminate"===e}function rl(e){return ra(e)?"indeterminate":e?"checked":"unchecked"}ri.displayName=ro,e.s(["Checkbox",()=>rt,"CheckboxIndicator",()=>rr,"Indicator",()=>rr,"Root",()=>rt,"createCheckboxScope",()=>n4,"unstable_BubbleInput",()=>ri,"unstable_CheckboxBubbleInput",()=>ri,"unstable_CheckboxProvider",()=>n9,"unstable_CheckboxTrigger",()=>re,"unstable_Provider",()=>n9,"unstable_Trigger",()=>re],57696);var rs=e.i(57696),rs=rs;function ru({className:e,...n}){return(0,t.jsx)(rs.Root,{"data-slot":"checkbox",className:(0,p.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:(0,t.jsx)(rs.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:"indeterminate"===n.checked?(0,t.jsx)(n1,{className:"size-3.5"}):(0,t.jsx)(nY.default,{className:"size-3.5"})})})}function rc({id:e,label:n,description:r,checked:o,onCheckedChange:i,disabled:a}){return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ru,{id:e,className:"mt-0.75",checked:o,onCheckedChange:e=>i(!0===e),disabled:a}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(n0,{htmlFor:e,className:"cursor-pointer text-sm font-medium",children:n}),r?(0,t.jsx)(n0,{htmlFor:e,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:r}):null]})]})}function rd({label:e,description:n,parentAriaLabel:r,options:o,value:i,onValueChange:a,disabled:l}){let s=o.filter(e=>i[e.id]).length,u=s===o.length,c=s>0&&!u,d=`${e.toLowerCase().replace(/\s+/g,"-")}-group`;return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ru,{id:d,className:"mt-0.75",checked:c?"indeterminate":u,onCheckedChange:()=>{let e=s<o.length,t={};for(let n of o)t[n.id]=e;a(t)},disabled:l,"aria-label":r??`${e} select all`}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(n0,{htmlFor:d,className:"cursor-pointer text-sm font-medium",children:e}),n?(0,t.jsx)(n0,{htmlFor:d,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:n}):null]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 pl-6",children:o.map(e=>(0,t.jsx)(rc,{id:e.id,label:e.label,description:e.description,checked:i[e.id]??!1,onCheckedChange:t=>{var n;return n=e.id,void a({...i,[n]:t})},disabled:l},e.id))})]})}var rf="Popover",[rh,rp]=(0,m.createContextScope)(rf,[to.createPopperScope]),rm=(0,to.createPopperScope)(),[rg,rx]=rh(rf),ry=e=>{let{__scopePopover:n,children:o,open:i,defaultOpen:a,onOpenChange:l,modal:s=!1}=e,u=rm(n),c=r.useRef(null),[d,f]=r.useState(!1),[h,p]=(0,e6.useControllableState)({prop:i,defaultProp:a??!1,onChange:l,caller:rf});return(0,t.jsx)(to.Root,{...u,children:(0,t.jsx)(rg,{scope:n,contentId:(0,tr.useId)(),triggerRef:c,open:h,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:d,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:s,children:o})})};ry.displayName=rf;var rv="PopoverAnchor",rb=r.forwardRef((e,n)=>{let{__scopePopover:o,...i}=e,a=rx(rv,o),l=rm(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=a;return r.useEffect(()=>(s(),()=>u()),[s,u]),(0,t.jsx)(to.Anchor,{...l,...i,ref:n})});rb.displayName=rv;var rw="PopoverTrigger",rk=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rx(rw,r),a=rm(r),l=(0,g.useComposedRefs)(n,i.triggerRef),s=(0,t.jsx)(e8.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rT(i.open),...o,ref:l,onClick:(0,y.composeEventHandlers)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,t.jsx)(to.Anchor,{asChild:!0,...a,children:s})});rk.displayName=rw;var rj="PopoverPortal",[rE,rC]=rh(rj,{forceMount:void 0}),rS=e=>{let{__scopePopover:n,forceMount:r,children:o,container:i}=e,a=rx(rj,n);return(0,t.jsx)(rE,{scope:n,forceMount:r,children:(0,t.jsx)(ta.Presence,{present:r||a.open,children:(0,t.jsx)(ti.Portal,{asChild:!0,container:i,children:o})})})};rS.displayName=rj;var rN="PopoverContent",r_=r.forwardRef((e,n)=>{let r=rC(rN,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,a=rx(rN,e.__scopePopover);return(0,t.jsx)(ta.Presence,{present:o||a.open,children:a.modal?(0,t.jsx)(rP,{...i,ref:n}):(0,t.jsx)(rR,{...i,ref:n})})});r_.displayName=rN;var rM=(0,v.createSlot)("PopoverContent.RemoveScroll"),rP=r.forwardRef((e,n)=>{let o=rx(rN,e.__scopePopover),i=r.useRef(null),a=(0,g.useComposedRefs)(n,i),l=r.useRef(!1);return r.useEffect(()=>{let e=i.current;if(e)return(0,tu.hideOthers)(e)},[]),(0,t.jsx)(tc.RemoveScroll,{as:rM,allowPinchZoom:!0,children:(0,t.jsx)(rA,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,y.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),l.current||o.triggerRef.current?.focus()}),onPointerDownOutside:(0,y.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;l.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,y.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),rR=r.forwardRef((e,n)=>{let o=rx(rN,e.__scopePopover),i=r.useRef(!1),a=r.useRef(!1);return(0,t.jsx)(rA,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rA=r.forwardRef((e,n)=>{let{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,...f}=e,h=rx(rN,r),p=rm(r);return(0,tt.useFocusGuards)(),(0,t.jsx)(tn.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,t.jsx)(te.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:(0,t.jsx)(to.Content,{"data-state":rT(h.open),role:"dialog",id:h.contentId,...p,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rI="PopoverClose",rD=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rx(rI,r);return(0,t.jsx)(e8.Primitive.button,{type:"button",...o,ref:n,onClick:(0,y.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});rD.displayName=rI;var rO=r.forwardRef((e,n)=>{let{__scopePopover:r,...o}=e,i=rm(r);return(0,t.jsx)(to.Arrow,{...i,...o,ref:n})});function rT(e){return e?"open":"closed"}rO.displayName="PopoverArrow",e.s(["Anchor",()=>rb,"Arrow",()=>rO,"Close",()=>rD,"Content",()=>r_,"Popover",()=>ry,"PopoverAnchor",()=>rb,"PopoverArrow",()=>rO,"PopoverClose",()=>rD,"PopoverContent",()=>r_,"PopoverPortal",()=>rS,"PopoverTrigger",()=>rk,"Portal",()=>rS,"Root",()=>ry,"Trigger",()=>rk,"createPopoverScope",()=>rp],89920);var rz=e.i(89920),rz=rz;let rL=rz.Root,rB=rz.Trigger;rz.Anchor;let rF=r.forwardRef(({className:e,align:n="center",sideOffset:r=4,...o},i)=>(0,t.jsx)(rz.Portal,{children:(0,t.jsx)(rz.Content,{ref:i,align:n,sideOffset:r,className:(0,p.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));async function r$(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}rF.displayName=rz.Content.displayName;let rH=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],rV={allowPrd:!1,allowPlan:!1,allowMerge:!1};function rq({open:e,onClose:n,onSubmit:o,repositoryPath:a,isSubmitting:l=!1,workflowDefaults:s,features:u,initialParentId:c}){let d=(0,eW.useSoundAction)("create"),f=s?.approvalGates??rV,h=s?.push??!1,p=s?.openPr??!1,[m,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),[v,b]=(0,r.useState)([]),[w,k]=(0,r.useState)({...f}),[j,E]=(0,r.useState)(h),[C,S]=(0,r.useState)(p),[N,_]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{s&&(k({...s.approvalGates}),E(s.push),S(s.openPr))},[s]),(0,r.useEffect)(()=>{e&&c&&_(c)},[e,c]);let M=(0,r.useCallback)(()=>{g(""),y(""),b([]),k({...f}),E(h),S(p),_(void 0)},[f,h,p]),P=(0,r.useCallback)(()=>{M(),n()},[n,M]),R=(0,r.useCallback)(e=>{if(e.preventDefault(),!m.trim())return;d.play();let t=x.trim()||void 0;o({name:m.trim(),description:t,attachments:v,repositoryPath:a,approvalGates:{allowPrd:w.allowPrd??!1,allowPlan:w.allowPlan??!1,allowMerge:w.allowMerge??!1},push:j||C,openPr:C,...N?{parentId:N}:{}}),M()},[m,x,v,w,a,o,j,C,N,d,M]),A=(0,r.useCallback)(async()=>{try{let e=await r$();e&&b(t=>[...t,...e])}catch{}},[]),I=(0,r.useCallback)(e=>{b(t=>t.filter(t=>t.path!==e))},[]),D=u&&u.length>0;return(0,t.jsx)(eY.BaseDrawer,{open:e,onClose:P,size:"md",modal:!1,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(eI.DrawerTitle,{children:"NEW FEATURE"})]}),(0,t.jsx)(eI.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(eK.Badge,{variant:"secondary",children:"Creating..."})})})]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:P,disabled:l,children:"Cancel"}),(0,t.jsx)(i.Button,{type:"submit",form:"create-feature-form",disabled:!m.trim()||l,children:l?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsxs)("form",{id:"create-feature-form",onSubmit:R,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"feature-name",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"FEATURE NAME"}),(0,t.jsx)(nK.Input,{id:"feature-name",placeholder:"e.g. GitHub OAuth Login",value:m,onChange:e=>g(e.target.value),required:!0,disabled:l})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIPTION"}),(0,t.jsx)(nG,{id:"feature-description",placeholder:"Describe what this feature does...",value:x,onChange:e=>y(e.target.value),rows:4,disabled:l})]}),D?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(rU,{features:u,value:N,onChange:_,disabled:l})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"APPROVE"}),(0,t.jsx)(rd,{label:"Autonomous Mode",description:"YOLO!",parentAriaLabel:"Auto approve all",options:rH,value:w,onValueChange:k,disabled:l})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(rc,{id:"push",label:"Push",description:"Push branch to remote after implementation.",checked:j||C,onCheckedChange:E,disabled:C||l}),(0,t.jsx)(rc,{id:"open-pr",label:"Create PR",description:"Open a pull request after pushing.",checked:C,onCheckedChange:S,disabled:l})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(n0,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:["ATTACHMENTS",v.length>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60 ml-1.5",children:["(",v.length,")"]})]}),(0,t.jsxs)(i.Button,{type:"button",variant:"outline",size:"xs",onClick:A,disabled:l,children:[(0,t.jsx)(nV.default,{className:"size-3"}),"Add Files"]})]}),v.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:v.map(e=>(0,t.jsx)(rX,{file:e,onRemove:()=>I(e.path),disabled:l},e.path))})]})]})})})}function rU({features:e,value:n,onChange:o,disabled:i}){let[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(""),c=(0,r.useRef)(null),d=e.find(e=>e.id===n),f=s.trim()?e.filter(e=>e.name.toLowerCase().includes(s.toLowerCase())||e.id.toLowerCase().includes(s.toLowerCase())):e,h=(0,r.useCallback)(e=>{o(e),l(!1),u("")},[o]);return(0,r.useEffect)(()=>{a?setTimeout(()=>c.current?.focus(),0):u("")},[a]),(0,t.jsxs)(rL,{open:a,onOpenChange:l,children:[(0,t.jsx)(rB,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":a,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,p.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!d&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:d?`${d.name} (${d.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(nW,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(rF,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(nK.Input,{ref:c,placeholder:"Search features...",value:s,onChange:e=>u(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===n,onClick:()=>h(void 0),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===n&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(nY.default,{className:(0,p.cn)("h-4 w-4 shrink-0",void 0!==n&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===f.length&&s?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):f.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":n===e.id,onClick:()=>h(e.id),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",n===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(nY.default,{className:(0,p.cn)("h-4 w-4 shrink-0",n!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function rX({file:e,onRemove:n,disabled:r}){var o,a,l;let s,u=(s=(o=e.name).lastIndexOf("."))>=0?o.slice(s).toLowerCase():"",d=(a=u,rW.has(a)?nU:".pdf"===a?c:rY.has(a)?nX:nq),f=".pdf"===(l=u)?"bg-red-50 text-red-600":rW.has(l)?"bg-blue-50 text-blue-600":rY.has(l)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600";return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border p-2",children:[(0,t.jsx)("div",{className:(0,p.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded",f),children:(0,t.jsx)(d,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}(e.size)})]}),(0,t.jsx)(i.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:n,disabled:r,"aria-label":`Remove ${e.name}`,children:(0,t.jsx)(h,{className:"h-3 w-3"})})]})}let rW=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),rY=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]),rK=(0,s.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),rG=(0,s.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);function rZ({onReject:e,onApprove:n,approveLabel:o,approveIcon:a,revisionPlaceholder:l,isProcessing:s=!1,isRejecting:u=!1,children:c}){let[d,f]=(0,r.useState)(""),h=(0,eW.useSoundAction)("approve"),p=s||u;return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsxs)("form",{onSubmit:function(t){t.preventDefault();let n=d.trim();n&&e&&(e(n),f(""))},className:"flex items-center gap-2 p-4",children:[(0,t.jsx)(nK.Input,{type:"text",placeholder:l??"Ask AI to revise...","aria-label":l??"Ask AI to revise...",disabled:p,value:d,onChange:e=>f(e.target.value),className:"flex-1"}),(0,t.jsx)(i.Button,{type:"submit",variant:"secondary",size:"icon","aria-label":"Send",disabled:p,children:(0,t.jsx)(rG,{})}),(0,t.jsxs)(i.Button,{type:"button",disabled:p,onClick:()=>{h.play(),n()},children:[a,o]})]}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsxs)(i.Button,{type:"button",className:"flex-1",disabled:p,onClick:()=>{h.play(),n()},children:[a,o]})})]})}function rQ({data:e,selections:n,onSelect:o,onApprove:a,onReject:l,isProcessing:s=!1,isRejecting:u=!1,showHeader:c=!1}){let{question:d,context:f,questions:h,finalAction:m}=e,[g,x]=(0,r.useState)(0),y=(0,eW.useSoundAction)("select"),v=(0,eW.useSoundAction)("navigate"),b=h.length,w=g===b-1,k=h[g],j=(0,r.useMemo)(()=>Object.keys(n).length,[n]),E=(0,r.useCallback)((e,t)=>{y.play(),o(e,t),w||setTimeout(()=>x(e=>e+1),250)},[o,w,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:d}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:k.question}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,r)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${r+1}`,className:(0,p.cn)("h-1.5 rounded-full transition-all duration-200",r===g?"bg-primary w-4":"w-1.5",r!==g&&n[e.id]?"bg-primary/50":"",r===g||n[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),x(r)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:k.options.map((e,r)=>{let o=n[k.id]===e.id,i=String.fromCharCode(65+r);return(0,t.jsx)("button",{type:"button",className:(0,p.cn)("border-border w-full rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",o&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:s,onClick:()=>E(k.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[i,"."]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-0.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:e.label}),e.recommended?(0,t.jsx)(eK.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null,e.isNew?(0,t.jsx)(eK.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] text-white hover:bg-emerald-600/80",children:"New"}):null]}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]})]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===g||s,onClick:()=>{v.play(),x(e=>e-1)},children:[(0,t.jsx)(rK,{className:"mr-1 h-4 w-4"}),"Previous"]}),w?null:(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"sm",disabled:s,onClick:()=>{v.play(),x(e=>e+1)},children:[n[k.id]?"Next":"Skip",(0,t.jsx)(nD,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(rZ,{onReject:l,onApprove:()=>a(m.id),approveLabel:m.label,approveIcon:(0,t.jsx)(e4.Check,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:s,isRejecting:u,children:(0,t.jsx)("div",{className:(0,p.cn)("bg-muted h-1.5 overflow-hidden",j>0&&j<b||s?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:s?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?j/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function rJ(){}function r0(){}let r1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r5={};function r3(e,t){return((t||r5).jsx?r2:r1).test(e)}let r4=/[ \t\n\f\r]/g;function r6(e){return""===e.replace(r4,"")}class r8{constructor(e,t){this.attribute=t,this.property=e}}r8.prototype.attribute="",r8.prototype.booleanish=!1,r8.prototype.boolean=!1,r8.prototype.commaOrSpaceSeparated=!1,r8.prototype.commaSeparated=!1,r8.prototype.defined=!1,r8.prototype.mustUseProperty=!1,r8.prototype.number=!1,r8.prototype.overloadedBoolean=!1,r8.prototype.property="",r8.prototype.spaceSeparated=!1,r8.prototype.space=void 0;let r9=0,r7=oa(),oe=oa(),ot=oa(),on=oa(),or=oa(),oo=oa(),oi=oa();function oa(){return 2**++r9}e.s(["boolean",0,r7,"booleanish",0,oe,"commaOrSpaceSeparated",0,oi,"commaSeparated",0,oo,"number",0,on,"overloadedBoolean",0,ot,"spaceSeparated",0,or],83954);var ol=e.i(83954);let os=Object.keys(ol);class ou extends r8{constructor(e,t,n,r){let o=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++o<os.length;){const e=os[o];!function(e,t,n){n&&(e[t]=n)}(this,os[o],(n&ol[e])===ol[e])}}}function oc(e){return e.toLowerCase()}ou.prototype.defined=!0;let od=/[A-Z]/g,of=/-[a-z]/g,oh=/^data[-\w.:]+$/i;function op(e){return"-"+e.toLowerCase()}function om(e){return e.charAt(1).toUpperCase()}let og={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class ox{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function oy(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ox(n,r,t)}function ov(e){let t={},n={};for(let[r,o]of Object.entries(e.properties)){let i=new ou(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[oc(r)]=r,n[oc(i.attribute)]=r}return new ox(t,n,e.space)}ox.prototype.normal={},ox.prototype.property={},ox.prototype.space=void 0;let ob=ov({properties:{ariaActiveDescendant:null,ariaAtomic:oe,ariaAutoComplete:null,ariaBusy:oe,ariaChecked:oe,ariaColCount:on,ariaColIndex:on,ariaColSpan:on,ariaControls:or,ariaCurrent:null,ariaDescribedBy:or,ariaDetails:null,ariaDisabled:oe,ariaDropEffect:or,ariaErrorMessage:null,ariaExpanded:oe,ariaFlowTo:or,ariaGrabbed:oe,ariaHasPopup:null,ariaHidden:oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:or,ariaLevel:on,ariaLive:null,ariaModal:oe,ariaMultiLine:oe,ariaMultiSelectable:oe,ariaOrientation:null,ariaOwns:or,ariaPlaceholder:null,ariaPosInSet:on,ariaPressed:oe,ariaReadOnly:oe,ariaRelevant:null,ariaRequired:oe,ariaRoleDescription:or,ariaRowCount:on,ariaRowIndex:on,ariaRowSpan:on,ariaSelected:oe,ariaSetSize:on,ariaSort:null,ariaValueMax:on,ariaValueMin:on,ariaValueNow:on,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function ow(e,t){return t in e?e[t]:t}function ok(e,t){return ow(e,t.toLowerCase())}let oj=ov({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:or,accessKey:or,action:null,allow:null,allowFullScreen:r7,allowPaymentRequest:r7,allowUserMedia:r7,alt:null,as:null,async:r7,autoCapitalize:null,autoComplete:or,autoFocus:r7,autoPlay:r7,blocking:or,capture:null,charSet:null,checked:r7,cite:null,className:or,cols:on,colSpan:null,content:null,contentEditable:oe,controls:r7,controlsList:or,coords:on|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:r7,defer:r7,dir:null,dirName:null,disabled:r7,download:ot,draggable:oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:r7,formTarget:null,headers:or,height:on,hidden:ot,high:on,href:null,hrefLang:null,htmlFor:or,httpEquiv:or,id:null,imageSizes:null,imageSrcSet:null,inert:r7,inputMode:null,integrity:null,is:null,isMap:r7,itemId:null,itemProp:or,itemRef:or,itemScope:r7,itemType:or,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:r7,low:on,manifest:null,max:null,maxLength:on,media:null,method:null,min:null,minLength:on,multiple:r7,muted:r7,name:null,nonce:null,noModule:r7,noValidate:r7,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:r7,optimum:on,pattern:null,ping:or,placeholder:null,playsInline:r7,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:r7,referrerPolicy:null,rel:or,required:r7,reversed:r7,rows:on,rowSpan:on,sandbox:or,scope:null,scoped:r7,seamless:r7,selected:r7,shadowRootClonable:r7,shadowRootDelegatesFocus:r7,shadowRootMode:null,shape:null,size:on,sizes:null,slot:null,span:on,spellCheck:oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:on,step:null,style:null,tabIndex:on,target:null,title:null,translate:null,type:null,typeMustMatch:r7,useMap:null,value:oe,width:on,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:or,axis:null,background:null,bgColor:null,border:on,borderColor:null,bottomMargin:on,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:r7,declare:r7,event:null,face:null,frame:null,frameBorder:null,hSpace:on,leftMargin:on,link:null,longDesc:null,lowSrc:null,marginHeight:on,marginWidth:on,noResize:r7,noHref:r7,noShade:r7,noWrap:r7,object:null,profile:null,prompt:null,rev:null,rightMargin:on,rules:null,scheme:null,scrolling:oe,standby:null,summary:null,text:null,topMargin:on,valueType:null,version:null,vAlign:null,vLink:null,vSpace:on,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:r7,disableRemotePlayback:r7,prefix:null,property:null,results:on,security:null,unselectable:null},space:"html",transform:ok}),oE=ov({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:oi,accentHeight:on,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:on,amplitude:on,arabicForm:null,ascent:on,attributeName:null,attributeType:null,azimuth:on,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:on,by:null,calcMode:null,capHeight:on,className:or,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:on,diffuseConstant:on,direction:null,display:null,dur:null,divisor:on,dominantBaseline:null,download:r7,dx:null,dy:null,edgeMode:null,editable:null,elevation:on,enableBackground:null,end:null,event:null,exponent:on,externalResourcesRequired:null,fill:null,fillOpacity:on,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:on,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:on,horizOriginX:on,horizOriginY:on,id:null,ideographic:on,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:on,k:on,k1:on,k2:on,k3:on,k4:on,kernelMatrix:oi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:on,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:on,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:on,overlineThickness:on,paintOrder:null,panose1:null,path:null,pathLength:on,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:or,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:on,pointsAtY:on,pointsAtZ:on,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oi,rev:oi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oi,requiredFeatures:oi,requiredFonts:oi,requiredFormats:oi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:on,specularExponent:on,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:on,strikethroughThickness:on,string:null,stroke:null,strokeDashArray:oi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:on,strokeOpacity:on,strokeWidth:null,style:null,surfaceScale:on,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oi,tabIndex:on,tableValues:null,target:null,targetX:on,targetY:on,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:on,underlineThickness:on,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:on,values:null,vAlphabetic:on,vMathematical:on,vectorEffect:null,vHanging:on,vIdeographic:on,version:null,vertAdvY:on,vertOriginX:on,vertOriginY:on,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:on,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ow}),oC=ov({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),oS=ov({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ok}),oN=ov({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),o_=oy([ob,oj,oC,oS,oN],"html"),oM=oy([ob,oE,oC,oS,oN],"svg");var oP=e.i(63185);let oR=oI("end"),oA=oI("start");function oI(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function oD(e){return e&&"object"==typeof e?"position"in e||"type"in e?oT(e.position):"start"in e||"end"in e?oT(e):"line"in e||"column"in e?oO(e):"":""}function oO(e){return oz(e&&e.line)+":"+oz(e&&e.column)}function oT(e){return oO(e&&e.start)+"-"+oO(e&&e.end)}function oz(e){return e&&"number"==typeof e?e:1}class oL extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=oD(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}oL.prototype.file="",oL.prototype.name="",oL.prototype.reason="",oL.prototype.message="",oL.prototype.stack="",oL.prototype.column=void 0,oL.prototype.line=void 0,oL.prototype.ancestors=void 0,oL.prototype.cause=void 0,oL.prototype.fatal=void 0,oL.prototype.place=void 0,oL.prototype.ruleId=void 0,oL.prototype.source=void 0;let oB={}.hasOwnProperty,oF=new Map,o$=/[A-Z]/g,oH=new Set(["table","tbody","thead","tfoot","tr"]),oV=new Set(["td","th"]),oq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oU(e,t,n){var r,o,i,a,l,s,u,c,d;let f,h,p,m,g,x,y,v,b,w,k;return"element"===t.type?(r=e,o=t,i=n,h=f=r.schema,"svg"===o.tagName.toLowerCase()&&"html"===f.space&&(r.schema=oM),r.ancestors.push(o),p=oK(r,o.tagName,!1),m=function(e,t){let n,r,o={};for(r in t.properties)if("children"!==r&&oB.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=oc(t),r=t,o=r8;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&oh.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(of,om);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!of.test(e)){let n=e.replace(od,op);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=ou}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var o;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(o=n)[o.length-1]?[...o,""]:o).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,oP.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new oL("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=oq+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)oB.call(e,t)&&(n[function(e){let t=e.replace(o$,oZ);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?og[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&oV.has(t.tagName)?n=a:o[r]=a}}return n&&((o.style||(o.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),o}(r,o),g=oY(r,o),oH.has(o.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&r6(e.value):r6(e))})),oX(r,m,p,o),oW(m,g),r.ancestors.pop(),r.schema=f,r.create(o,p,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return rJ("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}oG(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,l=t,s=n,y=x=a.schema,"svg"===l.name&&"html"===x.space&&(a.schema=oM),a.ancestors.push(l),v=null===l.name?a.Fragment:oK(a,l.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];rJ("ExpressionStatement"===t.type);let o=t.expression;rJ("ObjectExpression"===o.type);let i=o.properties[0];rJ("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else oG(e,t.position);else{let o,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];rJ("ExpressionStatement"===t.type),o=e.evaluater.evaluateExpression(t.expression)}else oG(e,t.position);else o=null===r.value||r.value;n[i]=o}return n}(a,l),w=oY(a,l),oX(a,b,v,l),oW(b,w),a.ancestors.pop(),a.schema=x,a.create(l,v,b,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oG(e,t.position)}(e,t):"root"===t.type?(u=e,c=t,d=n,oW(k={},oY(u,c)),u.create(c,u.Fragment,k,d)):"text"===t.type?t.value:void 0}function oX(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oW(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function oY(e,t){let n=[],r=-1,o=e.passKeys?new Map:oF;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}let l=oU(e,a,i);void 0!==l&&n.push(l)}return n}function oK(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),o=-1;for(;++o<n.length;){let t=r3(n[o])?{type:"Identifier",name:n[o]}:{type:"Literal",value:n[o]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(o&&"Literal"===t.type),optional:!1}:t}rJ(e,"always a result"),r=e}else r=r3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return oB.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);oG(e)}function oG(e,t){let n=new oL("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=oq+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oZ(e){return"-"+e.toLowerCase()}let oQ={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oJ={};function o0(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return o1(e.children,t,n)}return Array.isArray(e)?o1(e,t,n):""}function o1(e,t,n){let r=[],o=-1;for(;++o<e.length;)r[o]=o0(e[o],t,n);return r.join("")}function o2(e,t,n,r){let o,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(o=Array.from(r)).unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)(o=r.slice(a,a+1e4)).unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function o5(e,t){return e.length>0?(o2(e,e.length,0,t),e):t}let o3={}.hasOwnProperty,o4=is(/[A-Za-z]/),o6=is(/[\dA-Za-z]/),o8=is(/[#-'*+\--9=?A-Z^-~]/);function o9(e){return null!==e&&(e<32||127===e)}let o7=is(/\d/),ie=is(/[\dA-Fa-f]/),it=is(/[!-/:-@[-`{-~]/);function ir(e){return null!==e&&e<-2}function io(e){return null!==e&&(e<0||32===e)}function ii(e){return -2===e||-1===e||32===e}let ia=is(/\p{P}|\p{S}/u),il=is(/\s/);function is(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function iu(e,t,n,r){let o=r?r-1:1/0,i=0;return function(r){return ii(r)?(e.enter(n),function r(a){return ii(a)&&i++<o?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let ic={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let o=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=o),t=o,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return ir(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},id={tokenize:function(e){let t,n,r,o=this,i=[],a=0;return l;function l(t){if(a<i.length){let n=i[a];return o.containerState=n[1],e.attempt(n[0].continuation,s,u)(t)}return u(t)}function s(e){if(a++,o.containerState._closeFlow){let n;o.containerState._closeFlow=void 0,t&&x();let r=o.events.length,i=r;for(;i--;)if("exit"===o.events[i][0]&&"chunkFlow"===o.events[i][1].type){n=o.events[i][1].end;break}g(a);let l=r;for(;l<o.events.length;)o.events[l][1].end={...n},l++;return o2(o.events,i+1,0,o.events.slice(r)),o.events.length=l,u(e)}return l(e)}function u(n){if(a===i.length){if(!t)return f(n);if(t.currentConstruct&&t.currentConstruct.concrete)return p(n);o.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return o.containerState={},e.check(ih,c,d)(n)}function c(e){return t&&x(),g(a),f(e)}function d(e){return o.parser.lazy[o.now().line]=a!==i.length,r=o.now().offset,p(e)}function f(t){return o.containerState={},e.attempt(ih,h,p)(t)}function h(e){return a++,i.push([o.currentConstruct,o.containerState]),f(e)}function p(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||o.parser.flow(o.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return ir(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,o.interrupt=void 0,l):(e.consume(n),t)}(r)}function m(e,i){let l=o.sliceStream(e);if(i&&l.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(l),o.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let l=o.events.length,s=l;for(;s--;)if("exit"===o.events[s][0]&&"chunkFlow"===o.events[s][1].type){if(e){n=o.events[s][1].end;break}e=!0}for(g(a),i=l;i<o.events.length;)o.events[i][1].end={...n},i++;o2(o.events,s+1,0,o.events.slice(l)),o.events.length=i}}function g(t){let n=i.length;for(;n-- >t;){let t=i[n];o.containerState=t[1],t[0].exit.call(o,e)}i.length=t}function x(){t.write([null]),n=void 0,t=void 0,o.containerState._closeFlow=void 0}}},ih={tokenize:function(e,t,n){return iu(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ip={partial:!0,tokenize:function(e,t,n){return function(t){return ii(t)?iu(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||ir(e)?t(e):n(e)}}};class im{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&ig(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ig(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ig(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);ig(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ig(this.left,t.reverse())}}}function ig(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ix(e){let t,n,r,o,i,a,l,s={},u=-1,c=new im(e);for(;++u<c.length;){for(;u in s;)u=s[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,o=e.get(t)[1],i=e.get(t)[2],a=t-1,l=[],s=o._tokenizer;!s&&(s=i.parser[o.contentType](o.start),o._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let u=s.events,c=[],d={},f=-1,h=o,p=0,m=0,g=[0];for(;h;){for(;e.get(++a)[1]!==h;);l.push(a),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=o;++f<u.length;)"exit"===u[f][0]&&"enter"===u[f-1][0]&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(m=f+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){let t=u.slice(g[f],g[f+1]),n=l.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)d[p+c[f][0]]=p+c[f][1],p+=c[f][1]-c[f][0]-1;return d}(c,u)),u=s[u],l=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(o=c.get(r))[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),o[1].type="lineEnding",n=r);else if("linePrefix"===o[1].type||"listItemIndent"===o[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(i=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,i))}}return o2(e,0,1/0,c.slice(0)),!l}let iy={resolve:function(e){return ix(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):ir(t)?e.check(iv,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},iv={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,o,"linePrefix")};function o(o){if(null===o||ir(o))return n(o);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}},ib={tokenize:function(e){let t=this,n=e.attempt(ip,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,iu(e,e.attempt(this.parser.constructs.flow,r,e.attempt(iy,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},iw={resolveAll:iC()},ik=iE("string"),ij=iE("text");function iE(e){return{resolveAll:iC("text"===e?iS:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return s(e)?o(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),l)}function l(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),l)}function s(e){if(null===e)return!0;let t=r[e],o=-1;if(t)for(;++o<t.length;){let e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function iC(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function iS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,o=e[n-1][1],i=t.sliceStream(o),a=i.length,l=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)s++,l--;if(l)break;l=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:o.start._bufferIndex+l,_index:o.start._index+a,line:o.end.line,column:o.end.column-s,offset:o.end.offset-s},end:{...o.end}};o.end={...i.start},o.start.offset===o.end.offset?Object.assign(o,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function iN(e){return null===e||io(e)||il(e)?1:ia(e)?2:void 0}function i_(e,t,n){let r=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let iM={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,l,s,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[c][1].start};iP(d,-l),iP(f,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:l>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[c][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=o5(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=o5(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),s=o5(s,i_(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=o5(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,s=o5(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,o2(e,n-1,c-n+3,s),c=n+s.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,o=this.previous,i=iN(o);return function(a){return n=a,e.enter("attentionSequence"),function a(l){if(l===n)return e.consume(l),a;let s=e.exit("attentionSequence"),u=iN(l),c=!u||2===u&&i||r.includes(l),d=!i||2===i&&u||r.includes(o);return s._open=!!(42===n?c:c&&(i||!d)),s._close=!!(42===n?d:d&&(u||!c)),t(l)}(a)}}};function iP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let iR={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return ii(t)?iu(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(iR,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return ii(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},iA={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return it(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},iI=document.createElement("i");function iD(e){let t="&"+e+";";iI.innerHTML=t;let n=iI.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let iO={name:"characterReference",tokenize:function(e,t,n){let r,o,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,o=o6,u(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=ie,u):(e.enter("characterReferenceValue"),r=7,o=o7,u(t))}function u(l){if(59===l&&a){let r=e.exit("characterReferenceValue");return o!==o6||iD(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return o(l)&&a++<r?(e.consume(l),u):n(l)}}},iT={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},iz={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,o=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),ii(t)?iu(e,s,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(o){return o===r?(i++,e.consume(o),t):i>=l?(e.exit("codeFencedFenceSequence"),ii(o)?iu(e,u,"whitespace")(o):u(o)):n(o)}(t)):n(t)}function u(r){return null===r||ir(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,l=0;return function(t){var i;let u;return i=t,a=(u=o.events[o.events.length-1])&&"linePrefix"===u[1].type?u[2].sliceSerialize(u[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(o){return o===r?(l++,e.consume(o),t):l<3?n(o):(e.exit("codeFencedFenceSequence"),ii(o)?iu(e,s,"whitespace")(o):s(o))}(i)};function s(i){return null===i||ir(i)?(e.exit("codeFencedFence"),o.interrupt?t(i):e.check(iT,c,p)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(o){return null===o||ir(o)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(o)):ii(o)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),iu(e,u,"whitespace")(o)):96===o&&o===r?n(o):(e.consume(o),t)}(i))}function u(t){return null===t||ir(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(o){return null===o||ir(o)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(o)):96===o&&o===r?n(o):(e.consume(o),t)}(t))}function c(t){return e.attempt(i,p,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return a>0&&ii(t)?iu(e,h,"linePrefix",a+1)(t):h(t)}function h(t){return null===t||ir(t)?e.check(iT,c,p)(t):(e.enter("codeFlowValue"),function t(n){return null===n||ir(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function p(n){return e.exit("codeFenced"),t(n)}}},iL={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),iu(e,o,"linePrefix",5)(t)};function o(t){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?function t(n){return null===n?i(n):ir(n)?e.attempt(iB,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||ir(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},iB={partial:!0,tokenize:function(e,t,n){let r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):iu(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):ir(e)?o(e):n(e)}}};function iF(e,t,n,r,o,i,a,l,s){let u=s||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||o9(t)?n(t):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),p(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(l),d(t)):null===t||60===t||ir(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(o){return!c&&(null===o||41===o||io(o))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(o)):c<u&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||o9(o)?n(o):(e.consume(o),92===o?m:p)}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function i$(e,t,n,r,o,i){let a,l=this,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):ir(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||ir(t)||s++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a||(a=!ii(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function iH(e,t,n,r,o,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,l):n(t)};function l(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),l(a)):null===t?n(t):ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),iu(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||ir(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function iV(e,t){let n;return function r(o){return ir(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ii(o)?iu(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function iq(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let iU={partial:!0,tokenize:function(e,t,n){return function(t){return io(t)?iV(e,r)(t):n(t)};function r(t){return iH(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ii(t)?iu(e,i,"whitespace")(t):i(t)}function i(e){return null===e||ir(e)?t(e):n(e)}}},iX=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],iW=["pre","script","style","textarea"],iY={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ip,t,n)}}},iK={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return ir(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},iG={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&o2(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,i,a=e.length,l=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){l=2;break}}else"labelEnd"===n.type&&(o=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+l+2][1].end},end:{...e[o-2][1].start}};return i=o5(i=[["enter",s,t],["enter",u,t]],e.slice(r+1,r+l+3)),i=o5(i,[["enter",c,t]]),i=o5(i,i_(t.parser.constructs.insideSpan.null,e.slice(r+l+4,o-3),t)),i=o5(i,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),i=o5(i,e.slice(o+1)),i=o5(i,[["exit",s,t]]),o2(e,r,e.length,i),e},tokenize:function(e,t,n){let r,o,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?c(t):(o=i.parser.defined.includes(iq(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),l):n(t)};function l(t){return 40===t?e.attempt(iZ,u,o?u:c)(t):91===t?e.attempt(iQ,u,o?s:c)(t):o?u(t):c(t)}function s(t){return e.attempt(iJ,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},iZ={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return io(t)?iV(e,o)(t):o(t)}function o(t){return 41===t?u(t):iF(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return io(t)?iV(e,l)(t):u(t)}function a(e){return n(e)}function l(t){return 34===t||39===t||40===t?iH(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function s(t){return io(t)?iV(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},iQ={tokenize:function(e,t,n){let r=this;return function(t){return i$.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(iq(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},iJ={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},i0={name:"labelStartImage",resolveAll:iG.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},i1={name:"labelStartLink",resolveAll:iG.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},i2={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),iu(e,t,"linePrefix")}}},i5={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),o++,t):(e.exit("thematicBreakSequence"),ii(n)?iu(e,i,"whitespace")(n):i(n))}(a)):o>=3&&(null===a||ir(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},i3={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ip,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,iu(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ii(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i6,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,iu(e,e.attempt(i3,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){let o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:o7(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(i5,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(o){return o7(o)&&++a<10?(e.consume(o),t):(!r.interrupt||a<2)&&(r.containerState.marker?o===r.containerState.marker:41===o||46===o)?(e.exit("listItemValue"),l(o)):n(o)}(t)}return n(t)};function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(ip,r.interrupt?n:s,e.attempt(i4,c,u))}function s(e){return r.containerState.initialBlankLine=!0,i++,c(e)}function u(t){return ii(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},i4={partial:!0,tokenize:function(e,t,n){let r=this;return iu(e,function(e){let o=r.events[r.events.length-1];return!ii(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},i6={partial:!0,tokenize:function(e,t,n){let r=this;return iu(e,function(e){let o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},i8={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,o=this;return function(t){var a;let l,s=o.events.length;for(;s--;)if("lineEnding"!==o.events[s][1].type&&"linePrefix"!==o.events[s][1].type&&"content"!==o.events[s][1].type){l="paragraph"===o.events[s][1].type;break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),ii(n)?iu(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||ir(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,o=this;return function(t){var r;return e.enter("definition"),r=t,i$.call(o,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=iq(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return io(t)?iV(e,l)(t):l(t)}function l(t){return iF(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(iU,u,u)(t)}function u(t){return ii(t)?iu(e,c,"whitespace")(t):c(t)}function c(i){return null===i||ir(i)?(e.exit("definition"),o.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:i3,43:i3,45:i3,48:i3,49:i3,50:i3,51:i3,52:i3,53:i3,54:i3,55:i3,56:i3,57:i3,62:iR},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},o2(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(o){var i;return e.enter("atxHeading"),i=o,e.enter("atxHeadingSequence"),function o(i){return 35===i&&r++<6?(e.consume(i),o):null===i||io(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||ir(r)?(e.exit("atxHeading"),t(r)):ii(r)?iu(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||io(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:i5,45:[i8,i5],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,o,i,a,l,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),u};function u(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),o=!0,h):63===a?(e.consume(a),r=3,s.interrupt?t:A):o4(a)?(e.consume(a),i=String.fromCharCode(a),p):n(a)}function c(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,a=0,f):o4(o)?(e.consume(o),r=4,s.interrupt?t:A):n(o)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:A):n(r)}function f(r){let o="CDATA[";return r===o.charCodeAt(a++)?(e.consume(r),a===o.length)?s.interrupt?t:E:f:n(r)}function h(t){return o4(t)?(e.consume(t),i=String.fromCharCode(t),p):n(t)}function p(a){if(null===a||47===a||62===a||io(a)){let l=47===a,u=i.toLowerCase();return!l&&!o&&iW.includes(u)?(r=1,s.interrupt?t(a):E(a)):iX.includes(i.toLowerCase())?(r=6,l)?(e.consume(a),m):s.interrupt?t(a):E(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):o?function t(n){return ii(n)?(e.consume(n),t):k(n)}(a):g(a))}return 45===a||o6(a)?(e.consume(a),i+=String.fromCharCode(a),p):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:E):n(r)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||o4(t)?(e.consume(t),x):ii(t)?(e.consume(t),g):k(t)}function x(t){return 45===t||46===t||58===t||95===t||o6(t)?(e.consume(t),x):y(t)}function y(t){return 61===t?(e.consume(t),v):ii(t)?(e.consume(t),y):g(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,b):ii(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||io(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===l?(e.consume(t),l=null,w):null===t||ir(t)?n(t):(e.consume(t),b)}function w(e){return 47===e||62===e||ii(e)?g(e):n(e)}function k(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||ir(t)?E(t):ii(t)?(e.consume(t),j):n(t)}function E(t){return 45===t&&2===r?(e.consume(t),_):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),I):63===t&&3===r?(e.consume(t),A):93===t&&5===r?(e.consume(t),R):ir(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(iY,D,C)(t)):null===t||ir(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),E)}function C(t){return e.check(iK,S,D)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||ir(t)?C(t):(e.enter("htmlFlowData"),E(t))}function _(t){return 45===t?(e.consume(t),A):E(t)}function M(t){return 47===t?(e.consume(t),i="",P):E(t)}function P(t){if(62===t){let n=i.toLowerCase();return iW.includes(n)?(e.consume(t),I):E(t)}return o4(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),P):E(t)}function R(t){return 93===t?(e.consume(t),A):E(t)}function A(t){return 62===t?(e.consume(t),I):45===t&&2===r?(e.consume(t),A):E(t)}function I(t){return null===t||ir(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),I)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:i8,95:i5,96:iz,126:iz},"flowInitial",0,{[-2]:iL,[-1]:iL,32:iL},"insideSpan",0,{null:[iM,iw]},"string",0,{38:iO,92:iA},"text",0,{[-5]:i2,[-4]:i2,[-3]:i2,33:i0,38:iO,42:iM,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return o4(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(t){return 43===t||45===t||46===t||o6(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||o6(n))&&r++<32?(e.consume(n),t):(r=0,l(n))}(t)):l(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||o9(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),s):o8(t)?(e.consume(t),l):n(t)}function s(o){return o6(o)?function o(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||o6(i))&&r++<63){let n=45===i?t:o;return e.consume(i),n}return n(i)}(i)}(o):n(o)}}},{name:"htmlText",tokenize:function(e,t,n){let r,o,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),b):63===t?(e.consume(t),y):o4(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),o=0,h):o4(t)?(e.consume(t),x):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):ir(t)?(i=c,P(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?M(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(o++)?(e.consume(t),o===r.length?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):ir(t)?(i=p,P(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?M(t):93===t?(e.consume(t),g):p(t)}function x(t){return null===t||62===t?M(t):ir(t)?(i=x,P(t)):(e.consume(t),x)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):ir(t)?(i=y,P(t)):(e.consume(t),y)}function v(e){return 62===e?M(e):y(e)}function b(t){return o4(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||o6(t)?(e.consume(t),w):function t(n){return ir(n)?(i=t,P(n)):ii(n)?(e.consume(n),t):M(n)}(t)}function k(t){return 45===t||o6(t)?(e.consume(t),k):47===t||62===t||io(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),M):58===t||95===t||o4(t)?(e.consume(t),E):ir(t)?(i=j,P(t)):ii(t)?(e.consume(t),j):M(t)}function E(t){return 45===t||46===t||58===t||95===t||o6(t)?(e.consume(t),E):function t(n){return 61===n?(e.consume(n),C):ir(n)?(i=t,P(n)):ii(n)?(e.consume(n),t):j(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):ir(t)?(i=C,P(t)):ii(t)?(e.consume(t),C):(e.consume(t),N)}function S(t){return t===r?(e.consume(t),r=void 0,_):null===t?n(t):ir(t)?(i=S,P(t)):(e.consume(t),S)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||io(t)?j(t):(e.consume(t),N)}function _(e){return 47===e||62===e||io(e)?j(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return ii(t)?iu(e,A,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return e.enter("htmlTextData"),i(t)}}}],91:i1,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return ir(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},iA],93:iG,95:iM,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(("lineEnding"===e[3][1].type||"space"===e[o][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(o=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(o.type="codeTextData",l(a))}(s)):ir(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(s))}function l(t){return null===t||32===t||96===t||ir(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}}}}],19210);var i9=e.i(19210);let i7=/[\0\t\n\r]/g;function ae(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let at=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function an(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return ae(n.slice(t?2:1),t?16:10)}return iD(n)||e}let ar={}.hasOwnProperty;function ao(e){return{line:e.line,column:e.column,offset:e.offset}}function ai(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+oD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oD({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+oD({start:t.start,end:t.end})+") is still open")}function aa(e){let t=this;t.parser=function(n){var r,o;let i,a,l,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(o=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(p),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(h,o),codeText:r(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,o),htmlFlowData:u,htmlText:r(g,o),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(p),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=ae(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=iD(n);let o=this.stack[this.stack.length-1];o.value+=t},characterReference:function(e){this.stack.pop().position.end=ao(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iq(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(at,an),n.identifier=iq(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=ao(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),c.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iq(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let o=n[r];Array.isArray(o)?e(t,o):function(e,t){let n;for(n in t)if(ar.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,o)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:l,buffer:o,resume:s,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,o,i,a,l=t-1,s=-1,u=!1;for(;++l<=n;){let t=e[l];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=l;for(o=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||l,0,["exit",r,t[2]]),l++,n++}if("listItemPrefix"===t[1].type){let o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(l,0,["enter",o,t[2]]),l++,n++,i=void 0,a=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];ar.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},a),e[c][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ai).call(a,void 0,e[0])}for(r.position={start:ao(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ao(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ao(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ai).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+oD({start:e.start,end:e.end})+"): it’s not open");n.position.end=ao(e.end)}function s(){var e;return e=this.stack.pop(),o0(e,"boolean"!=typeof oJ.includeImageAlt||oJ.includeImageAlt,"boolean"!=typeof oJ.includeHtml||oJ.includeHtml)}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:ao(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ao(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function p(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(o)(function(e){for(;!ix(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,o=(o3.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){o3.call(o,r)||(o[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);o2(e,0,0,r)}(o[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([i9,...(e||{}).extensions||[]]),content:n(ic),defined:[],document:n(id),flow:n(ib),lazy:{},string:n(ik),text:n(ij)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},o={},i=[],a=[],l=[],s={attempt:p(function(e,t){m(e,t.from)}),check:p(h),consume:function(e){ir(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),l.push(n),n},exit:function(e){let t=l.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:p(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,o=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,o.push(i)}return o.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=o5(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==a[a.length-1])?[]:(m(t,0),u.events=i_(i,u.events,u),u.events)}},c=t.tokenize.call(u,s);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){let n,r=t.start._index,o=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(o,a)];else{if(n=e.slice(r,i),o>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(o):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function f(){let{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(e,t){t.restore()}function p(e,t){return function(n,o,i){var a;let c,d,h,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(c=e,d=0,0===e.length)?i:x(e[d])}function x(e){return function(n){let o,i,a,c,d;return(o=f(),i=u.previous,a=u.currentConstruct,c=u.events.length,d=Array.from(l),p={from:c,restore:function(){r=o,u.previous=i,u.currentConstruct=a,u.events.length=c,l=d,g()}},h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,s,y,v)(n)}}function y(t){return e(h,p),o}function v(e){return(p.restore(),++d<c.length)?x(c[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&o2(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function g(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}(t,e,n)}}})(o).document().write((a=1,l="",s=!0,function(e,t,n){let r,o,u,c,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,l="",s&&(65279===e.charCodeAt(0)&&u++,s=void 0);u<e.length;){if(i7.lastIndex=u,c=(r=i7.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){l=e.slice(u);break}if(10===d&&u===c&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),u<c&&(f.push(e.slice(u,c)),a+=c-u),d){case 0:f.push(65533),a++;break;case 9:for(o=4*Math.ceil(a/4),f.push(-2);a++<o;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:i=!0,a=1}u=c+1}return n&&(i&&f.push(-5),l&&f.push(l),f.push(null)),f})(n,r,!0))))}}let al="object"==typeof self?self:globalThis,as=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=o=>{if(t.has(o))return t.get(o);let[i,a]=e[o];switch(i){case 0:case -1:return n(a,o);case 1:{let e=n([],o);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},o);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{let e=n(new Map,o);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,o);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new al[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new al[i](a),o)})(0)},{toString:au}={},{keys:ac}=Object,ad=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=au.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},af=([e,t])=>0===e&&("function"===t||"symbol"===t),ah=(e,{json:t,lossy:n}={})=>{var r,o,i;let a,l,s=[];return(r=!(t||n),o=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},l=e=>{if(i.has(e))return i.get(e);let[t,n]=ad(e);switch(t){case 0:{let o=e;switch(n){case"bigint":t=8,o=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);o=null;break;case"undefined":return a([-1],e)}return a([t,o],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],o=a([t,r],e);for(let t of e)r.push(l(t));return o}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(o&&"toJSON"in e)return l(e.toJSON());let i=[],s=a([t,i],e);for(let t of ac(e))(r||!af(ad(e[t])))&&i.push([l(t),l(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],o=a([t,n],e);for(let[t,o]of e)(r||!(af(ad(t))||af(ad(o))))&&n.push([l(t),l(o)]);return o}case 6:{let n=[],o=a([t,n],e);for(let t of e)(r||!af(ad(t)))&&n.push(l(t));return o}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},ap="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?as(ah(e,t)):structuredClone(e):(e,t)=>as(ah(e,t));function am(e){let t=[],n=-1,r=0,o=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&o6(e.charCodeAt(n+1))&&o6(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ag(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ax(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let ay=function(e){var t,n;if(null==e)return ab;if("function"==typeof e)return av(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ay(e[n]);return av(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,av(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,av(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function av(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function ab(){return!0}let aw=[];function ak(e,t,n,r){var o,i,a;let l,s,u,c,d,f;"function"==typeof t&&"function"!=typeof n?(s=void 0,u=t,l=n):(s=t,u=n,l=r),o=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return u(e,r,n)},a=l,"function"==typeof o&&"function"!=typeof i?(a=i,i=o):c=o,d=ay(c),f=a?-1:1,(function e(t,n,r){let l=t&&"object"==typeof t?t:{};if("string"==typeof l.type){let e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var l;let s,u,c,h=aw;if((!o||d(t,n,r[r.length-1]||void 0))&&!1===(h=Array.isArray(l=i(t,r))?l:"number"==typeof l?[!0,l]:null==l?aw:[l])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(u=(a?t.children.length:-1)+f,c=r.concat(t);u>-1&&u<t.children.length;){if(!1===(s=e(t.children[u],u,c)())[0])return s;u="number"==typeof s[1]?s[1]:u+f}return h}})(e,void 0,[])()}function aj(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});let a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function aE(e){let t=e.spread;return null==t?e.children.length>1:t}function aC(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}let aS={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",o=String(t.identifier).toUpperCase(),i=am(o.toLowerCase()),a=e.footnoteOrder.indexOf(o),l=e.footnoteCounts.get(o);void 0===l?(l=0,e.footnoteOrder.push(o),n=e.footnoteOrder.length):n=a+1,l+=1,e.footnoteCounts.set(o,l);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aj(e,t);let o={src:am(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);let i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:am(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aj(e,t);let o={href:am(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);let i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:am(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=aE(n[r])}return t}(n):aE(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<r.length;){let e=r[l];(o||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){let e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),o=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=oA(t.children[1]),a=oR(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,l=-1,s=[];for(;++l<a;){let n=t.children[l],r={},a=i?i[l]:void 0;a&&(r.align=a);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),s.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),o=0,i=[];for(;r;)i.push(aC(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(aC(t.slice(o),o>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:aN,yaml:aN,definition:aN,footnoteDefinition:aN};function aN(){}let a_={}.hasOwnProperty,aM={};function aP(e,t){e.position&&(t.position=function(e){let t=oA(e),n=oR(e);if(t&&n)return{start:t,end:n}}(e))}function aR(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&o&&Object.assign(n.properties,ap(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function aA(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function aI(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function aD(e,t){let n,r,o,i,a=(n=t||aM,r=new Map,o=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let o=i.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=aI(o.value)),!Array.isArray(o)&&"element"===o.type)){let e=o.children[0];e&&"text"===e.type&&(e.value=aI(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:aR,definitionById:r,footnoteById:o,footnoteCounts:new Map,footnoteOrder:[],handlers:{...aS,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(a_.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=ap(n);return r.children=i.all(e),r}return ap(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(a_.call(n,"hProperties")||a_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:aP,wrap:aA},ak(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),l=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ag,r=e.options.footnoteBackLabel||ax,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],s=-1;for(;++s<e.footnoteOrder.length;){let o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;let i=e.all(o),a=String(o.identifier).toUpperCase(),u=am(a.toLowerCase()),c=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(o,p),l.push(p)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ap(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&(rJ("children"in u),u.children.push({type:"text",value:"\n"},s)),u}function aO(e,t){return e&&"run"in e?async function(n,r){let o=aD(n,{file:r,...t});await e.run(o,r)}:function(n,r){return aD(n,{file:r,...e||t})}}function aT(e){if(e)throw e}var az=e.i(75609);function aL(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let aB=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');aV(e);let r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(o=i):(l=-1,o=a));return r===o?o=a:o<0&&(o=e.length),e.slice(r,o)},aF=function(e){let t;if(aV(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},a$=function(e){let t;aV(e);let n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){let l=e.codePointAt(n);if(47===l){if(t){o=n+1;break}continue}r<0&&(t=!0,r=n+1),46===l?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===o+1?"":e.slice(i,r)},aH=function(...e){var t;let n,r,o,i=-1;for(;++i<e.length;)aV(e[i]),e[i]&&(o=void 0===o?e[i]:o+"/"+e[i]);return void 0===o?".":(aV(t=o),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,o="",i=0,a=-1,l=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===l);else if(a!==s-1&&2===l){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2)){if(o.length>2){if((r=o.lastIndexOf("/"))!==o.length-1){r<0?(o="",i=0):i=(o=o.slice(0,r)).length-1-o.lastIndexOf("/"),a=s,l=0;continue}}else if(o.length>0){o="",i=0,a=s,l=0;continue}}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,s):o=e.slice(a+1,s),i=s-a-1;a=s,l=0}else 46===n&&l>-1?l++:l=-1}return o}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function aV(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function aq(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let aU=["history","path","basename","stem","extname","dirname"];class aX{constructor(e){let t,n;t=e?aq(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<aU.length;){const e=aU[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)aU.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?aB(this.path):void 0}set basename(e){aY(e,"basename"),aW(e,"basename"),this.path=aH(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?aF(this.path):void 0}set dirname(e){aK(this.basename,"dirname"),this.path=aH(e||"",this.basename)}get extname(){return"string"==typeof this.path?a$(this.path):void 0}set extname(e){if(aW(e,"extname"),aK(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=aH(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){aq(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!aq(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),aY(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?aB(this.path,this.extname):void 0}set stem(e){aY(e,"stem"),aW(e,"stem"),this.path=aH(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new oL(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function aW(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function aY(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function aK(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let aG=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},aZ={}.hasOwnProperty;class aQ extends aG{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function o(i,...a){let l=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,l?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(o,r):i instanceof Error?r(i):o(i))};function r(e,...o){n||(n=!0,t(e,...o))}function o(e){r(null,e)}})(l,o)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new aQ,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,az.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(a2("data",this.frozen),this.namespace[e]=t,this):aZ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(a2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=a4(e),n=this.parser||this.Parser;return a0("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),a0("process",this.parser||this.Parser),a1("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){let i=a4(e),a=n.parse(i);function l(e,n){e||!n?o(e):r?r(n):(rJ(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var o,i;if(e||!t||!r)return l(e);let a=n.stringify(t,r);"string"==typeof(o=a)||(i=o)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,l(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),a0("processSync",this.parser||this.Parser),a1("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,aT(e),t=r}),a3("processSync","process",n),rJ(t,"we either bailed on an error or have a tree"),t}run(e,t,n){a5(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){rJ("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=a4(t);r.run(e,a,function(t,r,a){let l=r||e;t?i(t):o?o(l):(rJ(n,"`done` is defined if `resolve` is not"),n(void 0,l,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){aT(e),n=t,r=!0}),a3("runSync","run",r),rJ(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=a4(t),r=this.compiler||this.Compiler;return a1("stringify",r),a5(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(a2("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function o(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,az.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else o(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[o][1];aL(a)&&aL(r)&&(r=(0,az.default)(!0,a,r)),n[o]=[e,r,...i]}}}}let aJ=new aQ().freeze();function a0(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function a1(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function a2(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function a5(e){if(!aL(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function a3(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function a4(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new aX(e)}let a6=[],a8={allowDangerousHtml:!0},a9=/^(https?|ircs?|mailto|xmpp)$/i,a7=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function le(e){var n;let r,o,i,a,l,s=(r=(n=e).rehypePlugins||a6,o=n.remarkPlugins||a6,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...a8}:a8,aJ().use(aa).use(o).use(aO,i).use(r)),u=(a=e.children||"",l=new aX,"string"==typeof a?l.value=a:r0("Unexpected value `"+a+"` for `children` prop, expected `string`"),l);return function(e,n){let r=n.allowedElements,o=n.allowElement,i=n.components,a=n.disallowedElements,l=n.skipHtml,s=n.unwrapDisallowed,u=n.urlTransform||lt;for(let e of a7)Object.hasOwn(n,e.from)&&r0("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&r0("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),ak(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return l?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in oQ)if(Object.hasOwn(oQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=oQ[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&o&&"number"==typeof t&&(i=!o(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,o,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=l,r=t.jsxDEV,a=function(e,t,o,i){let a=Array.isArray(o.children),l=oA(e);return r(t,o,i,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");o=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:o;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?oM:o_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=oU(s,e,void 0);return u&&"string"!=typeof u?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(u),u),e)}function lt(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return -1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||a9.test(e.slice(0,t))?e:""}let ln=(0,s.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),lr=(0,s.default)("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"}]]),lo={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function li({decision:e,index:n}){let[o,i]=(0,r.useState)(!1),a=(0,eW.useSoundAction)("expand"),l=(0,eW.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(eK.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(le,{components:lo,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{o?l.play():a.play(),i(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(nD,{className:`h-3.5 w-3.5 transition-transform ${o?"rotate-90":""}`}),(0,t.jsx)(lr,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),o?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function la({data:e,onApprove:n,onReject:r,isProcessing:o=!1,isRejecting:i=!1}){let{summary:a,decisions:l}=e;return 0===l.length?null:(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),a?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:a}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(ln,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),l.map((e,n)=>(0,t.jsx)(li,{decision:e,index:n},e.title))]}),(0,t.jsx)(rZ,{onReject:r,onApprove:n,approveLabel:"Approve Plan",approveIcon:(0,t.jsx)(e4.Check,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:o,isRejecting:i})]})}let ll=(0,s.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ls=(0,s.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var lu=e.i(49228);let lc=(0,s.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function ld({phases:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(lr,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Implementation Phases"})]}),(0,t.jsx)("ol",{className:"space-y-2",children:e.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-emerald-100 text-[10px] font-bold text-emerald-700",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px] leading-relaxed",children:e.description}):null]})]},e.id))})]})})}function lf({data:e,onApprove:n,onReject:r,isProcessing:o=!1,isRejecting:i=!1}){let{pr:a,diffSummary:l,phases:s,branch:u,warning:c}=e;return(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:a?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),u?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(lu.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(eK.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:u.source}),(0,t.jsx)(lc,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(eK.Badge,{variant:"outline",className:"font-mono text-[11px]",children:u.target})]})}):null,a?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",a.number,(0,t.jsx)(eB.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eK.Badge,{variant:"outline",className:"text-xs",children:a.status})]}),a.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(e2,{status:a.ciStatus})]}):null,a.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eF,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a.commitHash.slice(0,7)})]})]}):null]})}):null,l?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(ls,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:l.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",l.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",l.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:l.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(ll,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:c})]})}):null,s&&s.length>0?(0,t.jsx)(ld,{phases:s}):null]}),(0,t.jsx)(rZ,{onReject:r,onApprove:n,approveLabel:"Approve Merge",approveIcon:o?(0,t.jsx)(ee.Loader2,{className:"mr-1.5 h-4 w-4 animate-spin"}):(0,t.jsx)(f,{className:"mr-1.5 h-4 w-4"}),revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:o,isRejecting:i})]})}function lh({view:e,onClose:n,onDelete:o,isDeleting:a,onCreateSubmit:l,isSubmitting:s}){let u,[c,d]=(0,r.useState)(null),[f,m]=(0,r.useState)({}),[g,x]=(0,r.useState)(!1),[y,v]=(0,r.useState)(null),[b,w]=(0,r.useState)(!1),[k,j]=(0,r.useState)(null),[E,C]=(0,r.useState)(!1),[S,N]=(0,r.useState)(!1),_=(0,eW.useSoundAction)("reject"),M=e?.type==="prd-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(m({}),d(null),!M)return;let e=!1;return x(!0),eq(M).then(t=>{if(!e){if(t.error)return void eL.toast.error(t.error);if(t.questionnaire){d(t.questionnaire);let e={};for(let n of t.questionnaire.questions){let t=n.options.find(e=>e.recommended);t&&(e[n.id]=t.id)}m(e)}}}).catch(()=>{e||eL.toast.error("Failed to load questionnaire")}).finally(()=>{e||x(!1)}),()=>{e=!0}},[M]);let P=e?.type==="tech-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(v(null),!P)return;let e=!1;return w(!0),eU(P).then(t=>{if(!e){if(t.error)return void eL.toast.error(t.error);t.techDecisions&&v(t.techDecisions)}}).catch(()=>{e||eL.toast.error("Failed to load tech decisions")}).finally(()=>{e||w(!1)}),()=>{e=!0}},[P]);let R=e?.type==="merge-review"?e.node.featureId:null;(0,r.useEffect)(()=>{if(j(null),!R)return;let e=!1;return C(!0),eX(R).then(t=>{if(!e){if("error"in t)return void eL.toast.error(t.error);j(t)}}).catch(()=>{e||eL.toast.error("Failed to load merge review data")}).finally(()=>{e||C(!1)}),()=>{e=!0}},[R]);let A=e?.type==="prd-review"||e?.type==="tech-review"||e?.type==="merge-review"?e.node:null,I=(0,r.useCallback)(async(e,t,r)=>{if(A?.featureId){N(!0);try{let o=await eV(A.featureId,e);if(!o.rejected)return void eL.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);_.play(),eL.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&eL.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),n(),r?.()}finally{N(!1)}}},[A,n,_]),D=(0,r.useCallback)(e=>I(e,"Requirements",()=>m({})),[I]),O=(0,r.useCallback)(e=>I(e,"Plan"),[I]),T=(0,r.useCallback)(e=>I(e,"Merge"),[I]),z=(0,r.useCallback)(async e=>{if(!A?.featureId)return;let t=await eH(A.featureId);t.approved?(eL.toast.success(`${e} approved — agent resuming`),n()):eL.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[A,n]),L=(0,r.useCallback)(async t=>{let r;if(e?.type!=="prd-review")return;if(c){let e=[];for(let[t,n]of Object.entries(f)){let r=c.questions.find(e=>e.id===t),o=r?.options.find(e=>e.id===n);r&&o&&e.push({questionId:r.question,selectedOption:o.label})}r={approved:!0,changedSelections:e}}let o=await eH(e.node.featureId,r);o.approved?(eL.toast.success("Requirements approved — agent resuming"),m({}),n()):eL.toast.error(o.error??"Failed to approve requirements")},[e,c,f,n]),B=(0,r.useCallback)(()=>z("Plan"),[z]),F=(0,r.useCallback)(()=>z("Merge"),[z]),$=e?.type==="feature-create",q=$?e:null,U=e?.type==="feature"||e?.type==="prd-review"||e?.type==="tech-review"||e?.type==="merge-review"?e.node:null,et=e?.type==="repository"?e.data:null,en=U?.repositoryPath&&U?.branch?{repositoryPath:U.repositoryPath,branch:U.branch,specPath:U.specPath}:null,er=function(e){let[t,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=p.current,t=m.current,n=g.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),n&&clearTimeout(n)}},[]);let x=(0,r.useCallback)(async(t,n,r,o,i)=>{if(e&&!i){o.current&&clearTimeout(o.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),o.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),o.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,r.useCallback)(()=>x(e_,n,u,p,t),[x,t]),openInShell:(0,r.useCallback)(()=>x(eM,i,d,m,o),[x,o]),openSpecsFolder:(0,r.useCallback)(async()=>{if(e?.specPath&&!a){g.current&&clearTimeout(g.current),l(!0),h(null);try{let t=await eP(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";h(e),g.current=setTimeout(()=>h(null),5e3)}}catch(e){h(e instanceof Error?e.message:"An unexpected error occurred"),g.current=setTimeout(()=>h(null),5e3)}finally{l(!1)}}},[e,a]),ideLoading:t,shellLoading:o,specsLoading:a,ideError:s,shellError:c,specsError:f}}(en),eo=eR(et?.repositoryPath?{repositoryPath:et.repositoryPath}:null),ea=U?.repositoryPath&&U.branch?{targetId:U.featureId,targetType:"feature",repositoryPath:U.repositoryPath,branch:U.branch}:null,es=et?.repositoryPath?{targetId:et.repositoryPath,targetType:"repository",repositoryPath:et.repositoryPath}:void 0,eu=(0,eC.useDeployAction)(ea),ec="Booting"===eu.status||"Ready"===eu.status;U?u=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-header",children:[(0,t.jsx)(eI.DrawerTitle,{children:U.name}),U.description?(0,t.jsx)(eI.DrawerDescription,{children:U.description}):U.featureId?(0,t.jsx)(eI.DrawerDescription,{className:"sr-only",children:U.featureId}):null]}),en?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,t.jsx)(nH,{actions:er,repositoryPath:en.repositoryPath,showSpecs:!!en.specPath}),eS.featureFlags.envDeploy&&ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.TooltipProvider,{children:(0,t.jsxs)(J.Tooltip,{children:[(0,t.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(ej.ActionButton,{label:ec?"Stop Dev Server":"Start Dev Server",onClick:ec?eu.stop:eu.deploy,loading:eu.deployLoading||eu.stopLoading,error:!!eu.deployError,icon:ec?ek.Square:ew.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(J.TooltipContent,{children:ec?"Stop Dev Server":"Start Dev Server"})]})}),ec?(0,t.jsx)(eE.DeploymentStatusBadge,{status:eu.status,url:eu.url}):null]}):null,o&&U.featureId?(0,t.jsxs)(H,{children:[(0,t.jsx)(V,{asChild:!0,children:(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:a,className:"text-muted-foreground hover:text-destructive ml-auto","data-testid":"feature-drawer-delete",children:a?(0,t.jsx)(ee.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(h,{className:"size-4"})})}),(0,t.jsxs)(X,{children:[(0,t.jsxs)(W,{children:[(0,t.jsx)(K,{children:"Delete feature?"}),(0,t.jsxs)(G,{children:["This will permanently delete ",(0,t.jsx)("strong",{children:U.name})," (",U.featureId,"). This action cannot be undone.","running"===U.state?(0,t.jsx)(t.Fragment,{children:" This feature has a running agent that will be stopped."}):null]})]}),(0,t.jsxs)(Y,{children:[(0,t.jsx)(Q,{disabled:a,children:"Cancel"}),(0,t.jsx)(Z,{variant:"destructive",disabled:a,onClick:()=>o(U.featureId),children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting…"]}):"Delete"})]})]})]}):null]}):null]}):et&&(u=(0,t.jsxs)("div",{"data-testid":"repository-drawer-header",children:[(0,t.jsx)(eI.DrawerTitle,{children:et.name}),et.repositoryPath?(0,t.jsx)(eI.DrawerDescription,{className:"truncate font-mono text-xs",children:et.repositoryPath}):null]}));let ed=null;return e?.type==="feature"&&U?ed=(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:ei[U.lifecycle]}),(0,t.jsx)(lp,{data:U}),U.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[U.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all",el[U.state].progressClass),style:{width:`${U.progress}%`}})})]}):null]}),U.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsx)(lg,{pr:U.pr})]}):null,(0,t.jsx)(lx,{data:U})]}):e?.type==="prd-review"?ed=c?(0,t.jsx)(rQ,{data:c,selections:f,onSelect:(e,t)=>m(n=>({...n,[e]:t})),onApprove:L,onReject:D,isProcessing:g,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="tech-review"?ed=y?(0,t.jsx)(la,{data:y,onApprove:B,onReject:O,isProcessing:b,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="merge-review"?ed=k?(0,t.jsx)(lf,{data:k,onApprove:F,onReject:T,isProcessing:E,isRejecting:S}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(ee.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):e?.type==="repository"&&et?.repositoryPath&&(ed=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"OPEN WITH"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(ej.ActionButton,{label:"Open in IDE",onClick:eo.openInIde,loading:eo.ideLoading,error:!!eo.ideError,icon:ey,variant:"outline",size:"sm"}),(0,t.jsx)(ej.ActionButton,{label:"Open in Shell",onClick:eo.openInShell,loading:eo.shellLoading,error:!!eo.shellError,icon:ev.Terminal,variant:"outline",size:"sm"}),(0,t.jsx)(ej.ActionButton,{label:"Open Folder",onClick:eo.openFolder,loading:eo.folderLoading,error:!!eo.folderError,icon:eb.FolderOpen,variant:"outline",size:"sm"})]})]})]})),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eY.BaseDrawer,{open:null!==e&&!$,onClose:n,size:"md",modal:!1,header:u,deployTarget:es,"data-testid":e?.type==="feature"?"feature-drawer":e?.type==="repository"?"repository-drawer":"review-drawer",children:ed}),(0,t.jsx)(rq,{open:$,onClose:n,onSubmit:l,repositoryPath:q?.repositoryPath??"",features:q?.features??[],workflowDefaults:q?.workflowDefaults,initialParentId:q?.initialParentId,isSubmitting:s})]})}function lp({data:e}){let n=el[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(eJ,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}let lm={[e$.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[e$.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[e$.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function lg({pr:e}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",className:"border-border mx-4 rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(eB.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eK.Badge,{className:lm[e.status],children:e.status})]}),e.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(e2,{status:e.ciStatus})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eF,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function lx({data:e}){return e.agentType??e.runtime??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eD.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.agentType?(0,t.jsx)(ly,{label:"Agent",value:e.agentType}):null,e.runtime?(0,t.jsx)(ly,{label:"Runtime",value:e.runtime}):null,e.blockedBy?(0,t.jsx)(ly,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(ly,{label:"Error",value:e.errorMessage}):null]})]}):null}function ly({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}let lv=(0,s.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var lb=e.i(60253);let lw="shep:notification-banner-dismissed";function lk(){let[e,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(lw)&&n(!0)},[]);let o=(0,r.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&n(!1)},[]),a=(0,r.useCallback)(()=>{localStorage.setItem(lw,"true"),n(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(lv,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(i.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-xs",onClick:a,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(lb.X,{})})]})]}):null}let lj=(0,eN.createServerReference)("00cdc86bf5f0dde92e833594440ac170ba06c5db71",eN.callServer,void 0,eN.findSourceMapURL,"getWorkflowDefaults");var lE=e.i(5147);let lC=(0,s.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var lS=e.i(78986);let lN=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function l_({onRepositorySelect:e,className:n}){let[i,a]=(0,r.useState)(!1),[l,s]=(0,r.useState)(!1);async function u(){if(!l){s(!0);try{let t=await (0,lS.pickFolder)();t&&e?.(t)}finally{s(!1)}}}let c=(0,r.useCallback)(async()=>{await navigator.clipboard.writeText(lN.join("\n")),a(!0),setTimeout(()=>a(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,p.cn)("relative h-full w-full",n),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(ex,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:u,disabled:l,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[l?(0,t.jsx)(ee.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(o.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:l?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(lC,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:i?(0,t.jsx)(e4.Check,{className:"h-4 w-4"}):(0,t.jsx)(e3.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:lN.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var lM=e.i(17840);function lP({initialNodes:e,initialEdges:n}){let{nodes:o,edges:i,selectedNode:a,isCreateDrawerOpen:l,isDeleting:s,pendingRepositoryPath:u,onNodesChange:c,handleConnect:d,handleAddFeature:f,handleAddFeatureToRepo:h,handleAddFeatureToFeature:p,handleAddRepository:m,handleNodeClick:g,clearSelection:x,handleCreateFeatureSubmit:y,handleDeleteFeature:v,handleDeleteRepository:b,closeCreateDrawer:w,selectFeatureById:k,pendingParentFeatureId:j}=(0,lM.useControlCenterState)(e,n),{setFeatures:E}=(0,lE.useSidebarFeaturesContext)(),C=(0,r.useMemo)(()=>o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[o]);(0,r.useEffect)(()=>{E(o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,n=(0,lE.mapNodeStateToSidebarStatus)(t.state);return n?{featureId:t.featureId,name:t.name,status:n,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[C,o,E]);let S=(0,r.useMemo)(()=>o.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return{id:t.featureId,name:t.name}}).filter(e=>e.id&&!e.id.startsWith("#")),[o]),[N,_]=(0,r.useState)();(0,r.useEffect)(()=>{lj().then(_).catch(()=>{})},[]);let[M,P]=(0,r.useState)(null),R=(0,r.useCallback)(()=>{x(),P(null),w()},[x,w]),A=(0,r.useCallback)(e=>{let t=o.find(t=>t.id===e);t?.type==="repositoryNode"&&(x(),P(t.data))},[o,x]),I=function({selectedNode:e,isCreateDrawerOpen:t,pendingRepositoryPath:n,pendingParentFeatureId:r,selectedRepoNode:o,features:i,workflowDefaults:a}){return t?{type:"feature-create",repositoryPath:n,initialParentId:r,features:i,workflowDefaults:a}:e?"requirements"===e.lifecycle&&"action-required"===e.state?{type:"prd-review",node:e}:"implementation"===e.lifecycle&&"action-required"===e.state?{type:"tech-review",node:e}:"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?{type:"merge-review",node:e}:{type:"feature",node:e}:o?{type:"repository",data:o}:null}({selectedNode:a,isCreateDrawerOpen:l,pendingRepositoryPath:u,pendingParentFeatureId:j,selectedRepoNode:M,features:S,workflowDefaults:N});return((0,r.useEffect)(()=>{let e=()=>f();return window.addEventListener("shep:open-create-drawer",e),()=>window.removeEventListener("shep:open-create-drawer",e)},[f]),(0,r.useEffect)(()=>{let e=e=>{m(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[m]),(0,r.useEffect)(()=>{let e=e=>{k(e.detail.featureId)};return window.addEventListener("shep:select-feature",e),()=>window.removeEventListener("shep:select-feature",e)},[k]),o.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lk,{}),(0,t.jsx)(ez,{nodes:o,edges:i,onNodesChange:c,onConnect:d,onAddFeature:f,onNodeAction:p,onNodeClick:g,onPaneClick:R,onRepositoryAdd:h,onRepositoryClick:A,onRepositoryDelete:b,onFeatureDelete:v,onRepositorySelect:m,emptyState:(0,t.jsx)(l_,{onRepositorySelect:m})}),(0,t.jsx)(lh,{view:I,onClose:R,onDelete:v,isDeleting:s,onCreateSubmit:y})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lk,{}),(0,t.jsx)(l_,{onRepositorySelect:m}),(0,t.jsx)(lh,{view:I,onClose:R,onDelete:v,isDeleting:s,onCreateSubmit:y})]})}function lR({initialNodes:e,initialEdges:r}){return(0,t.jsx)("div",{"data-testid":"control-center",className:"h-full w-full",children:(0,t.jsx)(n.ReactFlowProvider,{children:(0,t.jsx)(lP,{initialNodes:e,initialEdges:r})})})}e.s(["ControlCenter",()=>lR],48246)}]);