reflex-agent 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +91 -91
  3. package/.next/app-path-routes-manifest.json +8 -8
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/react-loadable-manifest.json +1 -1
  7. package/.next/server/app/_not-found/page.js +2 -2
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/agents/[agentId]/page.js +3 -3
  10. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/agents/[agentId]/respond/route.js +2 -2
  12. package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/oauth/callback/route.js +2 -2
  15. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +2 -2
  19. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +2 -2
  21. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
  23. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
  25. package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
  26. package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
  28. package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
  29. package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +2 -2
  32. package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/audit/page.js +1 -1
  38. package/.next/server/app/audit/page.js.nft.json +1 -1
  39. package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/onboarding/page.js +4 -4
  41. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/page.js +2 -2
  43. package/.next/server/app/page.js.nft.json +1 -1
  44. package/.next/server/app/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
  46. package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
  47. package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
  49. package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
  50. package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/roots/[id]/page.js +3 -3
  52. package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
  53. package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
  55. package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
  56. package/.next/server/app/roots/[id]/workflows/page.js +1 -1
  57. package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
  58. package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/roots/new/page.js +3 -3
  60. package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/settings/page.js +4 -4
  62. package/.next/server/app/settings/page.js.nft.json +1 -1
  63. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/share/[id]/file/page.js +2 -2
  65. package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/share/[id]/page.js +2 -2
  67. package/.next/server/app/share/[id]/page.js.nft.json +1 -1
  68. package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
  70. package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
  71. package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app/utilities/page.js +2 -2
  73. package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
  74. package/.next/server/app-paths-manifest.json +8 -8
  75. package/.next/server/chunks/1869.js +1 -1
  76. package/.next/server/chunks/2485.js +1 -1
  77. package/.next/server/chunks/2559.js +1 -0
  78. package/.next/server/chunks/285.js +123 -17
  79. package/.next/server/chunks/{2995.js → 3152.js} +1 -1
  80. package/.next/server/chunks/3332.js +1 -1
  81. package/.next/server/chunks/3635.js +1 -0
  82. package/.next/server/chunks/3868.js +4 -0
  83. package/.next/server/chunks/4339.js +1 -1
  84. package/.next/server/chunks/4812.js +1 -1
  85. package/.next/server/chunks/5543.js +1 -1
  86. package/.next/server/chunks/6038.js +2 -2
  87. package/.next/server/chunks/6149.js +3 -0
  88. package/.next/server/chunks/6909.js +124 -18
  89. package/.next/server/chunks/6954.js +1 -0
  90. package/.next/server/chunks/795.js +1 -1
  91. package/.next/server/chunks/{4934.js → 8142.js} +1 -1
  92. package/.next/server/chunks/9098.js +1 -1
  93. package/.next/server/chunks/9496.js +1 -1
  94. package/.next/server/middleware-build-manifest.js +1 -1
  95. package/.next/server/middleware-manifest.json +5 -5
  96. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  97. package/.next/server/pages/500.html +1 -1
  98. package/.next/server/server-reference-manifest.js +1 -1
  99. package/.next/server/server-reference-manifest.json +1 -1
  100. package/.next/static/chunks/1580-740a1a70ef8ffa0d.js +1 -0
  101. package/.next/static/chunks/{7320-00a597d3985d7624.js → 1748-53319d5ec4411b05.js} +1 -1
  102. package/.next/static/chunks/357-75ffe19a5d55a8b8.js +1 -0
  103. package/.next/static/chunks/4108.86e2092ff9db450c.js +1 -0
  104. package/.next/static/chunks/4971-85de3cd4fda214ae.js +1 -0
  105. package/.next/static/chunks/7882-2b0a83d718b55183.js +1 -0
  106. package/.next/static/chunks/app/layout-64e60b0b8e0282d7.js +1 -0
  107. package/.next/static/chunks/app/onboarding/page-9601fcb7f4f95bf8.js +1 -0
  108. package/.next/static/chunks/app/page-7666e4bab61a7c9a.js +1 -0
  109. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/{page-f7c36b058c709b0a.js → page-790adae334559fee.js} +1 -1
  110. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/{page-0ed3a1f1311c348d.js → page-50409258dd7f5deb.js} +1 -1
  111. package/.next/static/chunks/app/roots/[id]/page-976f754ee926503d.js +1 -0
  112. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-fcc5eebbf3ebc541.js +1 -0
  113. package/.next/static/chunks/app/roots/new/page-2d2e4524a5804faa.js +1 -0
  114. package/.next/static/chunks/app/settings/page-830a2dbc2d81d341.js +1 -0
  115. package/.next/static/chunks/app/share/[id]/page-fc9bee69ce1ab695.js +1 -0
  116. package/.next/static/chunks/app/utilities/[scope]/[id]/page-2fc8d46da0544044.js +1 -0
  117. package/.next/static/chunks/app/utilities/page-14013c0eaaa83a58.js +1 -0
  118. package/.next/static/chunks/{webpack-f7bc4101f4444d07.js → webpack-84a033e55baef334.js} +1 -1
  119. package/.next/static/css/c46d970256fc7904.css +1 -0
  120. package/.next/trace +89 -89
  121. package/dist/lib/reflex/agents/prompts.js +66 -0
  122. package/dist/lib/reflex/agents/prompts.js.map +1 -1
  123. package/package.json +1 -1
  124. package/.next/server/chunks/1189.js +0 -1
  125. package/.next/server/chunks/1862.js +0 -4
  126. package/.next/server/chunks/6448.js +0 -3
  127. package/.next/server/chunks/899.js +0 -1
  128. package/.next/server/chunks/9829.js +0 -1
  129. package/.next/static/chunks/2905-ca16d00d09da792e.js +0 -1
  130. package/.next/static/chunks/3608-556a93ce17c48331.js +0 -1
  131. package/.next/static/chunks/4108.40efe5d61bfc7f08.js +0 -1
  132. package/.next/static/chunks/4200-fc9e833f8a521cff.js +0 -1
  133. package/.next/static/chunks/6919-830592f52172ae19.js +0 -1
  134. package/.next/static/chunks/app/layout-5d864c5e6de9cf17.js +0 -1
  135. package/.next/static/chunks/app/onboarding/page-ccaa9f5d106a765a.js +0 -1
  136. package/.next/static/chunks/app/page-bd26227f60ea0122.js +0 -1
  137. package/.next/static/chunks/app/roots/[id]/page-cd62fc140883317f.js +0 -1
  138. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-5b08fe35708be776.js +0 -1
  139. package/.next/static/chunks/app/roots/new/page-1a712172486a0f8f.js +0 -1
  140. package/.next/static/chunks/app/settings/page-632b39256dcf7ebb.js +0 -1
  141. package/.next/static/chunks/app/share/[id]/page-975a2a05e33257c9.js +0 -1
  142. package/.next/static/chunks/app/utilities/[scope]/[id]/page-424ecd0f018a58f0.js +0 -1
  143. package/.next/static/chunks/app/utilities/page-a5befa7a77ab5796.js +0 -1
  144. package/.next/static/css/60e9b6cdf1283e83.css +0 -1
  145. /package/.next/static/{AoffeFQkXIEvh9BnegJev → LRmct3V5fYVu_lgUdqH4x}/_buildManifest.js +0 -0
  146. /package/.next/static/{AoffeFQkXIEvh9BnegJev → LRmct3V5fYVu_lgUdqH4x}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";exports.id=6954,exports.ids=[6954],exports.modules={879:(a,b,c)=>{c.d(b,{G:()=>k});var d=c(73024),e=c(76760),f=c.n(e),g=c(55136),h=c.n(g),i=c(54287);class j{constructor(a,b){this.root=a,this.layers=b}static async create(a){return new j(a,[]).enter(a)}async enter(a){let b,c=f().join(a,i.KZ);try{b=await d.promises.readFile(c,"utf8")}catch{return this}let e=h()().add(b);return new j(this.root,[...this.layers,{dir:a,ig:e}])}ignores(a){let b=f().basename(a);if(i.Lj.has(b))return!0;for(let{dir:b,ig:c}of this.layers){let d=f().relative(b,a);if(!(!d||d.startsWith(".."))&&c.ignores(d))return!0}return!1}}async function*k(a,b={}){let{maxDepth:c=1/0,followSymlinks:d=!1}=b,e=f().resolve(a),g=await j.create(e);yield{abs:e,rel:".",isDir:!0},yield*l(e,e,g,0,c,d)}async function*l(a,b,c,e,g,h){let i;if(!(e>=g)){try{i=await d.promises.readdir(b,{withFileTypes:!0})}catch{return}for(let d of(i.sort((a,b)=>a.name.localeCompare(b.name)),i)){var j,k;let i=f().join(b,d.name);if(c.ignores(i))continue;let n=d.isSymbolicLink();if(n&&!h)continue;let o=d.isDirectory()||n&&await m(i),p=(j=a,k=i,f().relative(j,k).split(f().sep).join("/"));if(yield{abs:i,rel:p,isDir:o},o){let b=await c.enter(i);yield*l(a,i,b,e+1,g,h)}}}}async function m(a){try{return(await d.promises.stat(a)).isDirectory()}catch{return!1}}},4168:(a,b,c)=>{c.d(b,{S:()=>j});var d=c(73745);c(66493);var e=c(76760),f=c.n(e),g=c(53905),h=c(54287),i=c(879);async function j(a,b){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=(b??"").toLowerCase().trim(),j=[];try{let{listUtilities:b}=await Promise.resolve().then(c.bind(c,8118));for(let c of(await b({rootId:a})))j.push({kind:"utility",relPath:`util:${c.scope}/${c.manifest.id}`,absPath:"",label:`${c.manifest.name} (${c.scope})`,parent:"utilities"})}catch{}for await(let a of(0,i.G)((0,h.FF)(d.path))){if(a.isDir||!a.rel.toLowerCase().endsWith(".md")||a.rel.startsWith("topics/")||a.rel.startsWith("attachments/"))continue;let b=`${h.fW}/${a.rel}`;j.push({kind:"kb",relPath:b,absPath:a.abs,label:a.rel,parent:"."===f().dirname(a.rel)?h.fW:`${h.fW}/${f().dirname(a.rel)}`})}for await(let a of(0,i.G)(d.path))a.isDir||j.push({kind:"file",relPath:a.rel,absPath:a.abs,label:a.rel,parent:"."===f().dirname(a.rel)?"":f().dirname(a.rel)});let k=e?j.filter(a=>{let b=a.relPath.toLowerCase();return f().basename(a.relPath).toLowerCase().includes(e)||b.includes(e)}):j,l={utility:0,kb:1,file:2};return k.sort((a,b)=>{if(a.kind!==b.kind)return l[a.kind]-l[b.kind];if(e){let c=f().basename(a.label).toLowerCase(),d=f().basename(b.label).toLowerCase(),g=+!c.startsWith(e),h=+!d.startsWith(e);if(g!==h)return g-h}return a.relPath.localeCompare(b.relPath)}),{ok:!0,items:k.slice(0,30)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}(0,c(63781).D)([j]),(0,d.A)(j,"60710357a0553f0da8e04948d247a9c4e7519ce6e8",null)},8836:(a,b,c)=>{c.d(b,{E:()=>g});var d=c(64173),e=c(71813),f=c(69552);function g({label:a,headerRight:b,children:c}){let g=(0,e.c)("roots"),h=a??g("commandBarFrame.label");return(0,d.jsx)("div",{className:"border-t bg-background",children:(0,d.jsx)("div",{className:"mx-auto max-w-3xl px-6 py-5",children:(0,d.jsx)("div",{className:"reflex-gradient rounded-2xl p-[2px] shadow-[0_8px_40px_-12px_oklch(0.55_0.2_290/0.45)]",children:(0,d.jsxs)("div",{className:"rounded-[14px] bg-background/85 backdrop-blur-xl px-5 py-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"reflex-gradient inline-flex h-6 w-6 items-center justify-center rounded-full text-white shadow-sm",children:(0,d.jsx)(f.A,{className:"h-3.5 w-3.5"})}),(0,d.jsx)("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:h}),b&&(0,d.jsx)("span",{className:"ml-auto flex items-center gap-1",children:b})]}),c]})})})})}},26290:(a,b,c)=>{c.d(b,{cn:()=>f});var d=c(83243),e=c(86103);function f(...a){return(0,e.QP)((0,d.$)(a))}},45477:(a,b,c)=>{c.d(b,{T:()=>f});var d=c(64173);c(17240);var e=c(91344);function f({className:a,...b}){return(0,d.jsx)("textarea",{"data-slot":"textarea",className:(0,e.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",a),...b})}},63337:(a,b,c)=>{c.d(b,{x:()=>g});var d=c(73745);c(66493);var e=c(49410),f=c(8118);async function g(a){try{let b=(a.query??"").trim().toLowerCase();switch(a.commandId){case"skill":{let a=(await (0,e.b)()).map(a=>({value:a.id,label:a.title,description:a.description})).filter(a=>h(a,b));return{ok:!0,supported:!0,items:a}}case"util":{let c=(await (0,f.listUtilities)(a.rootId?{rootId:a.rootId}:{})).map(a=>({value:a.manifest.id,label:a.manifest.name,description:a.manifest.description}));return{ok:!0,supported:!0,items:c.filter(a=>h(a,b))}}default:return{ok:!0,supported:!1}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function h(a,b){return!b||a.value.toLowerCase().includes(b)||a.label.toLowerCase().includes(b)||(a.description?.toLowerCase().includes(b)??!1)}(0,c(63781).D)([g]),(0,d.A)(g,"400a60e2061cfe21dadeb1433cb28a8826c1fa8476",null)},67248:(a,b,c)=>{c.d(b,{E:()=>i});var d=c(63003);c(34750);var e=c(86209),f=c(65715),g=c(26290);let h=(0,e.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function i({className:a,variant:b="default",asChild:c=!1,...e}){let i=c?f.bL:"span";return(0,d.jsx)(i,{"data-slot":"badge","data-variant":b,className:(0,g.cn)(h({variant:b}),a),...e})}},70199:(a,b,c)=>{c.d(b,{L:()=>O});var d=c(64173),e=c(17240),f=c(71813),g=c(54249),h=c(75430),i=c(34719),j=c(56189),k=c(41856),l=c(33120),m=c(69552),n=c(97338),o=c(25299),p=c(63387),q=c(53834),r=c(97162),s=c(62261),t=c(77311),u=c(25436),v=c(24555),w=c(68669),x=c(79145),y=c(66979),z=c(87671),A=c(44052),B=c(20583),C=c(45477),D=c(91344),E=c(3265);let F=(0,E.createServerReference)("60710357a0553f0da8e04948d247a9c4e7519ce6e8",E.callServer,void 0,E.findSourceMapURL,"searchMentionsAction"),G=[{id:"plan",trigger:"plan",label:"/plan",description:"Show the plan first — Reflex lays out the steps and waits for approval.",kind:"agent-mode",usage:"/plan <task>",icon:"ListChecks"},{id:"goal",trigger:"goal",label:"/goal",description:"Set a goal — Reflex will work toward it on its own, without reminders.",kind:"agent-mode",usage:"/goal <what to achieve>",icon:"Target"},{id:"research",trigger:"research",label:"/research",description:"Deep research on a topic — web search + summary with sources.",kind:"agent-mode",usage:"/research <topic>",icon:"Telescope"},{id:"widget",trigger:"widget",label:"/widget",description:"Create a card on the space dashboard.",kind:"agent-mode",usage:"/widget <what to show>",icon:"LayoutGrid"},{id:"workflow",trigger:"workflow",label:"/workflow",description:"Build a recipe — linear step-based automation for the task.",kind:"agent-mode",usage:"/workflow <what to automate>",icon:"Workflow"},{id:"distill",trigger:"distill",label:"/distill",description:"Pull a URL into the KB — extract key facts, action items, and links to related notes.",kind:"agent-mode",usage:"/distill <url> [focus]",icon:"BookOpenCheck"},{id:"practice",trigger:"practice",label:"/practice",description:"Roleplay a tough conversation — Reflex plays the counterpart and coaches you between turns.",kind:"agent-mode",usage:"/practice <scenario>",icon:"MessagesSquare"},{id:"reflect",trigger:"reflect",label:"/reflect",description:"Daily check-in — three questions adapted to your recent entries, saved as a journal note.",kind:"agent-mode",usage:"/reflect",allowEmpty:!0,icon:"Sunrise"},{id:"remember",trigger:"remember",label:"/remember",description:"Save a note — straight into memory, no AI involved.",kind:"direct",usage:"/remember <what to remember>",icon:"BookmarkPlus"},{id:"mcp",trigger:"mcp",label:"/mcp",description:"Connect an external service (setup wizard opens in chat).",kind:"agent-mode",usage:"/mcp <what you need>",icon:"PackagePlus"},{id:"skill",trigger:"skill",label:"/skill",description:"Attach a role — a ready-made instruction set for this conversation.",kind:"agent-mode",usage:"/skill <role-id> [prompt]",icon:"Sparkles"},{id:"delete-topic",trigger:"delete-topic",label:"/delete-topic",description:"Delete this conversation (with confirmation).",kind:"direct",usage:"/delete-topic",requiresConfirm:!0,allowEmpty:!0,icon:"Trash2"},{id:"clear-project",trigger:"clear-project",label:"/clear-project",description:"DANGER: clear the space — all conversations, cards, memory. Double confirmation.",kind:"direct",usage:"/clear-project",requiresConfirm:!0,allowEmpty:!0,icon:"AlertOctagon"},{id:"util",trigger:"util",label:"/util",description:"Open a mini-app (by partial name or from the list).",kind:"direct",usage:"/util <partial name or id>",allowEmpty:!0,icon:"Boxes"},{id:"help",trigger:"help",label:"/help",description:"List available commands.",kind:"direct",usage:"/help",allowEmpty:!0,icon:"HelpCircle"}],H=(0,E.createServerReference)("400a60e2061cfe21dadeb1433cb28a8826c1fa8476",E.callServer,void 0,E.findSourceMapURL,"listCommandArgsAction"),I=(0,E.createServerReference)("60aff92e27d06500bcb27bcee5c4a79cfd72d9c5f1",E.callServer,void 0,E.findSourceMapURL,"rememberAction"),J=(0,E.createServerReference)("60b821086d84cce706ab8a92f10bc276f6b8b34d17",E.callServer,void 0,E.findSourceMapURL,"deleteCurrentTopicCommand"),K=(0,E.createServerReference)("60329fd98a356f77677ac8d2d262a1a2e7527b462b",E.callServer,void 0,E.findSourceMapURL,"openUtilityAction"),L=(0,E.createServerReference)("40789ceee14fca4b897c3f08e93712b1fdc03a2f38",E.callServer,void 0,E.findSourceMapURL,"clearProjectAction");var M=c(88724);let N={ListChecks:g.A,Target:h.A,Telescope:i.A,LayoutGrid:j.A,BookmarkPlus:k.A,PackagePlus:l.A,Sparkles:m.A,Trash2:n.A,AlertOctagon:o.A,HelpCircle:p.A,Workflow:q.A,Boxes:r.A};function O({rootId:a,topicId:b,placeholder:c,submitLabel:g,pendingLabel:h,SubmitIcon:i,disabled:j,onSubmit:k,active:l,onStop:m,clarifyLabel:n,stopLabel:o}){let p=(0,f.c)("roots"),q=n??p("chatInputForm.clarifyLabel"),r=o??p("chatInputForm.stopLabel"),v=(0,z.useRouter)(),[w,x]=(0,e.useState)(""),[y,E]=(0,e.useState)([]),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),O=(0,e.useRef)(null),U=(0,e.useRef)(null),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)([]),[Z,$]=(0,e.useState)(0),[_,aa]=(0,e.useState)(!1),ab=(0,e.useRef)(0),[ac,ad]=(0,e.useState)(null),[ae,af]=(0,e.useState)(null),ag=(0,e.useRef)(0);(0,e.useCallback)(()=>{let a=O.current;a&&(a.style.height="auto",a.style.height=Math.min(a.scrollHeight,240)+"px")},[]);let ah=(0,e.useCallback)((b,c)=>{let d=c;for(;d>0;){let a=b[d-1];if("@"===a){d-=1;break}if(/\s/.test(a)){d=-1;break}d-=1}if(d<0||"@"!==b[d]||d>0&&!/\s/.test(b[d-1])){W(null),Y([]);return}let e=b.slice(d+1,c);W({start:d,end:c}),$(0),aa(!0);let f=++ab.current;(async()=>{let b=await F(a,e);ab.current===f&&(aa(!1),Y(b.ok?b.items:[]))})()},[a]),ai=(0,e.useCallback)(()=>{W(null),Y([]),ab.current++},[]),aj=(0,e.useCallback)((b,c)=>{if(!b.startsWith("/")){ad(null),af(null);return}let d=b.indexOf(" ");if(d<0){af(null);let a=b.slice(1).toLowerCase(),c=G.filter(b=>b.trigger.startsWith(a)||b.label.toLowerCase().includes(a)||b.description.toLowerCase().includes(a));ad(c.length?{items:c,index:0}:null);return}ad(null);let e=b.slice(1,d),f=G.find(a=>a.trigger===e);if(!f)return void af(null);let g=d+1,h=c>=g?c:b.length;if(b.slice(h).indexOf(" ")>=0)return void af(null);let i=b.slice(g,h),j=++ag.current;af(a=>({cmd:f,items:a?.cmd.id===f.id?a.items:[],index:0,start:g,end:h,loading:!0})),(async()=>{let b=await H({commandId:f.id,query:i,rootId:a});if(ag.current===j){if(!b.ok||!b.supported||0===b.items.length)return af(null);af({cmd:f,items:b.items,index:0,start:g,end:h,loading:!1})}})()},[a]),ak=(0,e.useCallback)(()=>{ad(null),af(null)},[]),al=(0,e.useCallback)(a=>{let b=O.current;af(c=>{if(!c)return null;let d=w.slice(0,c.start),e=w.slice(c.end),f=`${a.value} `;x(d+f+e);let g=d.length+f.length;return requestAnimationFrame(()=>{b&&(b.focus(),b.setSelectionRange(g,g))}),null})},[w]),am=(0,e.useCallback)(a=>{let b=O.current,c=`/${a.trigger}${a.allowEmpty&&"direct"===a.kind?"":" "}`;x(c),ad(null),requestAnimationFrame(()=>{b&&(b.focus(),b.setSelectionRange(c.length,c.length))})},[]),an=(0,e.useCallback)(a=>{let b=O.current;if(!b||!V)return;let c=w.slice(0,V.start),d=w.slice(V.end),e=`@${a.relPath} `;x(c+e+d),ai();let f=c.length+e.length;requestAnimationFrame(()=>{b.focus(),b.setSelectionRange(f,f)})},[w,V,ai]),ao=(0,e.useCallback)(async b=>{if(0!==b.length){J(!0);try{let c=new FormData;for(let a of b)c.append("files",a);let d=await fetch(`/api/roots/${a}/attachments`,{method:"POST",body:c});if(!d.ok){let a=await d.json().catch(()=>({}));A.oR.error(a.error??p("chatInputForm.uploadFailed",{status:d.status}));return}let e=await d.json();E(a=>[...a,...e.files])}catch(a){A.oR.error(a instanceof Error?a.message:String(a))}finally{J(!1)}}},[a]),ap=w.trim().length>0||y.length>0,aq=l&&m?ap?"clarify":"stop":"send",ar=(0,e.useCallback)(async()=>{if(K)return;if("stop"===aq){if(!m)return;L(!0);try{await m()}finally{L(!1)}return}let c=w.trim();if(!c&&0===y.length||j&&"send"===aq)return;let d=function(a){var b;let c=a.trim();if(!c.startsWith("/"))return null;let d=/^\/([a-z][a-z0-9-]*)(?:\s+([\s\S]*))?$/.exec(c);if(!d)return null;let e=(b=d[1],G.find(a=>a.trigger===b)??null);return e?{def:e,payload:(d[2]??"").trim()}:null}(c);if(d&&"direct"===d.def.kind){L(!0);try{await P({cmd:d.def,payload:d.payload,rootId:a,topicId:b,router:v,t:p}),x("")}finally{L(!1)}return}L(!0);try{"clarify"===aq&&m&&await m(),await k({message:c,attachments:y})&&(x(""),E([]))}finally{L(!1)}},[w,y,K,j,aq,m,k,a,b,v,p]),as=!K&&!I&&("stop"===aq||ap&&(!j||"clarify"===aq));return(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),ar()},onDragEnter:a=>{Array.from(a.dataTransfer.types).includes("Files")&&(a.preventDefault(),N(!0))},onDragOver:a=>{Array.from(a.dataTransfer.types).includes("Files")&&(a.preventDefault(),N(!0))},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||N(!1)},onDrop:a=>{a.preventDefault(),N(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&ao(b)},className:(0,D.cn)("space-y-2 rounded-md transition-colors",M&&"ring-2 ring-ring/60 bg-accent/40"),children:[y.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:y.map((a,b)=>(0,d.jsx)(S,{attachment:a,onRemove:()=>E(b=>b.filter(b=>b!==a))},a.absPath+b))}),(0,d.jsxs)("div",{className:"flex items-end gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(C.T,{ref:O,value:w,onChange:a=>{x(a.target.value),ah(a.target.value,a.target.selectionStart),aj(a.target.value,a.target.selectionStart)},onKeyUp:a=>{let b=a.currentTarget;ah(b.value,b.selectionStart),aj(b.value,b.selectionStart)},onClick:a=>{let b=a.currentTarget;ah(b.value,b.selectionStart),aj(b.value,b.selectionStart)},onBlur:()=>{setTimeout(()=>{ai(),ak()},150)},onKeyDown:a=>{if(ac){if("ArrowDown"===a.key){a.preventDefault(),ad(a=>a?{...a,index:Math.min(a.items.length-1,a.index+1)}:null);return}if("ArrowUp"===a.key){a.preventDefault(),ad(a=>a?{...a,index:Math.max(0,a.index-1)}:null);return}if("Tab"===a.key){a.preventDefault();let b=ac.items[ac.index];b&&am(b);return}if("Escape"===a.key){a.preventDefault(),ak();return}}if(ae&&ae.items.length>0){if("ArrowDown"===a.key){a.preventDefault(),af(a=>a?{...a,index:Math.min(a.items.length-1,a.index+1)}:null);return}if("ArrowUp"===a.key){a.preventDefault(),af(a=>a?{...a,index:Math.max(0,a.index-1)}:null);return}if("Tab"===a.key){a.preventDefault();let b=ae.items[ae.index];b&&al(b);return}if("Escape"===a.key){a.preventDefault(),af(null);return}}if(V&&X.length>0){if("ArrowDown"===a.key){a.preventDefault(),$(a=>Math.min(X.length-1,a+1));return}if("ArrowUp"===a.key){a.preventDefault(),$(a=>Math.max(0,a-1));return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=X[Z];b&&an(b);return}if("Escape"===a.key){a.preventDefault(),ai();return}}"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),ar())},onPaste:a=>{let b=Array.from(a.clipboardData.files);b.length>0&&(a.preventDefault(),ao(b))},placeholder:c,rows:1,disabled:j||K,className:"resize-none min-h-[44px] max-h-60 text-base bg-background/70 border-transparent focus-visible:border-ring py-2.5 w-full"}),V&&(0,d.jsx)(R,{items:X,index:Z,loading:_,onPick:an,onHover:a=>$(a)}),ac&&!V&&(0,d.jsx)(Q,{items:ac.items,index:ac.index,onPick:am,onHover:a=>ad(b=>b?{...b,index:a}:null),topicAvailable:!!b}),ae&&!V&&!ac&&(0,d.jsx)(T,{cmd:ae.cmd,items:ae.items,index:ae.index,onPick:al,onHover:a=>af(b=>b?{...b,index:a}:null)})]}),(0,d.jsx)("input",{ref:U,type:"file",multiple:!0,className:"hidden",onChange:a=>{let b=Array.from(a.target.files??[]);b.length>0&&ao(b),a.target.value=""}}),(0,d.jsx)(B.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>U.current?.click(),disabled:I||K||j,title:p("chatInputForm.attachTitle"),className:"h-11 w-11 shrink-0",children:I?(0,d.jsx)(s.A,{className:"h-4 w-4 animate-spin"}):(0,d.jsx)(t.A,{className:"h-4 w-4"})}),(0,d.jsx)(B.$,{type:"submit",size:"lg",disabled:!as,variant:"stop"===aq?"destructive":"default",className:"h-11 px-6 shadow-md shrink-0",children:K?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s.A,{className:"mr-2 h-4 w-4 animate-spin"}),h]}):"stop"===aq?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.A,{className:"mr-2 h-4 w-4",fill:"currentColor"}),r]}):"clarify"===aq?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{className:"mr-2 h-4 w-4"}),q]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{className:"mr-2 h-4 w-4"}),g]})})]}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground",children:p("chatInputForm.helperRow")})]})}async function P({cmd:a,payload:b,rootId:c,topicId:d,router:e,t:f}){if("help"===a.id){let a=G.map(a=>`• ${a.label} — ${a.description}`);A.oR.info(f("chatInputForm.availableCommands",{list:a.join("\n")}),{duration:12e3});return}if("remember"===a.id){if(!b)return void A.oR.error(f("chatInputForm.rememberEmpty"));let a=await I(c,b);return void(a.ok?(A.oR.success(a.message??f("chatInputForm.savedToKb")),(0,M.$d)(M.Zi.kbChanged(c))):A.oR.error(a.error))}if("delete-topic"===a.id){if(!d)return void A.oR.error(f("chatInputForm.topicOnlyCommand"));if(!confirm(f("chatInputForm.deleteTopicConfirm")))return;let a=await J(c,d);return void(a.ok?(A.oR.success(a.message??f("chatInputForm.deleted")),(0,M.$d)(M.Zi.topicsChanged(c)),a.redirectTo&&e.push(a.redirectTo)):A.oR.error(a.error))}if("util"===a.id){let a=await K(c,b);if(!a.ok)return void A.oR.error(a.error);if("redirect"===a.kind)return void e.push(a.url);let d=a.items.slice(0,8).map(a=>`• ${a.name} (${a.scope}/${a.id})`).join("\n");return void A.oR.message(f("chatInputForm.multipleMatches",{list:d}),{duration:12e3})}if("clear-project"===a.id){if(!confirm(f("chatInputForm.clearProjectConfirm")))return;let a=prompt(f("chatInputForm.clearProjectPrompt"));if(a?.trim().toLowerCase()!==f("chatInputForm.clearProjectPhrase"))return void A.oR.message(f("chatInputForm.confirmFailed"));let b=await L(c);return void(b.ok?(A.oR.success(b.message??f("chatInputForm.projectCleared")),(0,M.$d)(M.Zi.topicsChanged(c)),(0,M.$d)(M.Zi.kbChanged(c)),b.redirectTo&&e.push(b.redirectTo)):A.oR.error(b.error))}A.oR.error(f("chatInputForm.unknownCommand",{label:a.label}))}function Q({items:a,index:b,onPick:c,onHover:e,topicAvailable:g}){let h=(0,f.c)("roots");return(0,d.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-80 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:[(0,d.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground border-b",children:h("chatInputForm.commandsPaletteHeader")}),(0,d.jsx)("ul",{children:a.map((a,f)=>{let i=N[a.icon]??m.A,j="delete-topic"===a.id&&!g;return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),j||c(a)},onMouseEnter:()=>e(f),disabled:j,className:(0,D.cn)("w-full flex items-start gap-2 px-3 py-2 text-left",f===b?"bg-accent":"hover:bg-accent/60",j&&"opacity-40 cursor-not-allowed"),children:[(0,d.jsx)(i,{className:(0,D.cn)("h-3.5 w-3.5 mt-0.5 shrink-0","direct"===a.kind?"text-amber-600":"text-violet-600")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-mono text-xs font-medium",children:a.label}),"direct"===a.kind&&(0,d.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-amber-700",children:h("chatInputForm.directAction")}),a.requiresConfirm&&(0,d.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-destructive",children:h("chatInputForm.withConfirm")})]}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:a.description}),(0,d.jsx)("p",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:a.usage})]})]})},a.id)})})]})}function R({items:a,index:b,loading:c,onPick:e,onHover:g}){let h=(0,f.c)("roots");return(0,d.jsx)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-72 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:c&&0===a.length?(0,d.jsxs)("div",{className:"px-3 py-2 text-xs text-muted-foreground flex items-center gap-2",children:[(0,d.jsx)(s.A,{className:"h-3 w-3 animate-spin"})," ",h("chatInputForm.mentionSearching")]}):0===a.length?(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground italic",children:h("chatInputForm.mentionNothing")}):(0,d.jsx)("ul",{children:a.map((a,c)=>{let f="kb"===a.kind?v.A:w.A;return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),e(a)},onMouseEnter:()=>g(c),className:(0,D.cn)("w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left",c===b?"bg-accent":"hover:bg-accent/60"),children:[(0,d.jsx)(f,{className:(0,D.cn)("h-3.5 w-3.5 shrink-0","kb"===a.kind?"text-primary":"text-muted-foreground")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate font-mono text-xs",children:a.relPath}),a.parent&&(0,d.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:a.parent})]}),(0,d.jsx)("span",{className:(0,D.cn)("text-[10px] uppercase tracking-wider shrink-0","kb"===a.kind?"text-primary":"text-muted-foreground"),children:a.kind})]})},a.absPath)})})})}function S({attachment:a,onRemove:b}){var c;let e=a.mime.startsWith("image/")?x.A:w.A;return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-1 text-[11px] max-w-[18rem]",children:[(0,d.jsx)(e,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate",title:a.name,children:a.name}),(0,d.jsx)("span",{className:"text-muted-foreground",children:(c=a.size)<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1048576).toFixed(1)} MB`}),(0,d.jsx)("button",{type:"button",onClick:b,className:"ml-0.5 text-muted-foreground hover:text-foreground",children:(0,d.jsx)(y.A,{className:"h-3 w-3"})})]})}function T({cmd:a,items:b,index:c,onPick:e,onHover:f}){let g=N[a.icon]??m.A;return(0,d.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-80 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground border-b flex items-center gap-2",children:[(0,d.jsx)(g,{className:"h-3 w-3"}),(0,d.jsxs)("span",{children:[a.label," \xb7 ",a.usage.replace(/^\/\S+\s*/,"")]})]}),(0,d.jsx)("ul",{children:b.map((a,b)=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),e(a)},onMouseEnter:()=>f(b),className:(0,D.cn)("w-full flex items-start gap-2 px-3 py-2 text-left",b===c?"bg-accent":"hover:bg-accent/60"),children:[(0,d.jsx)(m.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-violet-600"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-sm",children:a.label}),(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:a.value})]}),a.description&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:a.description})]})]})},a.value))})]})}},72901:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{LL:()=>v,ZC:()=>z,b2:()=>u,qO:()=>t,wd:()=>y});var e=c(73745);c(66493);var f=c(73024),g=c(76760),h=c.n(g),i=c(65326),j=c(53905),k=c(54287),l=c(56942),m=c(5492),n=c(13415),o=c(93554),p=c(49410),q=c(96921),r=c(63781),s=a([n,o]);async function t(a,b){try{let c=b.trim();if(!c)return{ok:!1,error:"Empty — nothing to remember."};let d=await (0,j.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=c.split(/\r?\n/,1)[0].trim(),f=e.length>80?e.slice(0,77).trimEnd()+"…":e,g=await (0,l.j)({rootPath:d.path,directive:{kind:"note",title:f,body:c}});return(0,i.revalidatePath)(`/roots/${a}`),{ok:!0,message:`Saved to ${g.relPath}`}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function u(a,b){let c=await (0,n.L4)(a,b);return c.ok?{ok:!0,redirectTo:`/roots/${a}`,message:"Topic deleted"}:{ok:!1,error:c.error??"Failed"}}async function v(a){try{let b=await (0,j.Zn)(a);if(!b)return{ok:!1,error:"Root not found"};let c=(0,k.FF)(b.path);for(let a of(await (0,m.hk)(b.path)))await o.z.stopTopic(a.meta.id).catch(()=>void 0);return await w(h().join(c,"widgets")),await w(h().join(c,"dashboard-layout.json")),await w(h().join(c,"topics")),await x(c),(0,i.revalidatePath)(`/roots/${a}`),{ok:!0,redirectTo:`/roots/${a}`,message:"Project cleared. Starting fresh."}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function w(a){try{await f.promises.rm(a,{recursive:!0,force:!0})}catch{}}async function x(a){let b;try{b=await f.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let c of b){let b=h().join(a,c.name);if(c.isDirectory()){await x(b);try{let a=await f.promises.readdir(b);0===a.length&&await f.promises.rmdir(b)}catch{}continue}c.name.toLowerCase().endsWith(".md")&&await f.promises.unlink(b).catch(()=>void 0)}}async function y(){let a=await (0,p.b)();return{ok:!0,commands:q.Lo,skills:a}}async function z(a,b){let{listUtilities:d}=await Promise.resolve().then(c.bind(c,8118)),e=await d({rootId:a}),f=b.trim().toLowerCase(),g=e.map(a=>({id:a.manifest.id,name:a.manifest.name,scope:a.scope,rootId:a.rootId})),h=a=>{let b=a.rootId?`?rootId=${encodeURIComponent(a.rootId)}`:"";return`/utilities/${a.scope}/${a.id}${b}`};if(!f)return 0===g.length?{ok:!1,error:"No mini-apps installed yet."}:{ok:!0,kind:"choices",items:g.map(a=>({url:h(a),id:a.id,name:a.name,scope:a.scope}))};let i=g.find(a=>a.id.toLowerCase()===f);if(i)return{ok:!0,kind:"redirect",url:h(i)};let j=g.filter(a=>a.id.toLowerCase().includes(f)||a.name.toLowerCase().includes(f));return 1===j.length?{ok:!0,kind:"redirect",url:h(j[0])}:0===j.length?{ok:!1,error:`Nothing found for "${b}". Installed: ${g.length}.`}:{ok:!0,kind:"choices",items:j.map(a=>({url:h(a),id:a.id,name:a.name,scope:a.scope}))}}[n,o]=s.then?(await s)():s,(0,r.D)([t,u,v,y,z]),(0,e.A)(t,"60aff92e27d06500bcb27bcee5c4a79cfd72d9c5f1",null),(0,e.A)(u,"60b821086d84cce706ab8a92f10bc276f6b8b34d17",null),(0,e.A)(v,"40789ceee14fca4b897c3f08e93712b1fdc03a2f38",null),(0,e.A)(y,"00d5177a369c199a6d4d67e9516ec503b8c3531b95",null),(0,e.A)(z,"60329fd98a356f77677ac8d2d262a1a2e7527b462b",null),d()}catch(a){d(a)}})},84913:(a,b,c)=>{c.d(b,{$:()=>i});var d=c(63003);c(34750);var e=c(86209),f=c(65715),g=c(26290);let h=(0,e.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function i({className:a,variant:b="default",size:c="default",asChild:e=!1,...i}){let j=e?f.bL:"button";return(0,d.jsx)(j,{"data-slot":"button","data-variant":b,"data-size":c,className:(0,g.cn)(h({variant:b,size:c,className:a})),...i})}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=795,exports.ids=[795],exports.modules={795:(a,b,c)=>{c.d(b,{diagram:()=>ab});var d=c(75260),e=c(86947),f=c(41553),g=c(77703),h=c(7285),i=c(86317),j=c(1141),k=c(34556),l=function(){var a=(0,g.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[6,11,13,14,15,17,19,20,23,24],c=[1,12],d=[1,13],e=[1,14],f=[1,15],h=[1,16],i=[1,19],j=[1,20],k={trace:(0,g.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:(0,g.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 3:d.setDirection("LR");break;case 4:d.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 8:this.$=f[h];break;case 11:d.getCommonDb().setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 12:this.$=f[h].trim(),d.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=f[h].trim(),d.getCommonDb().setAccDescription(this.$);break;case 15:d.addSection(f[h].substr(8)),this.$=f[h].substr(8);break;case 18:d.addTask(f[h],0,""),this.$=f[h];break;case 19:d.addEvent(f[h].substr(2)),this.$=f[h]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},a(b,[2,5],{5:6}),a(b,[2,2]),a(b,[2,3]),a(b,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,10],{1:[2,1]}),a(b,[2,6]),{12:21,14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,8]),a(b,[2,9]),a(b,[2,11]),{16:[1,22]},{18:[1,23]},a(b,[2,14]),a(b,[2,15]),a(b,[2,16]),a(b,[2,17]),a(b,[2,18]),a(b,[2,19]),a(b,[2,7]),a(b,[2,12]),a(b,[2,13])],defaultActions:{},parseError:(0,g.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,g.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],h=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,g.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,g.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=h[v]&&h[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],h[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=h[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function l(){this.yy={}}return k.lexer={EOF:1,parseError:(0,g.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,g.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,g.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,g.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,g.K2)(function(){return this._more=!0,this},"more"),reject:(0,g.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,g.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,g.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,g.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,g.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,g.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,g.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,g.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,g.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,g.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,g.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,g.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,g.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,g.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,g.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}},(0,g.K2)(l,"Parser"),l.prototype=k,k.Parser=l,new l}();l.parser=l;var m={};(0,g.VA)(m,{addEvent:()=>B,addSection:()=>x,addTask:()=>A,addTaskOrg:()=>C,clear:()=>u,default:()=>E,getCommonDb:()=>t,getDirection:()=>w,getSections:()=>y,getTasks:()=>z,setDirection:()=>v});var n="",o=0,p="LR",q=[],r=[],s=[],t=(0,g.K2)(()=>f.Wt,"getCommonDb"),u=(0,g.K2)(function(){q.length=0,r.length=0,n="",s.length=0,p="LR",(0,f.IU)()},"clear"),v=(0,g.K2)(function(a){p=a},"setDirection"),w=(0,g.K2)(function(){return p},"getDirection"),x=(0,g.K2)(function(a){n=a,q.push(a)},"addSection"),y=(0,g.K2)(function(){return q},"getSections"),z=(0,g.K2)(function(){let a=D(),b=0;for(;!a&&b<100;)a=D(),b++;return r.push(...s),r},"getTasks"),A=(0,g.K2)(function(a,b,c){let d={id:o++,section:n,type:n,task:a,score:b||0,events:c?[c]:[]};s.push(d)},"addTask"),B=(0,g.K2)(function(a){s.find(a=>a.id===o-1).events.push(a)},"addEvent"),C=(0,g.K2)(function(a){let b={section:n,type:n,description:a,task:a,classes:[]};r.push(b)},"addTaskOrg"),D=(0,g.K2)(function(){let a=(0,g.K2)(function(a){return s[a].processed},"compileTask"),b=!0;for(let[c,d]of s.entries())a(c),b=b&&d.processed;return b},"compileTasks"),E={clear:u,getCommonDb:t,getDirection:w,setDirection:v,addSection:x,getSections:y,getTasks:z,addTask:A,addTaskOrg:C,addEvent:B},F=0,G=(0,g.K2)(function(a,b){let c=a.append("rect");return c.attr("x",b.x),c.attr("y",b.y),c.attr("fill",b.fill),c.attr("stroke",b.stroke),c.attr("width",b.width),c.attr("height",b.height),c.attr("rx",b.rx),c.attr("ry",b.ry),void 0!==b.class&&c.attr("class",b.class),c},"drawRect"),H=(0,g.K2)(function(a,b){let c=a.append("circle").attr("cx",b.cx).attr("cy",b.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),d=a.append("g");function e(a){let c=(0,h.JLW)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+2)+")")}function f(a){let c=(0,h.JLW)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+7)+")")}function i(a){a.append("line").attr("class","mouth").attr("stroke",2).attr("x1",b.cx-5).attr("y1",b.cy+7).attr("x2",b.cx+5).attr("y2",b.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return d.append("circle").attr("cx",b.cx-5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),d.append("circle").attr("cx",b.cx+5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,g.K2)(e,"smile"),(0,g.K2)(f,"sad"),(0,g.K2)(i,"ambivalent"),b.score>3?e(d):b.score<3?f(d):i(d),c},"drawFace"),I=(0,g.K2)(function(a,b){let c=b.text.replace(/<br\s*\/?>/gi," "),d=a.append("text");d.attr("x",b.x),d.attr("y",b.y),d.attr("class","legend"),d.style("text-anchor",b.anchor),void 0!==b.class&&d.attr("class",b.class);let e=d.append("tspan");return e.attr("x",b.x+2*b.textMargin),e.text(c),d},"drawText"),J=-1,K=(0,g.K2)(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),L=function(){function a(a,b,c,e,f,g,h,i){d(b.append("text").attr("x",c+f/2).attr("y",e+g/2+5).style("font-color",i).style("text-anchor","middle").text(a),h)}function b(a,b,c,e,f,g,h,i,j){let{taskFontSize:k,taskFontFamily:l}=i,m=a.split(/<br\s*\/?>/gi);for(let a=0;a<m.length;a++){let i=a*k-k*(m.length-1)/2,n=b.append("text").attr("x",c+f/2).attr("y",e).attr("fill",j).style("text-anchor","middle").style("font-size",k).style("font-family",l);n.append("tspan").attr("x",c+f/2).attr("dy",i).text(m[a]),n.attr("y",e+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),d(n,h)}}function c(a,c,e,f,g,h,i,j){let k=c.append("switch"),l=k.append("foreignObject").attr("x",e).attr("y",f).attr("width",g).attr("height",h).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),b(a,k,e,f,g,h,i,j),d(l,i)}function d(a,b){for(let c in b)c in b&&a.attr(c,b[c])}return(0,g.K2)(a,"byText"),(0,g.K2)(b,"byTspan"),(0,g.K2)(c,"byFo"),(0,g.K2)(d,"_setTextAttrs"),function(d){return"fo"===d.textPlacement?c:"old"===d.textPlacement?a:b}}(),M=(0,g.K2)(function(a,b){F=0,J=-1,a.append("defs").append("marker").attr("id",b+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function N(a,b){a.each(function(){var a,c=(0,h.Ltv)(this),d=c.text().split(/(\s+|<br>)/).reverse(),e=[],f=c.attr("y"),g=parseFloat(c.attr("dy")),i=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em");for(let g=0;g<d.length;g++)a=d[d.length-1-g],e.push(a),i.text(e.join(" ").trim()),(i.node().getComputedTextLength()>b||"<br>"===a)&&(e.pop(),i.text(e.join(" ").trim()),e="<br>"===a?[""]:[a],i=c.append("tspan").attr("x",0).attr("y",f).attr("dy","1.1em").text(a))})}(0,g.K2)(N,"wrap");var O=(0,g.K2)(function(a,b,c,d,e,f=!1){let{theme:g,look:i}=d,j=g?.includes("redux"),k=c%(d?.themeVariables?.THEME_COLOR_LIMIT??12)-1,l=a.append("g");b.section=k,l.attr("class",(b.class?b.class+" ":"")+"timeline-node section-"+k);let m=l.append("g"),n=l.append("g"),o=n.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),p=d.fontSize?.replace?d.fontSize.replace("px",""):d.fontSize;if(b.height=o.height+1.1*p*.5+b.padding,b.height=Math.max(b.height,b.maxHeight),b.width=b.width+2*b.padding,n.attr("transform","translate("+b.width/2+", "+b.padding/2+")"),j&&n.attr("transform",`translate(${b.width/2}, ${f?b.padding/2+3:b.padding})`),Q(m,b,k,e,d),"neo"===i&&(l.attr("data-look","neo"),j)){let b=g.includes("dark"),c=a.node()?.ownerSVGElement??a.node(),d=(0,h.Ltv)(c),e=d.attr("id")??"",f=e?`${e}-drop-shadow`:"drop-shadow";if(d.select(`#${f}`).empty()){let a=d.select("defs");(a.empty()?d.append("defs"):a).append("filter").attr("id",f).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",b?"0.2":"0.06").attr("flood-color",b?"#FFFFFF":"#000000")}}return b},"drawNode"),P=(0,g.K2)(function(a,b,c){let d=a.append("g"),e=d.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),f=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return d.remove(),e.height+1.1*f*.5+b.padding},"getVirtualNodeHeight"),Q=(0,g.K2)(function(a,b,c,d,e){let{theme:f}=e,g=5*!f?.includes("redux"),h=g>0?`M0 ${b.height-5} v${-b.height+10} q0,-${g},${g},-${g} h${b.width-10} q${g},0,${g},${g} v${b.height-5} H0 Z`:`M0 ${b.height-5} v${-(b.height-5)} h${b.width} v${b.height} H0 Z`;a.append("path").attr("id",d+"-node-"+F++).attr("class","node-bkg node-"+b.type).attr("d",h),f?.includes("redux")||a.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",b.height).attr("x2",b.width).attr("y2",b.height)},"defaultBkg"),R={initGraphics:M,drawNode:O,getVirtualNodeHeight:P},S=(0,g.K2)(function(a,b,c,d){let e,i=(0,f.D7)(),{look:j,theme:k,themeVariables:l}=i,{useGradient:m,gradientStart:n,gradientStop:o}=l,p=i.timeline?.leftMargin??50;g.Rm.debug("timeline",d.db);let q=i.securityLevel;"sandbox"===q&&(e=(0,h.Ltv)("#i"+b));let r=("sandbox"===q?(0,h.Ltv)(e.nodes()[0].contentDocument.body):(0,h.Ltv)("body")).select("#"+b);r.append("g");let s=d.db.getTasks(),t=d.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",s),R.initGraphics(r,b);let u=d.db.getSections();g.Rm.debug("sections",u);let v=0,w=0,x=0,y=0,z=50+p,A=50;y=50;let B=0,C=!0;u.forEach(function(a){let b={number:B,descr:a,section:B,width:150,padding:20,maxHeight:v},c=R.getVirtualNodeHeight(r,b,i);g.Rm.debug("sectionHeight before draw",c),v=Math.max(v,c+20)});let D=0,E=0;for(let[a,b]of(g.Rm.debug("tasks.length",s.length),s.entries())){let c={number:a,descr:b,section:b.section,width:150,padding:20,maxHeight:w},d=R.getVirtualNodeHeight(r,c,i);g.Rm.debug("taskHeight before draw",d),w=Math.max(w,d+20),D=Math.max(D,b.events.length);let e=0;for(let a of b.events){let c={descr:a,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};e+=R.getVirtualNodeHeight(r,c,i)}b.events.length>0&&(e+=(b.events.length-1)*10),E=Math.max(E,e)}g.Rm.debug("maxSectionHeight before draw",v),g.Rm.debug("maxTaskHeight before draw",w),u&&u.length>0?u.forEach(a=>{let c=s.filter(b=>b.section===a),d={number:B,descr:a,section:B,width:200*Math.max(c.length,1)-50,padding:20,maxHeight:v};g.Rm.debug("sectionNode",d);let e=r.append("g"),f=R.drawNode(e,d,B,i,b);g.Rm.debug("sectionNode output",f),e.attr("transform",`translate(${z}, ${y})`),A+=v+50,c.length>0&&T(r,c,B,z,A,w,i,D,E,v,!1,b),z+=200*Math.max(c.length,1),A=y,B++}):(C=!1,T(r,s,B,z,A,w,i,D,E,v,!0,b));let F=r.node().getBBox();if(g.Rm.debug("bounds",F),t&&r.append("text").text(t).attr("x","neo"===j?2*F.x+p:F.width/2-p).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),x=C?v+w+150:w+100,r.append("g").attr("class","lineWrapper").append("line").attr("x1",p).attr("y1",x).attr("x2",F.width+3*p).attr("y2",x).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${b}-arrowhead)`),"neo"===j&&m&&"neutral"!==k){let a=r.select("defs"),b=(a.empty()?r.append("defs"):a).append("linearGradient").attr("id",r.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}(0,f.ot)(void 0,r,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),T=(0,g.K2)(function(a,b,c,d,e,f,h,i,j,k,l,m){for(let i of b){let b={descr:i.task,section:c,number:c,width:150,padding:20,maxHeight:f};g.Rm.debug("taskNode",b);let k=a.append("g").attr("class","taskWrapper"),n=R.drawNode(k,b,c,h,m).height;if(g.Rm.debug("taskHeight after draw",n),k.attr("transform",`translate(${d}, ${e})`),f=Math.max(f,n),i.events){let b=a.append("g").attr("class","lineWrapper");e+=100,U(a,i.events,c,d,e,h,m),e-=100,b.append("line").attr("x1",d+95).attr("y1",e+f).attr("x2",d+95).attr("y2",e+f+100+j+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${m}-arrowhead)`).attr("stroke-dasharray","5,5")}d+=200,l&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),U=(0,g.K2)(function(a,b,c,d,e,f,h){let i=0,j=e;for(let j of(e+=100,b)){let b={descr:j,section:c,number:c,width:150,padding:20,maxHeight:50};g.Rm.debug("eventNode",b);let k=a.append("g").attr("class","eventWrapper"),l=R.drawNode(k,b,c,f,h,!0).height;i+=l,k.attr("transform",`translate(${d}, ${e})`),e=e+10+l}return e=j,i},"drawEvents"),V={setConf:(0,g.K2)(()=>{},"setConf"),draw:S},W=(0,g.K2)(function(a,b,c,h){let i=(0,f.D7)(),j=i.timeline?.leftMargin??50;g.Rm.debug("timeline",h.db);let k=(0,d.D)(b);k.append("g");let l=h.db.getTasks(),m=h.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",l),R.initGraphics(k);let n=h.db.getSections();g.Rm.debug("sections",n);let o=0,p=0,q=50,r=230,s=0,t=n&&n.length>0,u=50+j+r,v=Math.max(50,r+360-10);n.forEach(function(a){let b={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o},c=R.getVirtualNodeHeight(k,b,i);g.Rm.debug("sectionHeight before draw",c),o=Math.max(o,c)});let w=0;for(let[a,b]of(g.Rm.debug("tasks.length",l.length),l.entries())){let c={number:a,descr:b,section:b.section,width:200,padding:5,maxHeight:p},d=R.getVirtualNodeHeight(k,c,i);g.Rm.debug("taskHeight before draw",d),p=Math.max(p,d);let e=0;for(let a of b.events){let c={descr:a,section:b.section,number:b.section,width:300,padding:5,maxHeight:50};e+=R.getVirtualNodeHeight(k,c,i)}b.events.length>0&&(e+=(b.events.length-1)*10),w=Math.max(w,e)+0}g.Rm.debug("maxSectionHeight before draw",o),g.Rm.debug("maxTaskHeight before draw",p);let x=Math.max(p,w)+30;t?n.forEach(a=>{let b=l.filter(b=>b.section===a),c={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o};g.Rm.debug("sectionNode",c);let d=k.append("g"),e=R.drawNode(d,c,s,i);g.Rm.debug("sectionNode output",e);let f=u-r;d.attr("transform",`translate(${f}, ${q})`);let h=q+e.height+20;b.length>0&&X(k,b,s,u,h,p,i,x,!1);let j=b.length,m=e.height+20+x*Math.max(j,1)-60*(j>0);q+=m,s++}):X(k,l,s,u,q,p,i,x,!0);let y=k.node()?.getBBox();if(!y)throw Error("bbox not found");if(g.Rm.debug("bounds",y),m){if(k.append("text").text(m).attr("x",y.width/2-j).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),!(y=k.node()?.getBBox()))throw Error("bbox not found");g.Rm.debug("bounds after title",y)}let[z]=(0,e.I5)(i.fontSize),A=k.append("g").attr("class","lineWrapper");A.append("line").attr("x1",u).attr("y1",50-(z??16)*2).attr("x2",u).attr("y2",y.y+y.height+((z??16)*.5+20)).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),(0,f.ot)(void 0,k,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),X=(0,g.K2)(function(a,b,c,d,e,f,h,i,j){for(let k of b){let b={descr:k.task,section:c,number:c,width:200,padding:5,maxHeight:f};g.Rm.debug("taskNode",b);let l=a.append("g").attr("class","taskWrapper"),m=R.drawNode(l,b,c,h),n=m.height;g.Rm.debug("taskHeight after draw",n);let o=d-20-m.width;if(l.attr("transform",`translate(${o}, ${e})`),f=Math.max(f,n),k.events&&k.events.length>0){let b=e,f=d+50;Y(a,k.events,c,d,f,b,h)}e+=i,j&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),Y=(0,g.K2)(function(a,b,c,d,e,f,h){let i=f;for(let f of b){let b={descr:f,section:c,number:c,width:300,padding:5,maxHeight:0};g.Rm.debug("eventNode",b);let j=a.append("g").attr("class","eventWrapper"),k=R.drawNode(j,b,c,h).height;j.attr("transform",`translate(${e}, ${i})`);let l=a.append("g").attr("class","lineWrapper"),m=i+k/2;l.append("line").attr("x1",d).attr("y1",m).attr("x2",e).attr("y2",m).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),i=i+k+10}return i-f},"drawEvents"),Z={setConf:(0,g.K2)(()=>{},"setConf"),draw:W},$=(0,g.K2)(a=>{let{theme:b}=(0,f.zj)(),c=b?.includes("dark"),d=b?.includes("color"),e=a.svgId?.replace(/^#/,"")??"",g=e?`url(#${e}-drop-shadow)`:a.dropShadow??"none",h="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++){let e=`${17-3*b}`,f=d?a.borderColorArray[b]:a.mainBkg,i=d?a.borderColorArray[b]:a.nodeBorder;h+=`
1
+ "use strict";exports.id=795,exports.ids=[795],exports.modules={795:(a,b,c)=>{c.d(b,{diagram:()=>ab});var d=c(75260),e=c(86947),f=c(41553),g=c(77703),h=c(7285),i=c(86317),j=c(1141),k=c(12175),l=function(){var a=(0,g.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[6,11,13,14,15,17,19,20,23,24],c=[1,12],d=[1,13],e=[1,14],f=[1,15],h=[1,16],i=[1,19],j=[1,20],k={trace:(0,g.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:(0,g.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 3:d.setDirection("LR");break;case 4:d.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 8:this.$=f[h];break;case 11:d.getCommonDb().setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 12:this.$=f[h].trim(),d.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=f[h].trim(),d.getCommonDb().setAccDescription(this.$);break;case 15:d.addSection(f[h].substr(8)),this.$=f[h].substr(8);break;case 18:d.addTask(f[h],0,""),this.$=f[h];break;case 19:d.addEvent(f[h].substr(2)),this.$=f[h]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},a(b,[2,5],{5:6}),a(b,[2,2]),a(b,[2,3]),a(b,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,10],{1:[2,1]}),a(b,[2,6]),{12:21,14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,8]),a(b,[2,9]),a(b,[2,11]),{16:[1,22]},{18:[1,23]},a(b,[2,14]),a(b,[2,15]),a(b,[2,16]),a(b,[2,17]),a(b,[2,18]),a(b,[2,19]),a(b,[2,7]),a(b,[2,12]),a(b,[2,13])],defaultActions:{},parseError:(0,g.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,g.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],h=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,g.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,g.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=h[v]&&h[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],h[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=h[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function l(){this.yy={}}return k.lexer={EOF:1,parseError:(0,g.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,g.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,g.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,g.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,g.K2)(function(){return this._more=!0,this},"more"),reject:(0,g.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,g.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,g.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,g.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,g.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,g.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,g.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,g.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,g.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,g.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,g.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,g.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,g.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,g.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,g.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}},(0,g.K2)(l,"Parser"),l.prototype=k,k.Parser=l,new l}();l.parser=l;var m={};(0,g.VA)(m,{addEvent:()=>B,addSection:()=>x,addTask:()=>A,addTaskOrg:()=>C,clear:()=>u,default:()=>E,getCommonDb:()=>t,getDirection:()=>w,getSections:()=>y,getTasks:()=>z,setDirection:()=>v});var n="",o=0,p="LR",q=[],r=[],s=[],t=(0,g.K2)(()=>f.Wt,"getCommonDb"),u=(0,g.K2)(function(){q.length=0,r.length=0,n="",s.length=0,p="LR",(0,f.IU)()},"clear"),v=(0,g.K2)(function(a){p=a},"setDirection"),w=(0,g.K2)(function(){return p},"getDirection"),x=(0,g.K2)(function(a){n=a,q.push(a)},"addSection"),y=(0,g.K2)(function(){return q},"getSections"),z=(0,g.K2)(function(){let a=D(),b=0;for(;!a&&b<100;)a=D(),b++;return r.push(...s),r},"getTasks"),A=(0,g.K2)(function(a,b,c){let d={id:o++,section:n,type:n,task:a,score:b||0,events:c?[c]:[]};s.push(d)},"addTask"),B=(0,g.K2)(function(a){s.find(a=>a.id===o-1).events.push(a)},"addEvent"),C=(0,g.K2)(function(a){let b={section:n,type:n,description:a,task:a,classes:[]};r.push(b)},"addTaskOrg"),D=(0,g.K2)(function(){let a=(0,g.K2)(function(a){return s[a].processed},"compileTask"),b=!0;for(let[c,d]of s.entries())a(c),b=b&&d.processed;return b},"compileTasks"),E={clear:u,getCommonDb:t,getDirection:w,setDirection:v,addSection:x,getSections:y,getTasks:z,addTask:A,addTaskOrg:C,addEvent:B},F=0,G=(0,g.K2)(function(a,b){let c=a.append("rect");return c.attr("x",b.x),c.attr("y",b.y),c.attr("fill",b.fill),c.attr("stroke",b.stroke),c.attr("width",b.width),c.attr("height",b.height),c.attr("rx",b.rx),c.attr("ry",b.ry),void 0!==b.class&&c.attr("class",b.class),c},"drawRect"),H=(0,g.K2)(function(a,b){let c=a.append("circle").attr("cx",b.cx).attr("cy",b.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),d=a.append("g");function e(a){let c=(0,h.JLW)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+2)+")")}function f(a){let c=(0,h.JLW)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+7)+")")}function i(a){a.append("line").attr("class","mouth").attr("stroke",2).attr("x1",b.cx-5).attr("y1",b.cy+7).attr("x2",b.cx+5).attr("y2",b.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return d.append("circle").attr("cx",b.cx-5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),d.append("circle").attr("cx",b.cx+5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,g.K2)(e,"smile"),(0,g.K2)(f,"sad"),(0,g.K2)(i,"ambivalent"),b.score>3?e(d):b.score<3?f(d):i(d),c},"drawFace"),I=(0,g.K2)(function(a,b){let c=b.text.replace(/<br\s*\/?>/gi," "),d=a.append("text");d.attr("x",b.x),d.attr("y",b.y),d.attr("class","legend"),d.style("text-anchor",b.anchor),void 0!==b.class&&d.attr("class",b.class);let e=d.append("tspan");return e.attr("x",b.x+2*b.textMargin),e.text(c),d},"drawText"),J=-1,K=(0,g.K2)(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),L=function(){function a(a,b,c,e,f,g,h,i){d(b.append("text").attr("x",c+f/2).attr("y",e+g/2+5).style("font-color",i).style("text-anchor","middle").text(a),h)}function b(a,b,c,e,f,g,h,i,j){let{taskFontSize:k,taskFontFamily:l}=i,m=a.split(/<br\s*\/?>/gi);for(let a=0;a<m.length;a++){let i=a*k-k*(m.length-1)/2,n=b.append("text").attr("x",c+f/2).attr("y",e).attr("fill",j).style("text-anchor","middle").style("font-size",k).style("font-family",l);n.append("tspan").attr("x",c+f/2).attr("dy",i).text(m[a]),n.attr("y",e+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),d(n,h)}}function c(a,c,e,f,g,h,i,j){let k=c.append("switch"),l=k.append("foreignObject").attr("x",e).attr("y",f).attr("width",g).attr("height",h).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),b(a,k,e,f,g,h,i,j),d(l,i)}function d(a,b){for(let c in b)c in b&&a.attr(c,b[c])}return(0,g.K2)(a,"byText"),(0,g.K2)(b,"byTspan"),(0,g.K2)(c,"byFo"),(0,g.K2)(d,"_setTextAttrs"),function(d){return"fo"===d.textPlacement?c:"old"===d.textPlacement?a:b}}(),M=(0,g.K2)(function(a,b){F=0,J=-1,a.append("defs").append("marker").attr("id",b+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function N(a,b){a.each(function(){var a,c=(0,h.Ltv)(this),d=c.text().split(/(\s+|<br>)/).reverse(),e=[],f=c.attr("y"),g=parseFloat(c.attr("dy")),i=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em");for(let g=0;g<d.length;g++)a=d[d.length-1-g],e.push(a),i.text(e.join(" ").trim()),(i.node().getComputedTextLength()>b||"<br>"===a)&&(e.pop(),i.text(e.join(" ").trim()),e="<br>"===a?[""]:[a],i=c.append("tspan").attr("x",0).attr("y",f).attr("dy","1.1em").text(a))})}(0,g.K2)(N,"wrap");var O=(0,g.K2)(function(a,b,c,d,e,f=!1){let{theme:g,look:i}=d,j=g?.includes("redux"),k=c%(d?.themeVariables?.THEME_COLOR_LIMIT??12)-1,l=a.append("g");b.section=k,l.attr("class",(b.class?b.class+" ":"")+"timeline-node section-"+k);let m=l.append("g"),n=l.append("g"),o=n.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),p=d.fontSize?.replace?d.fontSize.replace("px",""):d.fontSize;if(b.height=o.height+1.1*p*.5+b.padding,b.height=Math.max(b.height,b.maxHeight),b.width=b.width+2*b.padding,n.attr("transform","translate("+b.width/2+", "+b.padding/2+")"),j&&n.attr("transform",`translate(${b.width/2}, ${f?b.padding/2+3:b.padding})`),Q(m,b,k,e,d),"neo"===i&&(l.attr("data-look","neo"),j)){let b=g.includes("dark"),c=a.node()?.ownerSVGElement??a.node(),d=(0,h.Ltv)(c),e=d.attr("id")??"",f=e?`${e}-drop-shadow`:"drop-shadow";if(d.select(`#${f}`).empty()){let a=d.select("defs");(a.empty()?d.append("defs"):a).append("filter").attr("id",f).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",b?"0.2":"0.06").attr("flood-color",b?"#FFFFFF":"#000000")}}return b},"drawNode"),P=(0,g.K2)(function(a,b,c){let d=a.append("g"),e=d.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),f=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return d.remove(),e.height+1.1*f*.5+b.padding},"getVirtualNodeHeight"),Q=(0,g.K2)(function(a,b,c,d,e){let{theme:f}=e,g=5*!f?.includes("redux"),h=g>0?`M0 ${b.height-5} v${-b.height+10} q0,-${g},${g},-${g} h${b.width-10} q${g},0,${g},${g} v${b.height-5} H0 Z`:`M0 ${b.height-5} v${-(b.height-5)} h${b.width} v${b.height} H0 Z`;a.append("path").attr("id",d+"-node-"+F++).attr("class","node-bkg node-"+b.type).attr("d",h),f?.includes("redux")||a.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",b.height).attr("x2",b.width).attr("y2",b.height)},"defaultBkg"),R={initGraphics:M,drawNode:O,getVirtualNodeHeight:P},S=(0,g.K2)(function(a,b,c,d){let e,i=(0,f.D7)(),{look:j,theme:k,themeVariables:l}=i,{useGradient:m,gradientStart:n,gradientStop:o}=l,p=i.timeline?.leftMargin??50;g.Rm.debug("timeline",d.db);let q=i.securityLevel;"sandbox"===q&&(e=(0,h.Ltv)("#i"+b));let r=("sandbox"===q?(0,h.Ltv)(e.nodes()[0].contentDocument.body):(0,h.Ltv)("body")).select("#"+b);r.append("g");let s=d.db.getTasks(),t=d.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",s),R.initGraphics(r,b);let u=d.db.getSections();g.Rm.debug("sections",u);let v=0,w=0,x=0,y=0,z=50+p,A=50;y=50;let B=0,C=!0;u.forEach(function(a){let b={number:B,descr:a,section:B,width:150,padding:20,maxHeight:v},c=R.getVirtualNodeHeight(r,b,i);g.Rm.debug("sectionHeight before draw",c),v=Math.max(v,c+20)});let D=0,E=0;for(let[a,b]of(g.Rm.debug("tasks.length",s.length),s.entries())){let c={number:a,descr:b,section:b.section,width:150,padding:20,maxHeight:w},d=R.getVirtualNodeHeight(r,c,i);g.Rm.debug("taskHeight before draw",d),w=Math.max(w,d+20),D=Math.max(D,b.events.length);let e=0;for(let a of b.events){let c={descr:a,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};e+=R.getVirtualNodeHeight(r,c,i)}b.events.length>0&&(e+=(b.events.length-1)*10),E=Math.max(E,e)}g.Rm.debug("maxSectionHeight before draw",v),g.Rm.debug("maxTaskHeight before draw",w),u&&u.length>0?u.forEach(a=>{let c=s.filter(b=>b.section===a),d={number:B,descr:a,section:B,width:200*Math.max(c.length,1)-50,padding:20,maxHeight:v};g.Rm.debug("sectionNode",d);let e=r.append("g"),f=R.drawNode(e,d,B,i,b);g.Rm.debug("sectionNode output",f),e.attr("transform",`translate(${z}, ${y})`),A+=v+50,c.length>0&&T(r,c,B,z,A,w,i,D,E,v,!1,b),z+=200*Math.max(c.length,1),A=y,B++}):(C=!1,T(r,s,B,z,A,w,i,D,E,v,!0,b));let F=r.node().getBBox();if(g.Rm.debug("bounds",F),t&&r.append("text").text(t).attr("x","neo"===j?2*F.x+p:F.width/2-p).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),x=C?v+w+150:w+100,r.append("g").attr("class","lineWrapper").append("line").attr("x1",p).attr("y1",x).attr("x2",F.width+3*p).attr("y2",x).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${b}-arrowhead)`),"neo"===j&&m&&"neutral"!==k){let a=r.select("defs"),b=(a.empty()?r.append("defs"):a).append("linearGradient").attr("id",r.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}(0,f.ot)(void 0,r,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),T=(0,g.K2)(function(a,b,c,d,e,f,h,i,j,k,l,m){for(let i of b){let b={descr:i.task,section:c,number:c,width:150,padding:20,maxHeight:f};g.Rm.debug("taskNode",b);let k=a.append("g").attr("class","taskWrapper"),n=R.drawNode(k,b,c,h,m).height;if(g.Rm.debug("taskHeight after draw",n),k.attr("transform",`translate(${d}, ${e})`),f=Math.max(f,n),i.events){let b=a.append("g").attr("class","lineWrapper");e+=100,U(a,i.events,c,d,e,h,m),e-=100,b.append("line").attr("x1",d+95).attr("y1",e+f).attr("x2",d+95).attr("y2",e+f+100+j+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${m}-arrowhead)`).attr("stroke-dasharray","5,5")}d+=200,l&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),U=(0,g.K2)(function(a,b,c,d,e,f,h){let i=0,j=e;for(let j of(e+=100,b)){let b={descr:j,section:c,number:c,width:150,padding:20,maxHeight:50};g.Rm.debug("eventNode",b);let k=a.append("g").attr("class","eventWrapper"),l=R.drawNode(k,b,c,f,h,!0).height;i+=l,k.attr("transform",`translate(${d}, ${e})`),e=e+10+l}return e=j,i},"drawEvents"),V={setConf:(0,g.K2)(()=>{},"setConf"),draw:S},W=(0,g.K2)(function(a,b,c,h){let i=(0,f.D7)(),j=i.timeline?.leftMargin??50;g.Rm.debug("timeline",h.db);let k=(0,d.D)(b);k.append("g");let l=h.db.getTasks(),m=h.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",l),R.initGraphics(k);let n=h.db.getSections();g.Rm.debug("sections",n);let o=0,p=0,q=50,r=230,s=0,t=n&&n.length>0,u=50+j+r,v=Math.max(50,r+360-10);n.forEach(function(a){let b={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o},c=R.getVirtualNodeHeight(k,b,i);g.Rm.debug("sectionHeight before draw",c),o=Math.max(o,c)});let w=0;for(let[a,b]of(g.Rm.debug("tasks.length",l.length),l.entries())){let c={number:a,descr:b,section:b.section,width:200,padding:5,maxHeight:p},d=R.getVirtualNodeHeight(k,c,i);g.Rm.debug("taskHeight before draw",d),p=Math.max(p,d);let e=0;for(let a of b.events){let c={descr:a,section:b.section,number:b.section,width:300,padding:5,maxHeight:50};e+=R.getVirtualNodeHeight(k,c,i)}b.events.length>0&&(e+=(b.events.length-1)*10),w=Math.max(w,e)+0}g.Rm.debug("maxSectionHeight before draw",o),g.Rm.debug("maxTaskHeight before draw",p);let x=Math.max(p,w)+30;t?n.forEach(a=>{let b=l.filter(b=>b.section===a),c={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o};g.Rm.debug("sectionNode",c);let d=k.append("g"),e=R.drawNode(d,c,s,i);g.Rm.debug("sectionNode output",e);let f=u-r;d.attr("transform",`translate(${f}, ${q})`);let h=q+e.height+20;b.length>0&&X(k,b,s,u,h,p,i,x,!1);let j=b.length,m=e.height+20+x*Math.max(j,1)-60*(j>0);q+=m,s++}):X(k,l,s,u,q,p,i,x,!0);let y=k.node()?.getBBox();if(!y)throw Error("bbox not found");if(g.Rm.debug("bounds",y),m){if(k.append("text").text(m).attr("x",y.width/2-j).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),!(y=k.node()?.getBBox()))throw Error("bbox not found");g.Rm.debug("bounds after title",y)}let[z]=(0,e.I5)(i.fontSize),A=k.append("g").attr("class","lineWrapper");A.append("line").attr("x1",u).attr("y1",50-(z??16)*2).attr("x2",u).attr("y2",y.y+y.height+((z??16)*.5+20)).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),(0,f.ot)(void 0,k,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),X=(0,g.K2)(function(a,b,c,d,e,f,h,i,j){for(let k of b){let b={descr:k.task,section:c,number:c,width:200,padding:5,maxHeight:f};g.Rm.debug("taskNode",b);let l=a.append("g").attr("class","taskWrapper"),m=R.drawNode(l,b,c,h),n=m.height;g.Rm.debug("taskHeight after draw",n);let o=d-20-m.width;if(l.attr("transform",`translate(${o}, ${e})`),f=Math.max(f,n),k.events&&k.events.length>0){let b=e,f=d+50;Y(a,k.events,c,d,f,b,h)}e+=i,j&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),Y=(0,g.K2)(function(a,b,c,d,e,f,h){let i=f;for(let f of b){let b={descr:f,section:c,number:c,width:300,padding:5,maxHeight:0};g.Rm.debug("eventNode",b);let j=a.append("g").attr("class","eventWrapper"),k=R.drawNode(j,b,c,h).height;j.attr("transform",`translate(${e}, ${i})`);let l=a.append("g").attr("class","lineWrapper"),m=i+k/2;l.append("line").attr("x1",d).attr("y1",m).attr("x2",e).attr("y2",m).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),i=i+k+10}return i-f},"drawEvents"),Z={setConf:(0,g.K2)(()=>{},"setConf"),draw:W},$=(0,g.K2)(a=>{let{theme:b}=(0,f.zj)(),c=b?.includes("dark"),d=b?.includes("color"),e=a.svgId?.replace(/^#/,"")??"",g=e?`url(#${e}-drop-shadow)`:a.dropShadow??"none",h="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++){let e=`${17-3*b}`,f=d?a.borderColorArray[b]:a.mainBkg,i=d?a.borderColorArray[b]:a.nodeBorder;h+=`
2
2
  .section-${b-1} rect,
3
3
  .section-${b-1} path,
4
4
  .section-${b-1} circle {
@@ -1 +1 @@
1
- "use strict";exports.id=4934,exports.ids=[4934],exports.modules={34934:(a,b,c)=>{c.d(b,{UtilityIframe:()=>s});var d=c(64173),e=c(17240),f=c(53186),g=c(71813),h=c(65177),i=c(66979),j=c(69552),k=c(62261),l=c(73569),m=c(1056),n=c.n(m),o=c(44052),p=c(3265);function q({scope:a,utilityId:b,utilityName:c,rootId:m,requestSnapshot:p,onClose:q}){let s=(0,g.c)("app"),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useTransition)(),[D,E]=(0,e.useState)(!1),F=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useRef)("");let[G,H]=(0,e.useState)(""),I=()=>{let a=x.trim();a&&m&&t&&(y(""),w(b=>[...b,{role:"user",text:a,ts:new Date().toISOString()}]),C(async()=>{let b;try{b=await Promise.race([p(),new Promise(a=>setTimeout(()=>a(void 0),600))])}catch{}let c=void 0!==b?function(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b,null,2)}catch{c=String(b)}return c.length>4e3&&(c=c.slice(0,4e3)+"\n…[truncated]"),["[Mini-app context]",c,"[/context]\n",a].join("\n")}(a,b):a;try{let a=await fetch(`/api/roots/${m}/chat/${t}/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:c})});if(!a.ok){let b=await a.json().catch(()=>({}));o.oR.error(b.error??`HTTP ${a.status}`)}}catch(a){o.oR.error(String(a))}}))};return(0,d.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,d.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:s("utilities.helper.title")}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:s("utilities.helper.hint")}),m&&t&&(0,d.jsx)(n(),{href:`/roots/${m}/chat/${t}`,className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:s("utilities.helper.openFull"),children:(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"})}),q&&(0,d.jsx)("button",{type:"button",onClick:q,className:"p-1 rounded hover:bg-accent "+(m&&t?"":"ml-auto"),title:s("utilities.helper.hide"),children:(0,d.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}),(0,d.jsxs)("div",{ref:F,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[z&&(0,d.jsx)("p",{className:"text-xs text-red-600",children:z}),!z&&0===v.length&&!G&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,d.jsx)(j.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,d.jsx)("span",{children:s("utilities.helper.welcome")})]}),v.map((a,b)=>(0,d.jsx)(r,{role:a.role,text:a.text},b)),D&&G&&(0,d.jsx)(r,{role:"assistant",text:G,streaming:!0}),B&&!D&&(0,d.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}),s("utilities.helper.thinking")]})]}),(0,d.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,d.jsx)("textarea",{value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),I())},rows:1,placeholder:s("utilities.helper.placeholder"),disabled:B||!!z||!t,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,d.jsx)("button",{type:"button",onClick:I,disabled:B||!x.trim()||!!z||!t,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:B?(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]})}function r({role:a,text:b,streaming:c}){let e=(0,g.c)("app"),f=b;return("user"===a&&(f=f.replace(/^\s*\[Mini-app context\][\s\S]*?\[\/context\]\s*/,"").trim()),f.trim())?(0,d.jsxs)("div",{className:"user"===a?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,d.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[e("user"===a?"utilities.helper.you":"assistant"===a?"utilities.helper.reflex":"utilities.helper.system"),c&&(0,d.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),f]}):null}function s({scope:a,id:b,rootId:c,className:h,title:i,agentChat:j,utilityName:k}){let l=(0,g.c)("app"),m=(0,e.useRef)(null),n=(0,e.useRef)(null),[o,p]=(0,e.useState)(!0),r=c?`?rootId=${encodeURIComponent(c)}`:"",s=`/api/utilities/${a}/${b}/iframe${r}`,t=(0,d.jsx)("iframe",{ref:m,src:s,sandbox:"allow-scripts allow-forms allow-same-origin",className:h??"h-full w-full border-0 bg-white",title:i??`utility-${b}`});return j?(0,d.jsxs)("div",{className:"flex h-full w-full",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[t,!o&&(0,d.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:l("utilities.iframe.openHelper"),children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5"}),l("utilities.iframe.helper")]})]}),o&&(0,d.jsx)("div",{className:"w-80 shrink-0",children:(0,d.jsx)(q,{scope:a,utilityId:b,...k?{utilityName:k}:{},...c?{rootId:c}:{},requestSnapshot:()=>{let a=m.current?.contentWindow;return a?(n.current&&(clearTimeout(n.current.timer),n.current.resolve(void 0),n.current=null),new Promise(b=>{let c=setTimeout(()=>{n.current?.resolve===b&&(n.current=null,b(void 0))},500);n.current={resolve:b,timer:c};try{a.postMessage({type:"request-snapshot"},"*")}catch{clearTimeout(c),n.current=null,b(void 0)}})):Promise.resolve(void 0)},onClose:()=>p(!1)})})]}):t}p.callServer,p.findSourceMapURL,p.callServer,p.findSourceMapURL},65177:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},66979:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},73569:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("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"}]])}};
1
+ "use strict";exports.id=8142,exports.ids=[8142],exports.modules={58142:(a,b,c)=>{c.d(b,{UtilityIframe:()=>s});var d=c(64173),e=c(17240),f=c(53186),g=c(71813),h=c(65177),i=c(66979),j=c(69552),k=c(62261),l=c(73569),m=c(1056),n=c.n(m),o=c(44052),p=c(3265);function q({scope:a,utilityId:b,utilityName:c,rootId:m,requestSnapshot:p,onClose:q}){let s=(0,g.c)("app"),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useTransition)(),[D,E]=(0,e.useState)(!1),F=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useRef)("");let[G,H]=(0,e.useState)(""),I=()=>{let a=x.trim();a&&m&&t&&(y(""),w(b=>[...b,{role:"user",text:a,ts:new Date().toISOString()}]),C(async()=>{let b;try{b=await Promise.race([p(),new Promise(a=>setTimeout(()=>a(void 0),600))])}catch{}let c=void 0!==b?function(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b,null,2)}catch{c=String(b)}return c.length>4e3&&(c=c.slice(0,4e3)+"\n…[truncated]"),["[Mini-app context]",c,"[/context]\n",a].join("\n")}(a,b):a;try{let a=await fetch(`/api/roots/${m}/chat/${t}/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:c})});if(!a.ok){let b=await a.json().catch(()=>({}));o.oR.error(b.error??`HTTP ${a.status}`)}}catch(a){o.oR.error(String(a))}}))};return(0,d.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,d.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:s("utilities.helper.title")}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:s("utilities.helper.hint")}),m&&t&&(0,d.jsx)(n(),{href:`/roots/${m}/chat/${t}`,className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:s("utilities.helper.openFull"),children:(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"})}),q&&(0,d.jsx)("button",{type:"button",onClick:q,className:"p-1 rounded hover:bg-accent "+(m&&t?"":"ml-auto"),title:s("utilities.helper.hide"),children:(0,d.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}),(0,d.jsxs)("div",{ref:F,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[z&&(0,d.jsx)("p",{className:"text-xs text-red-600",children:z}),!z&&0===v.length&&!G&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,d.jsx)(j.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,d.jsx)("span",{children:s("utilities.helper.welcome")})]}),v.map((a,b)=>(0,d.jsx)(r,{role:a.role,text:a.text},b)),D&&G&&(0,d.jsx)(r,{role:"assistant",text:G,streaming:!0}),B&&!D&&(0,d.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}),s("utilities.helper.thinking")]})]}),(0,d.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,d.jsx)("textarea",{value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),I())},rows:1,placeholder:s("utilities.helper.placeholder"),disabled:B||!!z||!t,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,d.jsx)("button",{type:"button",onClick:I,disabled:B||!x.trim()||!!z||!t,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:B?(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]})}function r({role:a,text:b,streaming:c}){let e=(0,g.c)("app"),f=b;return("user"===a&&(f=f.replace(/^\s*\[Mini-app context\][\s\S]*?\[\/context\]\s*/,"").trim()),f.trim())?(0,d.jsxs)("div",{className:"user"===a?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,d.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[e("user"===a?"utilities.helper.you":"assistant"===a?"utilities.helper.reflex":"utilities.helper.system"),c&&(0,d.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),f]}):null}function s({scope:a,id:b,rootId:c,className:h,title:i,agentChat:j,utilityName:k}){let l=(0,g.c)("app"),m=(0,e.useRef)(null),n=(0,e.useRef)(null),[o,p]=(0,e.useState)(!0),r=c?`?rootId=${encodeURIComponent(c)}`:"",s=`/api/utilities/${a}/${b}/iframe${r}`,t=(0,d.jsx)("iframe",{ref:m,src:s,sandbox:"allow-scripts allow-forms allow-same-origin",className:h??"h-full w-full border-0 bg-white",title:i??`utility-${b}`});return j?(0,d.jsxs)("div",{className:"flex h-full w-full",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[t,!o&&(0,d.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:l("utilities.iframe.openHelper"),children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5"}),l("utilities.iframe.helper")]})]}),o&&(0,d.jsx)("div",{className:"w-80 shrink-0",children:(0,d.jsx)(q,{scope:a,utilityId:b,...k?{utilityName:k}:{},...c?{rootId:c}:{},requestSnapshot:()=>{let a=m.current?.contentWindow;return a?(n.current&&(clearTimeout(n.current.timer),n.current.resolve(void 0),n.current=null),new Promise(b=>{let c=setTimeout(()=>{n.current?.resolve===b&&(n.current=null,b(void 0))},500);n.current={resolve:b,timer:c};try{a.postMessage({type:"request-snapshot"},"*")}catch{clearTimeout(c),n.current=null,b(void 0)}})):Promise.resolve(void 0)},onClose:()=>p(!1)})})]}):t}p.callServer,p.findSourceMapURL,p.callServer,p.findSourceMapURL},65177:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},66979:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},73569:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("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"}]])}};
@@ -1 +1 @@
1
- "use strict";exports.id=9098,exports.ids=[9098],exports.modules={39098:(a,b,c)=>{c.d(b,{O1:()=>p,Gh:()=>q,AZ:()=>o,rD:()=>r,summarizeYoutubeAction:()=>n});var d=c(73745);c(66493);var e=c(70333);let f=globalThis.__reflexGeminiModelsCache??new Map;async function g(a){let b,c=await (0,e.CG)("gemini");if(!c)throw Error("Gemini API key not configured");let d=c.slice(0,16),g=f.get(d);if(!a?.refresh&&g&&Date.now()-g.fetchedAt<36e5)return g.models;let i=[];do{let a=new URL("https://generativelanguage.googleapis.com/v1beta/models");a.searchParams.set("key",c),a.searchParams.set("pageSize","100"),b&&a.searchParams.set("pageToken",b);let d=await fetch(a.toString(),{headers:{Accept:"application/json"}});if(!d.ok){let a=await d.text();throw Error(`models.list HTTP ${d.status}: ${a.slice(0,500)}`)}let e=await d.json();for(let a of e.models??[]){if(!a.name)continue;let b=a.supportedGenerationMethods??[];if(!b.includes("generateContent"))continue;let c=a.name.toLowerCase();!c.includes("embedding")&&(c.includes("aqa")||i.push({name:a.name,id:a.name.replace(/^models\//,""),...a.displayName?{displayName:a.displayName}:{},...a.description?{description:a.description}:{},...void 0!==a.inputTokenLimit?{inputTokenLimit:a.inputTokenLimit}:{},...void 0!==a.outputTokenLimit?{outputTokenLimit:a.outputTokenLimit}:{},supportedGenerationMethods:b}))}b=e.nextPageToken}while(b);return i.sort(h),f.set(d,{fetchedAt:Date.now(),models:i}),i}function h(a,b){let c=i(a.id),d=i(b.id);if(c!==d)return c-d;let e=j(a.id),f=j(b.id);return e!==f?f-e:a.id.localeCompare(b.id)}function i(a){return a.endsWith("flash-latest")?0:a.includes("flash")&&!a.includes("lite")?1:a.includes("flash-lite")?2:a.endsWith("pro-latest")||a.includes("pro")?3:4}function j(a){let b=/gemini-(\d+)\.(\d+)/.exec(a);return b?100*Number(b[1])+Number(b[2]):0}async function k(a="general"){let b=await (0,e.$L)("gemini");if("video"===a&&b?.videoModel)return b.videoModel;if(b?.model)return b.model;try{let a=await g();if(a.length>0)return a[0].id}catch{}return"gemini-flash-latest"}async function l(a){let b=`https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(a.model)}:generateContent?key=${encodeURIComponent(a.apiKey)}`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:a.contents,...a.generationConfig?{generationConfig:a.generationConfig}:{}})}),d=await c.text();if(!c.ok)throw Error(`Gemini HTTP ${c.status}: ${d.slice(0,800)}`);let e=JSON.parse(d);if(e.promptFeedback?.blockReason)throw Error(`Gemini blocked: ${e.promptFeedback.blockReason}`);return{text:(e.candidates??[]).flatMap(a=>a.content?.parts??[]).map(a=>a.text??"").filter(Boolean).join("\n").trim(),raw:e}}globalThis.__reflexGeminiModelsCache=f;var m=c(36017);async function n(a){var b;let c=await (0,e.CG)("gemini");if(!c)return{ok:!1,needsKey:!0,error:"Gemini API key is not saved — enter it to summarize videos."};let d=(await (0,m.M)()).language??"russian",f=a.prompt?.trim()||(b=d,/russ/i.test(b)||RegExp("рус","i").test(b)?"Produce a structured summary of this YouTube video:\n\n1. One paragraph — what the video is about and who it's for.\n2. Main points as a bulleted list with `[mm:ss]` timestamps.\n3. Notable quotes (any memorable phrases) — with timestamps.\n4. If diagrams / slides / code are shown — briefly describe them.\n5. 1-3 sentence takeaway: the main point worth retaining.\n\nRespond in Russian, concisely. No filler.":"Produce a structured summary of this YouTube video:\n\n1. One paragraph — what the video is about and who it's for.\n2. Main points as a bulleted list with `[mm:ss]` timestamps.\n3. Notable quotes (if any) with timestamps.\n4. If diagrams / slides / code are shown — briefly describe them.\n5. 1-3 sentence takeaway.\n\nBe concise. No filler."),g=a.modelOverride?.trim()||await k("video");try{let{text:b}=await l({model:g,apiKey:c,contents:[{parts:[{file_data:{file_uri:a.url,mime_type:"video/*"}},{text:f}]}]});if(!b)return{ok:!1,error:"Gemini returned an empty response — the video may be unavailable or private."};return{ok:!0,text:b,model:g}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function o(a){try{if(!a.trim())return{ok:!1,error:"API key is empty"};return await (0,e.Pc)("gemini",a),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a){return{ok:!0,present:await (0,e.hasApiKey)(a)}}async function q(a=!1){try{let b=await g({refresh:a});return{ok:!0,models:b.map(a=>({id:a.id,...a.displayName?{displayName:a.displayName}:{},...a.description?{description:a.description}:{},...void 0!==a.inputTokenLimit?{inputTokenLimit:a.inputTokenLimit}:{},...void 0!==a.outputTokenLimit?{outputTokenLimit:a.outputTokenLimit}:{}})),currentModel:await k("general"),currentVideoModel:await k("video")}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function r(a){try{return await (0,e.ND)("gemini",a),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}(0,c(63781).D)([n,o,p,q,r]),(0,d.A)(n,"40b059f91096cd065ba15298feca2514275bf3d64f",null),(0,d.A)(o,"40a9e3ea19ff7efc6593d5ae9558678b4ca05eaf04",null),(0,d.A)(p,"40b847d42cf05ea2b3310ca3a1a62f9c19ca910ca3",null),(0,d.A)(q,"40af3a8031c14f34a82ac50295ab2d603622acf1c5",null),(0,d.A)(r,"408098883d63fe3304b5ec8c555043b422e01d8c20",null)}};
1
+ "use strict";exports.id=9098,exports.ids=[9098],exports.modules={39098:(a,b,c)=>{c.d(b,{O1:()=>p,Gh:()=>q,AZ:()=>o,rD:()=>r,summarizeYoutubeAction:()=>n});var d=c(73745);c(66493);var e=c(70333);let f=globalThis.__reflexGeminiModelsCache??new Map;async function g(a){let b,c=await (0,e.CG)("gemini");if(!c)throw Error("Gemini API key not configured");let d=c.slice(0,16),g=f.get(d);if(!a?.refresh&&g&&Date.now()-g.fetchedAt<36e5)return g.models;let i=[];do{let a=new URL("https://generativelanguage.googleapis.com/v1beta/models");a.searchParams.set("key",c),a.searchParams.set("pageSize","100"),b&&a.searchParams.set("pageToken",b);let d=await fetch(a.toString(),{headers:{Accept:"application/json"}});if(!d.ok){let a=await d.text();throw Error(`models.list HTTP ${d.status}: ${a.slice(0,500)}`)}let e=await d.json();for(let a of e.models??[]){if(!a.name)continue;let b=a.supportedGenerationMethods??[];if(!b.includes("generateContent"))continue;let c=a.name.toLowerCase();!c.includes("embedding")&&(c.includes("aqa")||i.push({name:a.name,id:a.name.replace(/^models\//,""),...a.displayName?{displayName:a.displayName}:{},...a.description?{description:a.description}:{},...void 0!==a.inputTokenLimit?{inputTokenLimit:a.inputTokenLimit}:{},...void 0!==a.outputTokenLimit?{outputTokenLimit:a.outputTokenLimit}:{},supportedGenerationMethods:b}))}b=e.nextPageToken}while(b);return i.sort(h),f.set(d,{fetchedAt:Date.now(),models:i}),i}function h(a,b){let c=i(a.id),d=i(b.id);if(c!==d)return c-d;let e=j(a.id),f=j(b.id);return e!==f?f-e:a.id.localeCompare(b.id)}function i(a){return a.endsWith("flash-latest")?0:a.includes("flash")&&!a.includes("lite")?1:a.includes("flash-lite")?2:a.endsWith("pro-latest")||a.includes("pro")?3:4}function j(a){let b=/gemini-(\d+)\.(\d+)/.exec(a);return b?100*Number(b[1])+Number(b[2]):0}async function k(a="general"){let b=await (0,e.$L)("gemini");if("video"===a&&b?.videoModel)return b.videoModel;if(b?.model)return b.model;try{let a=await g();if(a.length>0)return a[0].id}catch{}return"gemini-flash-latest"}async function l(a){let b=`https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(a.model)}:generateContent?key=${encodeURIComponent(a.apiKey)}`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:a.contents,...a.generationConfig?{generationConfig:a.generationConfig}:{}})}),d=await c.text();if(!c.ok)throw Error(`Gemini HTTP ${c.status}: ${d.slice(0,800)}`);let e=JSON.parse(d);if(e.promptFeedback?.blockReason)throw Error(`Gemini blocked: ${e.promptFeedback.blockReason}`);return{text:(e.candidates??[]).flatMap(a=>a.content?.parts??[]).map(a=>a.text??"").filter(Boolean).join("\n").trim(),raw:e}}globalThis.__reflexGeminiModelsCache=f;var m=c(36017);async function n(a){var b;let c=await (0,e.CG)("gemini");if(!c)return{ok:!1,needsKey:!0,error:"Gemini API key is not saved — enter it to summarize videos."};let d=(await (0,m.M)()).language??"russian",f=a.prompt?.trim()||(b=d,/russ/i.test(b)||RegExp("рус","i").test(b)?"Produce a structured summary of this YouTube video:\n\n1. One paragraph — what the video is about and who it's for.\n2. Main points as a bulleted list with `[mm:ss]` timestamps.\n3. Notable quotes (any memorable phrases) — with timestamps.\n4. If diagrams / slides / code are shown — briefly describe them.\n5. 1-3 sentence takeaway: the main point worth retaining.\n\nRespond in Russian, concisely. No filler.":"Produce a structured summary of this YouTube video:\n\n1. One paragraph — what the video is about and who it's for.\n2. Main points as a bulleted list with `[mm:ss]` timestamps.\n3. Notable quotes (if any) with timestamps.\n4. If diagrams / slides / code are shown — briefly describe them.\n5. 1-3 sentence takeaway.\n\nBe concise. No filler."),g=a.modelOverride?.trim()||await k("video");try{let{text:b}=await l({model:g,apiKey:c,contents:[{parts:[{file_data:{file_uri:a.url,mime_type:"video/*"}},{text:f}]}]});if(!b)return{ok:!1,error:"Gemini returned an empty response — the video may be unavailable or private."};return{ok:!0,text:b,model:g}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function o(a){try{if(!a.trim())return{ok:!1,error:"API key is empty"};return await (0,e.Pc)("gemini",a),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a){return{ok:!0,present:await (0,e.hasApiKey)(a)}}async function q(a=!1){try{let b=await g({refresh:a});return{ok:!0,models:b.map(a=>({id:a.id,...a.displayName?{displayName:a.displayName}:{},...a.description?{description:a.description}:{},...void 0!==a.inputTokenLimit?{inputTokenLimit:a.inputTokenLimit}:{},...void 0!==a.outputTokenLimit?{outputTokenLimit:a.outputTokenLimit}:{}})),currentModel:await k("general"),currentVideoModel:await k("video")}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function r(a){try{return await (0,e.ND)("gemini",a),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}(0,c(63781).D)([n,o,p,q,r]),(0,d.A)(n,"408c0ad85dae45d66a47ce63a7e36c290ec25af47d",null),(0,d.A)(o,"40b0a116af1bfb9f70336ace63436ef128cfd4c6b6",null),(0,d.A)(p,"4036300f8624cb51c0e2918c09796cbcd4025824b4",null),(0,d.A)(q,"4031d5ebb9cc210e06f8217d6bc629135ef4c1f5bd",null),(0,d.A)(r,"40082ec70d0b2a4630ca385f69cd615a7db57e5a23",null)}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=9496,exports.ids=[9496],exports.modules={9496:(a,b,c)=>{c.d(b,{diagram:()=>t});var d=c(36499),e=c(43051),f=c(50154);c(19729),c(29872),c(6520),c(15251),c(91587),c(15667),c(86947);var g=c(41553),h=c(77703);let i=new Uint8Array(16),j=[];for(let a=0;a<256;++a)j.push((a+256).toString(16).slice(1));var k=c(86317),l=c(1141),m=c(34556),n=function(){var a=(0,h.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[1,4],c=[1,13],d=[1,12],e=[1,15],f=[1,16],g=[1,20],i=[1,19],j=[6,7,8],k=[1,26],l=[1,24],m=[1,25],n=[6,7,11],o=[1,6,13,15,16,19,22],p=[1,33],q=[1,34],r=[1,6,7,11,13,15,16,19,22],s={trace:(0,h.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:(0,h.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 6:case 7:return d;case 8:d.getLogger().trace("Stop NL ");break;case 9:d.getLogger().trace("Stop EOF ");break;case 11:d.getLogger().trace("Stop NL2 ");break;case 12:d.getLogger().trace("Stop EOF2 ");break;case 15:d.getLogger().info("Node: ",f[h].id),d.addNode(f[h-1].length,f[h].id,f[h].descr,f[h].type);break;case 16:d.getLogger().trace("Icon: ",f[h]),d.decorateNode({icon:f[h]});break;case 17:case 21:d.decorateNode({class:f[h]});break;case 18:d.getLogger().trace("SPACELIST");break;case 19:d.getLogger().trace("Node: ",f[h].id),d.addNode(0,f[h].id,f[h].descr,f[h].type);break;case 20:d.decorateNode({icon:f[h]});break;case 25:d.getLogger().trace("node found ..",f[h-2]),this.$={id:f[h-1],descr:f[h-1],type:d.getType(f[h-2],f[h])};break;case 26:this.$={id:f[h],descr:f[h],type:d.nodeType.DEFAULT};break;case 27:d.getLogger().trace("node found ..",f[h-3]),this.$={id:f[h-3],descr:f[h-1],type:d.getType(f[h-2],f[h])}}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:b},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:b},{6:c,7:[1,10],9:9,12:11,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},a(j,[2,3]),{1:[2,2]},a(j,[2,4]),a(j,[2,5]),{1:[2,6],6:c,12:21,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},{6:c,9:22,12:11,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},{6:k,7:l,10:23,11:m},a(n,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:g,22:i}),a(n,[2,18]),a(n,[2,19]),a(n,[2,20]),a(n,[2,21]),a(n,[2,23]),a(n,[2,24]),a(n,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:l,10:32,11:m},{1:[2,7],6:c,12:21,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},a(o,[2,14],{7:p,11:q}),a(r,[2,8]),a(r,[2,9]),a(r,[2,10]),a(n,[2,15]),a(n,[2,16]),a(n,[2,17]),{20:[1,35]},{21:[1,36]},a(o,[2,13],{7:p,11:q}),a(r,[2,11]),a(r,[2,12]),{21:[1,37]},a(n,[2,25]),a(n,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,h.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,h.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],g=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,h.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=g[v]&&g[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],g[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=g[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function t(){this.yy={}}return s.lexer={EOF:1,parseError:(0,h.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,h.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,h.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,h.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K2)(function(){return this._more=!0,this},"more"),reject:(0,h.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,h.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,h.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,h.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,h.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,h.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,h.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,h.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,h.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,h.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,h.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K2)(function(a,b,c,d){switch(c){case 0:return a.getLogger().trace("Found comment",b.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:a.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return a.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:a.getLogger().trace("end icon"),this.popState();break;case 10:return a.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return a.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return a.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return a.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 24:a.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return a.getLogger().trace("description:",b.yytext),"NODE_DESCR";case 27:return this.popState(),a.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),a.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),a.getLogger().trace("node end ...",b.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),a.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),a.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return a.getLogger().trace("Long description:",b.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}},(0,h.K2)(t,"Parser"),t.prototype=s,s.Parser=t,new t}();n.parser=n;var o={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},p=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=o,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{(0,h.K2)(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(a){for(let b=this.nodes.length-1;b>=0;b--)if(this.nodes[b].level<a)return this.nodes[b];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(a,b,c,d){h.Rm.info("addNode",a,b,c,d);let e=!1;0===this.nodes.length?(this.baseLevel=a,a=0,e=!0):void 0!==this.baseLevel&&(a-=this.baseLevel,e=!1);let f=(0,g.D7)(),i=f.mindmap?.padding??g.UI.mindmap.padding;switch(d){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:i*=2}let j={id:this.count++,nodeId:(0,g.jZ)(b,f),level:a,descr:(0,g.jZ)(c,f),type:d,children:[],width:f.mindmap?.maxNodeWidth??g.UI.mindmap.maxNodeWidth,padding:i,isRoot:e},k=this.getParent(a);if(k)k.children.push(j),this.nodes.push(j);else if(e)this.nodes.push(j);else throw Error(`There can be only one root. No parent could be found for ("${j.descr}")`)}getType(a,b){switch(h.Rm.debug("In get type",a,b),a){case"[":return this.nodeType.RECT;case"(":return")"===b?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(a,b){this.elements[a]=b}getElementById(a){return this.elements[a]}decorateNode(a){if(!a)return;let b=(0,g.D7)(),c=this.nodes[this.nodes.length-1];a.icon&&(c.icon=(0,g.jZ)(a.icon,b)),a.class&&(c.class=(0,g.jZ)(a.class,b))}type2Str(a){switch(a){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(a,b){if(0===a.level?a.section=void 0:a.section=b,a.children)for(let[c,d]of a.children.entries()){let e=0===a.level?c%11:b;this.assignSections(d,e)}}flattenNodes(a,b){let c=(0,g.D7)(),d=["mindmap-node"];!0===a.isRoot?d.push("section-root","section--1"):void 0!==a.section&&d.push(`section-${a.section}`),a.class&&d.push(a.class);let e=d.join(" "),f=(0,h.K2)(a=>{let b=(c.theme?.toLowerCase()??"").includes("redux");switch(a){case o.CIRCLE:return"mindmapCircle";case o.RECT:return"rect";case o.ROUNDED_RECT:return"rounded";case o.CLOUD:return"cloud";case o.BANG:return"bang";case o.HEXAGON:return"hexagon";case o.DEFAULT:return b?"rounded":"defaultMindmapNode";case o.NO_BORDER:default:return"rect"}},"getShapeFromType"),i={id:a.id.toString(),domId:"node_"+a.id.toString(),label:a.descr,labelType:"markdown",isGroup:!1,shape:f(a.type),width:a.width,height:a.height??0,padding:a.padding,cssClasses:e,cssStyles:[],look:c.look,icon:a.icon,x:a.x,y:a.y,level:a.level,nodeId:a.nodeId,type:a.type,section:a.section};if(b.push(i),a.children)for(let c of a.children)this.flattenNodes(c,b)}generateEdges(a,b){if(!a.children)return;let c=(0,g.D7)();for(let d of a.children){let e="edge";void 0!==d.section&&(e+=` section-edge-${d.section}`);let f=a.level+1;e+=` edge-depth-${f}`;let g={id:`edge_${a.id}_${d.id}`,start:a.id.toString(),end:d.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:c.look,classes:e,depth:a.level,section:d.section};b.push(g),this.generateEdges(d,b)}}getData(){var a,b;let c=this.getMindmap(),d=(0,g.D7)();if(void 0!==(0,g.TM)().layout||(d.layout="cose-bilkent"),!c)return{nodes:[],edges:[],config:d};h.Rm.debug("getData: mindmapRoot",c,d),this.assignSections(c);let e=[],f=[];this.flattenNodes(c,e),this.generateEdges(c,f),h.Rm.debug(`getData: processed ${e.length} nodes and ${f.length} edges`);let k=new Map;for(let a of e)k.set(a.id,{shape:a.shape,width:a.width,height:a.height,padding:a.padding});return{nodes:e,edges:f,config:d,rootNode:c,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(k),type:"mindmap",diagramId:"mindmap-"+(crypto.randomUUID?crypto.randomUUID():function(a,b,c){let d=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(i);if(d.length<16)throw Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=d[a];return b}return function(a,b=0){return(j[a[b+0]]+j[a[b+1]]+j[a[b+2]]+j[a[b+3]]+"-"+j[a[b+4]]+j[a[b+5]]+"-"+j[a[b+6]]+j[a[b+7]]+"-"+j[a[b+8]]+j[a[b+9]]+"-"+j[a[b+10]]+j[a[b+11]]+j[a[b+12]]+j[a[b+13]]+j[a[b+14]]+j[a[b+15]]).toLowerCase()}(d)}(a,b,void 0))}}getLogger(){return h.Rm}},q=(0,h.K2)(async(a,b,c,i)=>{h.Rm.debug("Rendering mindmap diagram\n"+a);let j=i.db,k=j.getData(),l=(0,d.A)(b,k.config.securityLevel);if(k.type=i.type,k.layoutAlgorithm=(0,f.q7)(k.config.layout,{fallback:"cose-bilkent"}),k.diagramId=b,!j.getMindmap())return;k.nodes.forEach(a=>{"rounded"===a.shape?(a.radius=15,a.taper=15,a.stroke="none",a.width=0,a.padding=15):"circle"===a.shape?a.padding=10:"rect"===a.shape?(a.width=0,a.padding=10):"hexagon"===a.shape&&(a.width=0,a.height=0)}),await (0,f.XX)(k,l);let{themeVariables:m}=(0,g.zj)(),{useGradient:n,gradientStart:o,gradientStop:p}=m;if(n&&o&&p){let a=l.attr("id"),b=l.append("defs").append("linearGradient").attr("id",`${a}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",p).attr("stop-opacity",1)}(0,e.P)(l,k.config.mindmap?.padding??g.UI.mindmap.padding,"mindmapDiagram",k.config.mindmap?.useMaxWidth??g.UI.mindmap.useMaxWidth)},"draw"),r=(0,h.K2)(a=>{let{theme:b,look:c}=a,d="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++)a["lineColor"+b]=a["lineColor"+b]||a["cScaleInv"+b],(0,k.A)(a["lineColor"+b])?a["lineColor"+b]=(0,l.A)(a["lineColor"+b],20):a["lineColor"+b]=(0,m.A)(a["lineColor"+b],20);for(let e=0;e<a.THEME_COLOR_LIMIT;e++){let f=""+("neo"===c?Math.max(10-(e-1)*2,2):17-3*e);d+=`
1
+ "use strict";exports.id=9496,exports.ids=[9496],exports.modules={9496:(a,b,c)=>{c.d(b,{diagram:()=>t});var d=c(36499),e=c(43051),f=c(50154);c(19729),c(29872),c(6520),c(15251),c(91587),c(15667),c(86947);var g=c(41553),h=c(77703);let i=new Uint8Array(16),j=[];for(let a=0;a<256;++a)j.push((a+256).toString(16).slice(1));var k=c(86317),l=c(1141),m=c(12175),n=function(){var a=(0,h.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[1,4],c=[1,13],d=[1,12],e=[1,15],f=[1,16],g=[1,20],i=[1,19],j=[6,7,8],k=[1,26],l=[1,24],m=[1,25],n=[6,7,11],o=[1,6,13,15,16,19,22],p=[1,33],q=[1,34],r=[1,6,7,11,13,15,16,19,22],s={trace:(0,h.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:(0,h.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 6:case 7:return d;case 8:d.getLogger().trace("Stop NL ");break;case 9:d.getLogger().trace("Stop EOF ");break;case 11:d.getLogger().trace("Stop NL2 ");break;case 12:d.getLogger().trace("Stop EOF2 ");break;case 15:d.getLogger().info("Node: ",f[h].id),d.addNode(f[h-1].length,f[h].id,f[h].descr,f[h].type);break;case 16:d.getLogger().trace("Icon: ",f[h]),d.decorateNode({icon:f[h]});break;case 17:case 21:d.decorateNode({class:f[h]});break;case 18:d.getLogger().trace("SPACELIST");break;case 19:d.getLogger().trace("Node: ",f[h].id),d.addNode(0,f[h].id,f[h].descr,f[h].type);break;case 20:d.decorateNode({icon:f[h]});break;case 25:d.getLogger().trace("node found ..",f[h-2]),this.$={id:f[h-1],descr:f[h-1],type:d.getType(f[h-2],f[h])};break;case 26:this.$={id:f[h],descr:f[h],type:d.nodeType.DEFAULT};break;case 27:d.getLogger().trace("node found ..",f[h-3]),this.$={id:f[h-3],descr:f[h-1],type:d.getType(f[h-2],f[h])}}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:b},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:b},{6:c,7:[1,10],9:9,12:11,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},a(j,[2,3]),{1:[2,2]},a(j,[2,4]),a(j,[2,5]),{1:[2,6],6:c,12:21,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},{6:c,9:22,12:11,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},{6:k,7:l,10:23,11:m},a(n,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:g,22:i}),a(n,[2,18]),a(n,[2,19]),a(n,[2,20]),a(n,[2,21]),a(n,[2,23]),a(n,[2,24]),a(n,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:l,10:32,11:m},{1:[2,7],6:c,12:21,13:d,14:14,15:e,16:f,17:17,18:18,19:g,22:i},a(o,[2,14],{7:p,11:q}),a(r,[2,8]),a(r,[2,9]),a(r,[2,10]),a(n,[2,15]),a(n,[2,16]),a(n,[2,17]),{20:[1,35]},{21:[1,36]},a(o,[2,13],{7:p,11:q}),a(r,[2,11]),a(r,[2,12]),{21:[1,37]},a(n,[2,25]),a(n,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,h.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,h.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],g=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,h.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=g[v]&&g[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],g[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=g[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function t(){this.yy={}}return s.lexer={EOF:1,parseError:(0,h.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,h.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,h.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,h.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K2)(function(){return this._more=!0,this},"more"),reject:(0,h.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,h.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,h.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,h.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,h.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,h.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,h.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,h.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,h.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,h.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,h.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K2)(function(a,b,c,d){switch(c){case 0:return a.getLogger().trace("Found comment",b.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:a.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return a.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:a.getLogger().trace("end icon"),this.popState();break;case 10:return a.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return a.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return a.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return a.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 24:a.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return a.getLogger().trace("description:",b.yytext),"NODE_DESCR";case 27:return this.popState(),a.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),a.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),a.getLogger().trace("node end ...",b.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),a.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),a.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return a.getLogger().trace("Long description:",b.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}},(0,h.K2)(t,"Parser"),t.prototype=s,s.Parser=t,new t}();n.parser=n;var o={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},p=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=o,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{(0,h.K2)(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(a){for(let b=this.nodes.length-1;b>=0;b--)if(this.nodes[b].level<a)return this.nodes[b];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(a,b,c,d){h.Rm.info("addNode",a,b,c,d);let e=!1;0===this.nodes.length?(this.baseLevel=a,a=0,e=!0):void 0!==this.baseLevel&&(a-=this.baseLevel,e=!1);let f=(0,g.D7)(),i=f.mindmap?.padding??g.UI.mindmap.padding;switch(d){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:i*=2}let j={id:this.count++,nodeId:(0,g.jZ)(b,f),level:a,descr:(0,g.jZ)(c,f),type:d,children:[],width:f.mindmap?.maxNodeWidth??g.UI.mindmap.maxNodeWidth,padding:i,isRoot:e},k=this.getParent(a);if(k)k.children.push(j),this.nodes.push(j);else if(e)this.nodes.push(j);else throw Error(`There can be only one root. No parent could be found for ("${j.descr}")`)}getType(a,b){switch(h.Rm.debug("In get type",a,b),a){case"[":return this.nodeType.RECT;case"(":return")"===b?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(a,b){this.elements[a]=b}getElementById(a){return this.elements[a]}decorateNode(a){if(!a)return;let b=(0,g.D7)(),c=this.nodes[this.nodes.length-1];a.icon&&(c.icon=(0,g.jZ)(a.icon,b)),a.class&&(c.class=(0,g.jZ)(a.class,b))}type2Str(a){switch(a){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(a,b){if(0===a.level?a.section=void 0:a.section=b,a.children)for(let[c,d]of a.children.entries()){let e=0===a.level?c%11:b;this.assignSections(d,e)}}flattenNodes(a,b){let c=(0,g.D7)(),d=["mindmap-node"];!0===a.isRoot?d.push("section-root","section--1"):void 0!==a.section&&d.push(`section-${a.section}`),a.class&&d.push(a.class);let e=d.join(" "),f=(0,h.K2)(a=>{let b=(c.theme?.toLowerCase()??"").includes("redux");switch(a){case o.CIRCLE:return"mindmapCircle";case o.RECT:return"rect";case o.ROUNDED_RECT:return"rounded";case o.CLOUD:return"cloud";case o.BANG:return"bang";case o.HEXAGON:return"hexagon";case o.DEFAULT:return b?"rounded":"defaultMindmapNode";case o.NO_BORDER:default:return"rect"}},"getShapeFromType"),i={id:a.id.toString(),domId:"node_"+a.id.toString(),label:a.descr,labelType:"markdown",isGroup:!1,shape:f(a.type),width:a.width,height:a.height??0,padding:a.padding,cssClasses:e,cssStyles:[],look:c.look,icon:a.icon,x:a.x,y:a.y,level:a.level,nodeId:a.nodeId,type:a.type,section:a.section};if(b.push(i),a.children)for(let c of a.children)this.flattenNodes(c,b)}generateEdges(a,b){if(!a.children)return;let c=(0,g.D7)();for(let d of a.children){let e="edge";void 0!==d.section&&(e+=` section-edge-${d.section}`);let f=a.level+1;e+=` edge-depth-${f}`;let g={id:`edge_${a.id}_${d.id}`,start:a.id.toString(),end:d.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:c.look,classes:e,depth:a.level,section:d.section};b.push(g),this.generateEdges(d,b)}}getData(){var a,b;let c=this.getMindmap(),d=(0,g.D7)();if(void 0!==(0,g.TM)().layout||(d.layout="cose-bilkent"),!c)return{nodes:[],edges:[],config:d};h.Rm.debug("getData: mindmapRoot",c,d),this.assignSections(c);let e=[],f=[];this.flattenNodes(c,e),this.generateEdges(c,f),h.Rm.debug(`getData: processed ${e.length} nodes and ${f.length} edges`);let k=new Map;for(let a of e)k.set(a.id,{shape:a.shape,width:a.width,height:a.height,padding:a.padding});return{nodes:e,edges:f,config:d,rootNode:c,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(k),type:"mindmap",diagramId:"mindmap-"+(crypto.randomUUID?crypto.randomUUID():function(a,b,c){let d=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(i);if(d.length<16)throw Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=d[a];return b}return function(a,b=0){return(j[a[b+0]]+j[a[b+1]]+j[a[b+2]]+j[a[b+3]]+"-"+j[a[b+4]]+j[a[b+5]]+"-"+j[a[b+6]]+j[a[b+7]]+"-"+j[a[b+8]]+j[a[b+9]]+"-"+j[a[b+10]]+j[a[b+11]]+j[a[b+12]]+j[a[b+13]]+j[a[b+14]]+j[a[b+15]]).toLowerCase()}(d)}(a,b,void 0))}}getLogger(){return h.Rm}},q=(0,h.K2)(async(a,b,c,i)=>{h.Rm.debug("Rendering mindmap diagram\n"+a);let j=i.db,k=j.getData(),l=(0,d.A)(b,k.config.securityLevel);if(k.type=i.type,k.layoutAlgorithm=(0,f.q7)(k.config.layout,{fallback:"cose-bilkent"}),k.diagramId=b,!j.getMindmap())return;k.nodes.forEach(a=>{"rounded"===a.shape?(a.radius=15,a.taper=15,a.stroke="none",a.width=0,a.padding=15):"circle"===a.shape?a.padding=10:"rect"===a.shape?(a.width=0,a.padding=10):"hexagon"===a.shape&&(a.width=0,a.height=0)}),await (0,f.XX)(k,l);let{themeVariables:m}=(0,g.zj)(),{useGradient:n,gradientStart:o,gradientStop:p}=m;if(n&&o&&p){let a=l.attr("id"),b=l.append("defs").append("linearGradient").attr("id",`${a}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",p).attr("stop-opacity",1)}(0,e.P)(l,k.config.mindmap?.padding??g.UI.mindmap.padding,"mindmapDiagram",k.config.mindmap?.useMaxWidth??g.UI.mindmap.useMaxWidth)},"draw"),r=(0,h.K2)(a=>{let{theme:b,look:c}=a,d="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++)a["lineColor"+b]=a["lineColor"+b]||a["cScaleInv"+b],(0,k.A)(a["lineColor"+b])?a["lineColor"+b]=(0,l.A)(a["lineColor"+b],20):a["lineColor"+b]=(0,m.A)(a["lineColor"+b],20);for(let e=0;e<a.THEME_COLOR_LIMIT;e++){let f=""+("neo"===c?Math.max(10-(e-1)*2,2):17-3*e);d+=`
2
2
  .section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} polygon, .section-${e-1} path {
3
3
  fill: ${a["cScale"+e]};
4
4
  }
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-f7bc4101f4444d07.js","static/chunks/6fe292aa-7126ff9d6732e864.js","static/chunks/146-ccee3b26755b68c8.js","static/chunks/main-app-ebe67847147d19aa.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-f7bc4101f4444d07.js","static/chunks/framework-aaa7c1a953276299.js","static/chunks/main-bfb98fc1d6aa1d45.js","static/chunks/pages/_app-bf8bc157ace53d59.js"],"/_error":["static/chunks/webpack-f7bc4101f4444d07.js","static/chunks/framework-aaa7c1a953276299.js","static/chunks/main-bfb98fc1d6aa1d45.js","static/chunks/pages/_error-da89ab2956f0cf38.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-84a033e55baef334.js","static/chunks/6fe292aa-7126ff9d6732e864.js","static/chunks/146-ccee3b26755b68c8.js","static/chunks/main-app-ebe67847147d19aa.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-84a033e55baef334.js","static/chunks/framework-aaa7c1a953276299.js","static/chunks/main-bfb98fc1d6aa1d45.js","static/chunks/pages/_app-bf8bc157ace53d59.js"],"/_error":["static/chunks/webpack-84a033e55baef334.js","static/chunks/framework-aaa7c1a953276299.js","static/chunks/main-bfb98fc1d6aa1d45.js","static/chunks/pages/_error-da89ab2956f0cf38.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "AoffeFQkXIEvh9BnegJev",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "EXjw93nBTcCbjijTOU77pf6W2/7etGKUB7Yq9GQyShY=",
22
- "__NEXT_PREVIEW_MODE_ID": "47c8698cddae42026a67110ad398be0c",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "9cc176a862b0eace5f6706c737126d2713f5c5c04b2ac578e8153ae9dc343cbb",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "427e3b259731d64da24c2c6716f772f43c881ca98202e385060442ec2bfb7df8"
20
+ "__NEXT_BUILD_ID": "LRmct3V5fYVu_lgUdqH4x",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "HhrI3zGLViF7J1G4+o83A6cTOk+ZDMloWF9IpA+eq1M=",
22
+ "__NEXT_PREVIEW_MODE_ID": "d6cac060153286b0495412008b911ffb",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "2304a6d7e710500e183cf2085c60cbf290310211191367fe39d7d22a674dcabd",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "5338bd2dba5ec4b5dfa373807ddaa38de6b6998215ba558a0ee830549f3b4e68"
25
25
  }
26
26
  }
27
27
  },
@@ -1 +1 @@
1
- self.__REACT_LOADABLE_MANIFEST='{"app/roots/[id]/chat/[topicId]/_components/interaction-cards.tsx -> @/lib/server/oauth-actions":{"id":94108,"files":["static/chunks/4108.40efe5d61bfc7f08.js"]}}';
1
+ self.__REACT_LOADABLE_MANIFEST='{"app/roots/[id]/chat/[topicId]/_components/interaction-cards.tsx -> @/lib/server/oauth-actions":{"id":94108,"files":["static/chunks/4108.86e2092ff9db450c.js"]}}';
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-f7bc4101f4444d07.js" defer=""></script><script src="/_next/static/chunks/framework-aaa7c1a953276299.js" defer=""></script><script src="/_next/static/chunks/main-bfb98fc1d6aa1d45.js" defer=""></script><script src="/_next/static/chunks/pages/_app-bf8bc157ace53d59.js" defer=""></script><script src="/_next/static/chunks/pages/_error-da89ab2956f0cf38.js" defer=""></script><script src="/_next/static/AoffeFQkXIEvh9BnegJev/_buildManifest.js" defer=""></script><script src="/_next/static/AoffeFQkXIEvh9BnegJev/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"AoffeFQkXIEvh9BnegJev","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-84a033e55baef334.js" defer=""></script><script src="/_next/static/chunks/framework-aaa7c1a953276299.js" defer=""></script><script src="/_next/static/chunks/main-bfb98fc1d6aa1d45.js" defer=""></script><script src="/_next/static/chunks/pages/_app-bf8bc157ace53d59.js" defer=""></script><script src="/_next/static/chunks/pages/_error-da89ab2956f0cf38.js" defer=""></script><script src="/_next/static/LRmct3V5fYVu_lgUdqH4x/_buildManifest.js" defer=""></script><script src="/_next/static/LRmct3V5fYVu_lgUdqH4x/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"LRmct3V5fYVu_lgUdqH4x","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>