@exulu/frontend 1.8.0 → 1.9.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/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +129 -131
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +7 -7
  11. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
  12. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  16. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
  18. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  21. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  22. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
  24. package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
  25. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
  31. package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/projects/page.js +1 -1
  34. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/(application)/prompts/page.js +1 -1
  36. package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  40. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  41. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  43. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  44. package/dist/.next/server/app/(application)/workflows/page.js +1 -1
  45. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  47. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/_not-found.html +1 -1
  49. package/dist/.next/server/app/_not-found.rsc +1 -1
  50. package/dist/.next/server/app-paths-manifest.json +6 -6
  51. package/dist/.next/server/chunks/1025.js +1 -0
  52. package/dist/.next/server/chunks/2270.js +11 -48
  53. package/dist/.next/server/chunks/3434.js +1 -1
  54. package/dist/.next/server/chunks/3503.js +1 -0
  55. package/dist/.next/server/chunks/5084.js +1 -0
  56. package/dist/.next/server/chunks/5192.js +1 -1
  57. package/dist/.next/server/chunks/5485.js +1 -1
  58. package/dist/.next/server/chunks/5600.js +1 -1
  59. package/dist/.next/server/chunks/5974.js +1 -0
  60. package/dist/.next/server/chunks/6590.js +1 -1
  61. package/dist/.next/server/chunks/7471.js +1 -1
  62. package/dist/.next/server/chunks/8286.js +1 -1
  63. package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
  64. package/dist/.next/server/middleware-manifest.json +5 -5
  65. package/dist/.next/server/pages/404.html +1 -1
  66. package/dist/.next/server/pages/500.html +1 -1
  67. package/dist/.next/server/server-reference-manifest.json +1 -1
  68. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
  69. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
  70. package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
  71. package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
  72. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
  73. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
  74. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
  75. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
  76. package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
  77. package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
  78. package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
  79. package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
  80. package/dist/.next/static/chunks/6373-601400fab8a3bb55.js +2 -0
  81. package/dist/.next/static/chunks/6373-601400fab8a3bb55.js.map +1 -0
  82. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
  83. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
  84. package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-0e69d89d2dac7111.js} +10 -10
  85. package/dist/.next/static/chunks/8293-0e69d89d2dac7111.js.map +1 -0
  86. package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
  87. package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
  88. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
  89. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
  90. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js +2 -0
  91. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js.map +1 -0
  92. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js +2 -0
  93. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js.map +1 -0
  94. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
  95. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
  96. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
  97. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
  98. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
  99. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
  100. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
  101. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
  102. package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
  103. package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
  104. package/dist/.next/static/css/6f8c5212af8ef284.css +4 -0
  105. package/dist/.next/static/css/6f8c5212af8ef284.css.map +1 -0
  106. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  107. package/package.json +1 -1
  108. package/dist/.next/server/chunks/2948.js +0 -1
  109. package/dist/.next/server/chunks/38.js +0 -1
  110. package/dist/.next/server/chunks/7958.js +0 -1
  111. package/dist/.next/server/chunks/8050.js +0 -1
  112. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
  113. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
  114. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
  115. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
  116. package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
  117. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
  118. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
  119. package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
  120. package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
  121. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
  122. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
  123. package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
  124. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
  125. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
  126. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
  127. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
  128. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
  129. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
  130. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
  131. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
  132. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
  133. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
  134. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
  135. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
  136. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
  137. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
  138. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
  139. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
  140. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
  141. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
  142. package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
  143. package/dist/.next/static/css/c8c015815c72d053.css +0 -4
  144. package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
  145. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_buildManifest.js +0 -0
  146. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";exports.id=5974,exports.ids=[5974],exports.modules={51602:(e,s,t)=>{t.d(s,{d:()=>u,f:()=>h});var l=t(10326),a=t(90772),n=t(77863),r=t(32933),i=t(43810),o=t(17577),d=t(54390),c=t(35057),m=t(48818);let x=(0,o.createContext)({code:""}),u=({code:e,language:s,showLineNumbers:t=!1,className:a,children:r,...i})=>l.jsx(x.Provider,{value:{code:e},children:l.jsx("div",{className:(0,n.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(d.Z,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:c.Z,children:e}),l.jsx(d.Z,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:m.Z,children:e}),r&&l.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})}),h=({onCopy:e,onError:s,timeout:t=2e3,children:d,className:c,...m})=>{let[u,h]=(0,o.useState)(!1),{code:p}=(0,o.useContext)(x),g=async()=>{s?.(Error("Clipboard API not available"))},f=u?r.Z:i.Z;return l.jsx(a.z,{className:(0,n.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...m,children:d??l.jsx(f,{size:14})})}},36931:(e,s,t)=>{t.d(s,{H:()=>u});var l=t(10326),a=t(77863),n=t(17577),r=t(16476),i=t(79283),o=t(70285),d=t(7833),c=t(51602);t(32289);let m=(0,t(39499).Z)(r.UG),x={ol:({node:e,children:s,className:t,...n})=>l.jsx("ol",{className:(0,a.cn)("ml-4 list-outside list-decimal",t),...n,children:s}),li:({node:e,children:s,className:t,...n})=>l.jsx("li",{className:(0,a.cn)("py-1",t),...n,children:s}),ul:({node:e,children:s,className:t,...n})=>l.jsx("ul",{className:(0,a.cn)("ml-4 list-outside list-disc",t),...n,children:s}),hr:({node:e,className:s,...t})=>l.jsx("hr",{className:(0,a.cn)("my-6 border-border",s),...t}),strong:({node:e,children:s,className:t,...n})=>l.jsx("span",{className:(0,a.cn)("font-semibold",t),...n,children:s}),a:({node:e,children:s,className:t,...n})=>l.jsx("a",{className:(0,a.cn)("font-medium text-primary underline",t),rel:"noreferrer",target:"_blank",...n,children:s}),h1:({node:e,children:s,className:t,...n})=>l.jsx("h1",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-3xl",t),...n,children:s}),h2:({node:e,children:s,className:t,...n})=>l.jsx("h2",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-2xl",t),...n,children:s}),h3:({node:e,children:s,className:t,...n})=>l.jsx("h3",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-xl",t),...n,children:s}),h4:({node:e,children:s,className:t,...n})=>l.jsx("h4",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-lg",t),...n,children:s}),h5:({node:e,children:s,className:t,...n})=>l.jsx("h5",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-base",t),...n,children:s}),h6:({node:e,children:s,className:t,...n})=>l.jsx("h6",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-sm",t),...n,children:s}),table:({node:e,children:s,className:t,...n})=>l.jsx("div",{className:"my-4 overflow-x-auto",children:l.jsx("table",{className:(0,a.cn)("w-full border-collapse border border-border",t),...n,children:s})}),thead:({node:e,children:s,className:t,...n})=>l.jsx("thead",{className:(0,a.cn)("bg-muted/50",t),...n,children:s}),tbody:({node:e,children:s,className:t,...n})=>l.jsx("tbody",{className:(0,a.cn)("divide-y divide-border",t),...n,children:s}),tr:({node:e,children:s,className:t,...n})=>l.jsx("tr",{className:(0,a.cn)("border-border border-b",t),...n,children:s}),th:({node:e,children:s,className:t,...n})=>l.jsx("th",{className:(0,a.cn)("px-4 py-2 text-left font-semibold text-sm",t),...n,children:s}),td:({node:e,children:s,className:t,...n})=>l.jsx("td",{className:(0,a.cn)("px-4 py-2 text-sm",t),...n,children:s}),blockquote:({node:e,children:s,className:t,...n})=>l.jsx("blockquote",{className:(0,a.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),...n,children:s}),code:({node:e,className:s,...t})=>e?.position?.start.line!==e?.position?.end.line?l.jsx("code",{className:s,...t}):l.jsx("code",{className:(0,a.cn)("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",s),...t}),pre:({node:e,className:s,children:t})=>{let r="javascript";"string"==typeof e?.properties?.className&&(r=e.properties.className.replace("language-",""));let i="";return(0,n.isValidElement)(t)&&t.props&&"string"==typeof t.props.children?i=t.props.children:"string"==typeof t&&(i=t),l.jsx(c.d,{className:(0,a.cn)("my-4 h-auto",s),code:i,language:r,children:l.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},u=(0,n.memo)(({className:e,options:s,children:t,allowedImagePrefixes:n,allowedLinkPrefixes:r,defaultOrigin:c,parseIncompleteMarkdown:u=!0,...h})=>{let p="string"==typeof t&&u?function(e){if(!e||"string"!=typeof e)return e;let s=e,t=s.match(/(!?\[)([^\]]*?)$/);if(t){let e=s.lastIndexOf(t[1]);s=s.substring(0,e)}if(s.match(/(\*\*)([^*]*?)$/)&&(s.match(/\*\*/g)||[]).length%2==1&&(s=`${s}**`),s.match(/(__)([^_]*?)$/)&&(s.match(/__/g)||[]).length%2==1&&(s=`${s}__`),s.match(/(\*)([^*]*?)$/)&&s.split("").reduce((e,t,l)=>{if("*"===t){let t=s[l-1],a=s[l+1];if("*"!==t&&"*"!==a)return e+1}return e},0)%2==1&&(s=`${s}*`),s.match(/(_)([^_]*?)$/)&&s.split("").reduce((e,t,l)=>{if("_"===t){let t=s[l-1],a=s[l+1];if("_"!==t&&"_"!==a)return e+1}return e},0)%2==1&&(s=`${s}_`),s.match(/(`)([^`]*?)$/)&&(s.includes("```"),(s.match(/```[\s\S]*?```/g)||[]).length,(s.match(/```/g)||[]).length%2!=1)){let e=0;for(let t=0;t<s.length;t++)if("`"===s[t]){let l="```"===s.substring(t,t+3),a=t>0&&"```"===s.substring(t-1,t+2),n=t>1&&"```"===s.substring(t-2,t+1);!(l||a||n)&&e++}e%2==1&&(s=`${s}\``)}return s.match(/(~~)([^~]*?)$/)&&(s.match(/~~/g)||[]).length%2==1&&(s=`${s}~~`),s}(t):t;return l.jsx("div",{className:(0,a.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:l.jsx(m,{allowedImagePrefixes:n??["*"],allowedLinkPrefixes:r??["*"],components:x,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[o.Z,d.Z],...s,children:p})})},(e,s)=>e.children===s.children);u.displayName="Response"},43273:(e,s,t)=>{t.d(s,{Cd:()=>d,X:()=>c,bZ:()=>o});var l=t(10326),a=t(79360),n=t(17577),r=t(77863);let i=(0,a.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",info:"border-info/50 text-info dark:border-info [&>svg]:text-info"}},defaultVariants:{variant:"default"}}),o=n.forwardRef(({className:e,variant:s,...t},a)=>l.jsx("div",{ref:a,role:"alert",className:(0,r.cn)(i({variant:s}),e),...t}));o.displayName="Alert";let d=n.forwardRef(({className:e,...s},t)=>l.jsx("h5",{ref:t,className:(0,r.cn)("mb-1 font-medium leading-none tracking-tight",e),...s}));d.displayName="AlertTitle";let c=n.forwardRef(({className:e,...s},t)=>l.jsx("div",{ref:t,className:(0,r.cn)("text-sm [&_p]:leading-relaxed",e),...s}));c.displayName="AlertDescription"},24295:(e,s,t)=>{t.d(s,{Fw:()=>r,wy:()=>n,zF:()=>a});var l=t(35663);let a=l.fC,n=l.wy,r=l.Fw},79210:(e,s,t)=>{t.d(s,{SP:()=>d,dr:()=>o,mQ:()=>i,nU:()=>c});var l=t(10326),a=t(28407),n=t(17577),r=t(77863);let i=a.fC,o=n.forwardRef(({className:e,...s},t)=>l.jsx(a.aV,{ref:t,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...s}));o.displayName=a.aV.displayName;let d=n.forwardRef(({className:e,...s},t)=>l.jsx(a.xz,{ref:t,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...s}));d.displayName=a.xz.displayName;let c=n.forwardRef(({className:e,...s},t)=>l.jsx(a.VY,{ref:t,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));c.displayName=a.VY.displayName},77961:(e,s,t)=>{t.d(s,{jF:()=>S,jU:()=>W,ZP:()=>F,NF:()=>U});var l=t(10326),a=t(17577);t(32964),t(59946),t(27221);var n=t(59161),r=t(30463);let i=function(e,s=[]){(0,a.useContext)(r.E);let[t,l]=(0,a.useState)(void 0);return t};var o=t(84714),d=t(31540),c=t(15557),m=t(61086),x=t(11890),u=t(39183),h=t(36283),p=t(71709),g=t(39572),f=t(83855),j=t(94019),b=t(3240),N=t(90772),v=t(62288),y=t(65685),w=t(3574),k=t(20108),C=t(10119),Z=t(54432),z=t(76812),_=t(33071),L=t(65304);function S({s3key:e,children:s}){let{data:t,isLoading:a,error:r,refetch:i}=(0,k.a)({queryKey:["fileObject",e],queryFn:async()=>e?await n.QZ.object(e):null,enabled:null!=e});if(!e)return l.jsx(_.Zb,{children:(0,l.jsxs)(_.aY,{className:"p-3 flex",children:[l.jsx("p",{className:"text-sm text-muted-foreground m-auto",children:"No file selected"}),s]})});let o=e,c="";return e.includes("[bucket:")&&(c=e.split("[bucket:")[1]?.split("]")[0]||"",o=e.split("[bucket:")[1]?.split("]")[0]||"",o?.length&&(o=e.split("]")[1]||"")),o=o.split("_EXULU_").pop()||"",(0,l.jsxs)(_.Zb,{children:[l.jsx(_.Ol,{className:"pb-3",children:l.jsx(_.ll,{className:"text-sm max-w-[500px] truncate",children:o})}),(0,l.jsxs)(_.aY,{className:"pt-0",children:[a&&(0,l.jsxs)("div",{className:"space-y-2",children:[l.jsx(L.O,{className:"h-4 w-full"}),l.jsx(L.O,{className:"h-4 w-2/3"})]}),!a&&t&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{className:"capitalize",children:[t?.ContentType.split("/").pop(),c&&` [Bucket: ${c}]`]}),(0,l.jsxs)("span",{children:[(t?.ContentLength/1024/1024).toFixed(2)," MB"]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{children:["Last modified: ",new Date(t?.LastModified).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})]}),(0,l.jsxs)(N.z,{variant:"secondary",size:"sm",type:"button",className:"h-7 px-2",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx("span",{className:"mr-1 text-xs",children:"View"}),l.jsx(d.Z,{className:"h-3 w-3"})]})]})]}),!a&&r&&l.jsx("p",{className:"text-xs text-muted-foreground",children:r.message}),s]})]})}function F({id:e,allowedFileTypes:s,dependencies:t,onConfirm:n,selectionLimit:r,buttonText:i}){let[o,d]=(0,a.useState)(!1);return(0,l.jsxs)(v.Vq,{open:o,onOpenChange:d,children:[l.jsx(v.hg,{asChild:!0,children:(0,l.jsxs)(N.z,{variant:"outline",children:[i&&l.jsx("span",{className:"mr-2",children:i}),l.jsx(c.Z,{className:"h-4 w-4"})]})}),(0,l.jsxs)(v.cZ,{className:"sm:max-w-[900px]",children:[(0,l.jsxs)(v.fK,{children:[l.jsx(v.$N,{children:"File Gallery"}),l.jsx(v.Be,{children:"Browse your previously uploaded files or upload new ones."})]}),l.jsx(O,{id:e,allowedFileTypes:s,dependencies:t,selectionLimit:r,onConfirm:e=>{n(e),d(!1)}})]})]})}let O=({id:e,allowedFileTypes:s,dependencies:t,onConfirm:d,selectionLimit:c})=>{s||(s=[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg",".mp4",".m4a",".mp3",".mpeg",".wav"]);let[h,p]=(0,a.useState)(void 0),[g,f]=(0,a.useState)(void 0),[j,b]=(0,a.useState)(void 0),v=(0,a.useContext)(r.E),[_,S]=(0,a.useState)([]),F=e=>{if(_.includes(e)){S(_.filter(s=>s!==e));return}if(1===c){S([e]);return}_.length>=c||S([..._,e])},O=(0,C.D)({mutationFn:async({key:e})=>{await n.QZ.delete(e),R()}}),{data:$,isLoading:U,error:P,refetch:R}=(0,k.a)({queryKey:["filesQuery",h,j],staleTime:3e4,queryFn:async()=>n.QZ.list({search:h,continuationToken:j})});console.log("!! data !!",$);let{theme:q}=(0,w.F)(),K=i({backend:v?.backend||"",uppyOptions:{id:e,allowedFileTypes:s},callbacks:{uploadSuccess:async e=>{console.log("data",e)}},maxNumberOfFiles:10},t);return((0,a.useEffect)(()=>{R()},[h,j]),K)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Previously Uploaded Files"}),l.jsx(Z.I,{placeholder:"Search files...",value:h,onChange:e=>p(e.target.value),className:"mb-3"}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground pb-2",children:[(0,l.jsxs)("span",{children:[_.length," / ",c," files selected"]}),(0,l.jsxs)("span",{children:["Allowed file types: ",s?.map(e=>e).join(", ")]})]}),(0,l.jsxs)(y.x,{children:[U&&(0,l.jsxs)("div",{className:"flex items-center justify-center h-full w-full grid grid-cols-2 sm:grid-cols-3 gap-3",children:[l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[!U&&!$?.Contents?.length&&(0,l.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(m.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-3"}),l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Nothing to see here... yet!"}),l.jsx("p",{className:"text-xs text-muted-foreground/75 mt-1",children:"Upload some files to get started"})]}),$?.Contents?.map(e=>l.jsx(W,{s3Key:e.Key,onSelect:F,active:_.some(s=>s===e.Key),onRemove:()=>{O.mutate({key:e.Key})},disabled:!!s&&!s?.some(s=>e.Key.endsWith(s))}))]}),l.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8 pt-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsxs)(N.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{b(void 0)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to first page"}),l.jsx(z.kRt,{className:"size-4"})]}),(0,l.jsxs)(N.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{b(g)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to previous page"}),l.jsx(x.Z,{className:"size-4"})]}),(0,l.jsxs)(N.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{f(j),b($?.NextContinuationToken)},disabled:!$?.NextContinuationToken||U,children:[l.jsx("span",{className:"sr-only",children:"Go to next page"}),l.jsx(u.Z,{className:"size-4"})]})]})})]})]}),(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Upload New Files"}),l.jsx(o.A,{uppy:K,theme:"dark"===q?"dark":"light"})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(N.z,{variant:"outline",onClick:()=>{d(_),S([])},children:"Confirm"})})]}):null},W=({s3Key:e,onSelect:s,onRemove:t,active:a,disabled:r,addToContext:i})=>{let o;return(0,l.jsxs)("div",{className:`${r?"opacity-50":""} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${a?"border border-purple-500":"border"}`,onClick:()=>{!r&&s&&s(e)},children:[l.jsx("div",{className:"aspect-square relative mb-2 bg-muted/50 rounded-md overflow-hidden flex items-center justify-center",children:e&&(e.toLowerCase().endsWith("jpg")||e.toLowerCase().endsWith("jpeg")||e.toLowerCase().endsWith("png")||e.toLowerCase().endsWith("svg"))?l.jsx(P,{fileKey:e}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full",children:[(o=e)?o.toLowerCase().endsWith("jpg")||o.toLowerCase().endsWith("jpeg")||o.toLowerCase().endsWith("png")||o.toLowerCase().endsWith("svg")?l.jsx(p.Z,{className:"h-6 w-6 text-blue-500"}):o.endsWith("pdf")?l.jsx(g.Z,{className:"h-6 w-6 text-red-500"}):o.endsWith("xls")||o.endsWith("xlsx")||o.endsWith("csv")?l.jsx(h.Z,{className:"h-6 w-6 text-green-500"}):o.endsWith("ppt")||o.endsWith("pptx")?l.jsx(h.Z,{className:"h-6 w-6 text-orange-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1 text-center",children:e?e.split("_EXULU_").pop():e})]})}),l.jsx("p",{className:"text-xs truncate",children:e?e.split("_EXULU_").pop():e}),(0,l.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 flex absolute top-1 right-1",children:[i&&(0,l.jsxs)(N.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{i(e)},children:[l.jsx(f.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Add"})]}),(0,l.jsxs)(N.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx(d.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"View"})]}),t&&(0,l.jsxs)(N.z,{onClick:s=>{s.stopPropagation(),t(e)},variant:"ghost",type:"button",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 bg-background/80 hover:bg-background ml-1",children:[l.jsx(j.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Remove"})]})]})]},e)},$={},U=async e=>{if($[e]){if(!($[e].expiresAt<Date.now()))return $[e].url;delete $[e]}let s=await n.QZ.download(e),t=await s.json();return console.log("json",t),$[e]={url:t.url,expiresAt:Date.now()+6e4},t.url},P=({fileKey:e})=>{console.log("key",e);let s=(0,k.a)({queryKey:["imageQuery",e],staleTime:3e4,queryFn:async()=>U(e)});return s.isLoading?l.jsx("div",{children:l.jsx(b.Z,{})}):s.isLoading||s.data?l.jsx("img",{src:s.data,alt:e,className:"object-cover w-full h-full"}):l.jsx("div",{children:l.jsx(m.Z,{})})}}};
@@ -1 +1 @@
1
- "use strict";exports.id=6590,exports.ids=[6590],exports.modules={86590:(e,s,a)=>{a.d(s,{$:()=>S});var t=a(10326),i=a(17577),r=a(33071),l=a(90772),n=a(567),c=a(60097),d=a(59593),o=a(231),m=a(43810),x=a(69508),h=a(98091),p=a(50732),u=a(66697),j=a(40617),f=a(79635),g=a(37358),v=a(48998),N=a(3151),w=a(52227),y=a(29429),b=a(85999),C=a(39167),A=a(42270),_=a(32663);function S({prompt:e,user:s,onUpdate:a}){let[S,D]=(0,i.useState)(!1),[Z,F]=(0,i.useState)(!1),[P]=(0,w.iJ)(),{toggleFavorite:$}=(0,w.Lq)(),k=function(e,s){let a="private"===e.rights_mode,t="public"===e.rights_mode,i="users"===e.rights_mode,r="roles"===e.rights_mode,l=s.super_admin,n=e.created_by===s.id.toString(),c=!1;if(n&&(c=!0),!a||n||l||(c=!1),t&&(c=!0),i){let a=e.RBAC?.users?.find(e=>e.id===s.id);c=a?.rights==="write"}if(r){let a=e.RBAC?.roles?.find(e=>e.id===s.role?.id);c=a?.rights==="write"}return l&&(c=!0),c}(e,s),z=(0,N.H)(e.content),E=e.is_favorited||!1,{data:B}=(0,C.aM)(A.W9,{variables:{ids:e.assigned_agents||[]},skip:!e.assigned_agents||0===e.assigned_agents.length}),I=B?.agentByIds?.map(e=>e.name)||[],{data:M}=(0,C.aM)(A.L5,{variables:{id:e.created_by},skip:!e.created_by}),R=M?.userById?.name||"Unknown",U=async()=>{if(confirm("Are you sure you want to delete this prompt?"))try{await P({variables:{id:e.id}}),b.Am.success("Prompt deleted successfully"),a()}catch(e){b.Am.error("Failed to delete prompt"),console.error(e)}},V=async()=>{if(!Z){F(!0);try{await $(e.id,s.id,E,e.favorite_count,void 0),b.Am.success(E?"Removed from favorites":"Added to favorites",{icon:E?"\uD83D\uDC4E":"\uD83D\uDC4D",duration:2e3}),a()}catch(e){b.Am.error("Failed to update favorite"),console.error(e)}finally{await new Promise(e=>setTimeout(e,200)),F(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.Zb,{className:"flex flex-col hover:shadow-md transition-shadow",children:[t.jsx(r.Ol,{className:"pb-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"font-semibold text-lg truncate",children:e.name}),e.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(l.z,{variant:"ghost",size:"icon",className:`h-8 w-8 transition-all ${Z?"scale-125":""} ${E?"text-yellow-500":""}`,onClick:V,disabled:Z,children:t.jsx(d.Z,{className:`h-4 w-4 transition-all ${Z?"animate-pulse":""} ${E?"fill-yellow-400 text-yellow-400":""}`})}),(0,t.jsxs)(c.h_,{modal:!1,children:[t.jsx(c.$F,{asChild:!0,children:t.jsx(l.z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:t.jsx(o.Z,{className:"h-4 w-4"})})}),(0,t.jsxs)(c.AW,{align:"end",children:[(0,t.jsxs)(c.Xi,{onClick:()=>{navigator.clipboard.writeText(e.content),b.Am.success("Prompt copied to clipboard")},children:[t.jsx(m.Z,{className:"mr-2 h-4 w-4"}),"Copy Content"]}),k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Xi,{onClick:()=>D(!0),children:[t.jsx(x.Z,{className:"mr-2 h-4 w-4"}),"Edit"]}),(0,t.jsxs)(c.Xi,{onClick:U,className:"text-destructive",children:[t.jsx(h.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}),t.jsx(r.aY,{className:"flex-1 pb-3",children:(0,t.jsxs)("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:e.content}),z.length>0&&(0,t.jsxs)(n.C,{variant:"outline",className:"text-xs",children:[z.length," variable",1!==z.length?"s":""]}),I.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[t.jsx(p.Z,{className:"h-3 w-3"}),t.jsx("span",{className:"font-medium",children:"Works with:"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[I.slice(0,2).map((e,s)=>t.jsx(n.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:e},s)),I.length>2&&(0,t.jsxs)(n.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:["+",I.length-2," more"]})]})]})]})}),(0,t.jsxs)(r.eW,{className:"flex flex-col gap-3 pt-3 border-t",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:`flex items-center gap-1 transition-all ${Z?"scale-125":""} ${E?"text-yellow-500":""}`,children:[t.jsx(d.Z,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:e.favorite_count||0})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",title:"Times used",children:[t.jsx(u.Z,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:e.usage_count||0})]})]}),(0,t.jsxs)(l.z,{variant:"secondary",size:"sm",type:"button",onClick:()=>D(!0),children:[t.jsx(j.Z,{className:"mr-2 h-3.5 w-3.5"}),"View"]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 text-xs text-muted-foreground w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(f.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Created by ",R]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(g.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Created ",(0,_.Q)(new Date(e.createdAt),{addSuffix:!0})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(v.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Updated ",(0,_.Q)(new Date(e.updatedAt),{addSuffix:!0})]})]})]})]})]}),t.jsx(y.D,{open:S,onOpenChange:D,prompt:e,onSuccess:a,user:s})]})}},29429:(e,s,a)=>{a.d(s,{D:()=>A});var t=a(10326),i=a(17577),r=a(62288),l=a(90772),n=a(54432),c=a(31048),d=a(87673),o=a(567),m=a(82189),x=a(47206),h=a(32933),p=a(94019),u=a(52227),j=a(3151),f=a(15286),g=a(85999),v=a(24295),N=a(2454),w=a(30811),y=a(39167),b=a(42270),C=a(77863);function A({open:e,onOpenChange:s,prompt:a,onSuccess:A,user:_,defaultAssignedAgents:S=[]}){let D=!!a,[Z,{loading:F}]=(0,u.EE)(),[P,{loading:$}]=(0,u.er)(),[k,z]=(0,i.useState)(""),[E,B]=(0,i.useState)(""),[I,M]=(0,i.useState)(""),[R,U]=(0,i.useState)("private"),[V,q]=(0,i.useState)([]),[O,L]=(0,i.useState)([]),[Q,T]=(0,i.useState)([]),[W,H]=(0,i.useState)(!1),[J,X]=(0,i.useState)([]),[Y,K]=(0,i.useState)(!1),{data:G}=(0,y.aM)(b.ym,{variables:{page:1,limit:100}}),ee=G?.agentsPagination?.items||[],es=(0,j.H)(I),{isValid:ea,invalidVariables:et}=function(e){if(!e)return{isValid:!0,invalidVariables:[]};let s=e.matchAll(/\{\{([^}]+)\}\}/g),a=[];for(let e of Array.from(s)){let s=e[1];s&&/^[a-zA-Z0-9_]+$/.test(s)||a.push(s)}return{isValid:0===a.length,invalidVariables:a}}(I),ei=()=>{z(""),B(""),M(""),U("private"),q([]),L([]),T([]),H(!1),X([])},er=async()=>{if(!k.trim()){g.Am.error("Please enter a name for the prompt");return}if(!I.trim()){g.Am.error("Please enter prompt content");return}if(!ea){g.Am.error(`Invalid variable names: ${et.join(", ")}. Use only letters, numbers, and underscores.`);return}try{let e={name:k.trim(),description:E.trim()||void 0,content:I.trim(),rights_mode:R,RBAC:"private"!==R&&"public"!==R?{users:V.length>0?V:void 0,roles:O.length>0?O:void 0,projects:Q.length>0?Q:void 0}:void 0,assigned_agents:J.length>0?J:void 0};D?(await P({variables:{id:a.id,...e}}),g.Am.success("Prompt updated successfully")):(await Z({variables:e}),g.Am.success("Prompt created successfully")),A(),s(!1),ei()}catch(e){console.error(e),g.Am.error(D?"Failed to update prompt":"Failed to create prompt")}};return t.jsx(r.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(r.cZ,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(r.fK,{children:[t.jsx(r.$N,{children:D?"Edit Prompt":"Create New Prompt"}),t.jsx(r.Be,{children:D?"Update your prompt template":"Create a reusable prompt template with variables"})]}),(0,t.jsxs)("div",{className:"space-y-6 py-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(c._,{htmlFor:"name",children:["Name ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(n.I,{id:"name",placeholder:"Customer Support Template",value:k,onChange:e=>z(e.target.value)})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(c._,{htmlFor:"description",children:"Description"}),t.jsx(n.I,{id:"description",placeholder:"Brief description of this prompt",value:E,onChange:e=>B(e.target.value)})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(c._,{htmlFor:"content",children:["Prompt Content ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(d.g,{id:"content",placeholder:"You are helping {{customer_name}} with their {{issue}}...",value:I,onChange:e=>M(e.target.value),rows:8,className:"font-mono text-sm"}),(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[t.jsx(m.Z,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),(0,t.jsxs)("span",{children:["Use"," ",(0,t.jsxs)("code",{className:"bg-muted px-1 py-0.5 rounded",children:["{","{","variable_name","}}"]})," ","format for dynamic content. Variable names can only contain letters, numbers, and underscores."]})]}),es.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 pt-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground mr-2",children:"Detected variables:"}),es.map(e=>t.jsx(o.C,{variant:"outline",className:"text-xs",children:e},e))]}),!ea&&(0,t.jsxs)("div",{className:"text-xs text-destructive",children:["Invalid variable names: ",et.join(", ")]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(c._,{children:"Assign to Agents"}),(0,t.jsxs)(w.J2,{modal:!0,open:Y,onOpenChange:K,children:[t.jsx(w.xo,{asChild:!0,children:(0,t.jsxs)(l.z,{variant:"outline",role:"combobox","aria-expanded":Y,className:"w-full justify-between",children:[0===J.length?"Select agents...":`${J.length} agent${1!==J.length?"s":""} selected`,t.jsx(x.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(w.yk,{className:"w-full p-0",children:(0,t.jsxs)(N.mY,{children:[t.jsx(N.sZ,{placeholder:"Search agents..."}),(0,t.jsxs)(N.e8,{children:[t.jsx(N.rb,{children:"No agents found."}),t.jsx(N.fu,{children:ee.map(e=>(0,t.jsxs)(N.di,{value:e.id,onSelect:()=>{X(s=>s.includes(e.id)?s.filter(s=>s!==e.id):[...s,e.id])},children:[t.jsx(h.Z,{className:(0,C.cn)("mr-2 h-4 w-4",J.includes(e.id)?"opacity-100":"opacity-0")}),e.name]},e.id))})]})]})})]}),J.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:J.map(e=>{let s=ee.find(s=>s.id===e);return s?(0,t.jsxs)(o.C,{variant:"secondary",className:"text-sm",children:[s.name,t.jsx("button",{type:"button",onClick:()=>X(s=>s.filter(s=>s!==e)),className:"ml-1.5 hover:text-destructive",children:t.jsx(p.Z,{className:"h-3 w-3"})})]},e):null})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Assign this prompt to specific agents to show it as recommended in chat"})]}),t.jsx(v.zF,{open:W,onOpenChange:H,children:(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(v.wy,{asChild:!0,children:(0,t.jsxs)(l.z,{variant:"outline",className:"w-full justify-between",children:["Access Control",(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["private"===R&&"Private","public"===R&&"Public","users"===R&&`${V.length} users`,"roles"===R&&`${O.length} roles`,"projects"===R&&`${Q.length} projects`]})]})}),t.jsx(v.Fw,{className:"pt-2",children:t.jsx(f.P,{initialRightsMode:R,initialUsers:V,initialRoles:O,modalMode:!0,initialProjects:Q,onChange:(e,s,a,t)=>{U(e),q(s),L(a),T(t)}})})]})})]}),(0,t.jsxs)(r.cN,{children:[t.jsx(l.z,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),t.jsx(l.z,{onClick:er,disabled:F||$||!k.trim()||!I.trim()||!ea,children:F||$?"Saving...":D?"Save Changes":"Create Prompt"})]})]})})}},24295:(e,s,a)=>{a.d(s,{Fw:()=>l,wy:()=>r,zF:()=>i});var t=a(35663);let i=t.fC,r=t.wy,l=t.Fw},52227:(e,s,a)=>{a.d(s,{EE:()=>n,Lq:()=>h,Sh:()=>l,VR:()=>o,er:()=>c,iJ:()=>d});var t=a(39167),i=a(18753),r=a(42270);let l=e=>(0,t.aM)(r.xx,{variables:{page:e?.page??1,limit:e?.limit??20,filters:e?.filters??[],sort:e?.sort??{field:"updatedAt",direction:"DESC"}}}),n=()=>(0,i.D)(r.Iv,{refetchQueries:[{query:r.xx,variables:{page:1,limit:20}}]}),c=()=>(0,i.D)(r.jA),d=()=>(0,i.D)(r.Ll,{refetchQueries:[{query:r.xx,variables:{page:1,limit:20}}]}),o=()=>(0,i.D)(r.re),m=()=>(0,i.D)(r.Nl),x=()=>(0,i.D)(r.m8),h=()=>{let[e]=m(),[s]=x(),[a]=(0,i.D)(r.UK);return{toggleFavorite:async(t,i,r,l,n)=>{r&&n?(await s({variables:{id:n}}),await a({variables:{id:t,favorite_count:Math.max(0,l-1)}})):(await e({variables:{user_id:i,prompt_id:t}}),await a({variables:{id:t,favorite_count:l+1}}))}}}},3151:(e,s,a)=>{a.d(s,{H:()=>t});function t(e){if(!e)return[];let s=e.matchAll(/\{\{([a-zA-Z0-9_]+)\}\}/g),a=new Set;for(let e of Array.from(s))a.add(e[1]);return Array.from(a).sort()}}};
1
+ "use strict";exports.id=6590,exports.ids=[6590],exports.modules={86590:(e,s,a)=>{a.d(s,{$:()=>S});var t=a(10326),i=a(17577),r=a(33071),l=a(90772),n=a(567),c=a(60097),d=a(59593),o=a(231),m=a(43810),x=a(69508),h=a(98091),p=a(50732),u=a(66697),j=a(40617),f=a(79635),g=a(37358),v=a(48998),N=a(3151),w=a(52227),y=a(29429),b=a(85999),C=a(39167),A=a(42270),_=a(32663);function S({prompt:e,user:s,onUpdate:a}){let[S,D]=(0,i.useState)(!1),[Z,k]=(0,i.useState)(!1),[P]=(0,w.iJ)(),{toggleFavorite:$}=(0,w.Lq)(),z=function(e,s){let a="private"===e.rights_mode,t="public"===e.rights_mode,i="users"===e.rights_mode,r="roles"===e.rights_mode,l=s.super_admin,n=e.created_by===s.id.toString(),c=!1;if(n&&(c=!0),!a||n||l||(c=!1),t&&(c=!0),i){let a=e.RBAC?.users?.find(e=>e.id===s.id);c=a?.rights==="write"}if(r){let a=e.RBAC?.roles?.find(e=>e.id===s.role?.id);c=a?.rights==="write"}return l&&(c=!0),c}(e,s),F=(0,N.H)(e.content),E=e.is_favorited||!1,{data:B}=(0,C.aM)(A.W9,{variables:{ids:e.assigned_agents||[]},skip:!e.assigned_agents||0===e.assigned_agents.length}),I=B?.agentByIds?.map(e=>e.name)||[],{data:M}=(0,C.aM)(A.L5,{variables:{id:e.created_by},skip:!e.created_by}),R=M?.userById?.name||"Unknown",U=async()=>{if(confirm("Are you sure you want to delete this prompt?"))try{await P({variables:{id:e.id}}),b.Am.success("Prompt deleted successfully"),a()}catch(e){b.Am.error("Failed to delete prompt"),console.error(e)}},V=async()=>{if(!Z){k(!0);try{await $(e.id,s.id,E,e.favorite_count,void 0),b.Am.success(E?"Removed from favorites":"Added to favorites",{icon:E?"\uD83D\uDC4E":"\uD83D\uDC4D",duration:2e3}),a()}catch(e){b.Am.error("Failed to update favorite"),console.error(e)}finally{await new Promise(e=>setTimeout(e,200)),k(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.Zb,{className:"flex flex-col hover:shadow-md transition-shadow",children:[t.jsx(r.Ol,{className:"pb-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"font-semibold text-lg truncate",children:e.name}),e.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(l.z,{variant:"ghost",size:"icon",className:`h-8 w-8 transition-all ${Z?"scale-125":""} ${E?"text-yellow-500":""}`,onClick:V,disabled:Z,children:t.jsx(d.Z,{className:`h-4 w-4 transition-all ${Z?"animate-pulse":""} ${E?"fill-yellow-400 text-yellow-400":""}`})}),(0,t.jsxs)(c.h_,{modal:!1,children:[t.jsx(c.$F,{asChild:!0,children:t.jsx(l.z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:t.jsx(o.Z,{className:"h-4 w-4"})})}),(0,t.jsxs)(c.AW,{align:"end",children:[(0,t.jsxs)(c.Xi,{onClick:()=>{navigator.clipboard.writeText(e.content),b.Am.success("Prompt copied to clipboard")},children:[t.jsx(m.Z,{className:"mr-2 h-4 w-4"}),"Copy Content"]}),z&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Xi,{onClick:()=>D(!0),children:[t.jsx(x.Z,{className:"mr-2 h-4 w-4"}),"Edit"]}),(0,t.jsxs)(c.Xi,{onClick:U,className:"text-destructive",children:[t.jsx(h.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}),t.jsx(r.aY,{className:"flex-1 pb-3",children:(0,t.jsxs)("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:e.content}),F.length>0&&(0,t.jsxs)(n.C,{variant:"outline",className:"text-xs",children:[F.length," variable",1!==F.length?"s":""]}),I.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[t.jsx(p.Z,{className:"h-3 w-3"}),t.jsx("span",{className:"font-medium",children:"Works with:"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[I.slice(0,2).map((e,s)=>t.jsx(n.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:e},s)),I.length>2&&(0,t.jsxs)(n.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:["+",I.length-2," more"]})]})]})]})}),(0,t.jsxs)(r.eW,{className:"flex flex-col gap-3 pt-3 border-t",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:`flex items-center gap-1 transition-all ${Z?"scale-125":""} ${E?"text-yellow-500":""}`,children:[t.jsx(d.Z,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:e.favorite_count||0})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",title:"Times used",children:[t.jsx(u.Z,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:e.usage_count||0})]})]}),(0,t.jsxs)(l.z,{variant:"secondary",size:"sm",type:"button",onClick:()=>D(!0),children:[t.jsx(j.Z,{className:"mr-2 h-3.5 w-3.5"}),"View"]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 text-xs text-muted-foreground w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(f.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Created by ",R]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(g.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Created ",(0,_.Q)(new Date(e.createdAt),{addSuffix:!0})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[t.jsx(v.Z,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:["Updated ",(0,_.Q)(new Date(e.updatedAt),{addSuffix:!0})]})]})]})]})]}),t.jsx(y.D,{open:S,onOpenChange:D,prompt:e,onSuccess:a,user:s})]})}},29429:(e,s,a)=>{a.d(s,{D:()=>A});var t=a(10326),i=a(17577),r=a(62288),l=a(90772),n=a(54432),c=a(31048),d=a(87673),o=a(567),m=a(82189),x=a(47206),h=a(32933),p=a(94019),u=a(52227),j=a(3151),f=a(15286),g=a(85999),v=a(24295),N=a(2454),w=a(30811),y=a(39167),b=a(42270),C=a(77863);function A({open:e,onOpenChange:s,prompt:a,onSuccess:A,user:_,defaultAssignedAgents:S=[]}){let D=!!a,[Z,{loading:k}]=(0,u.EE)(),[P,{loading:$}]=(0,u.er)(),[z,F]=(0,i.useState)(""),[E,B]=(0,i.useState)(""),[I,M]=(0,i.useState)(""),[R,U]=(0,i.useState)("private"),[V,q]=(0,i.useState)([]),[O,L]=(0,i.useState)([]),[Q,T]=(0,i.useState)(!1),[W,H]=(0,i.useState)([]),[J,X]=(0,i.useState)(!1),{data:Y}=(0,y.aM)(b.ym,{variables:{page:1,limit:100}}),K=Y?.agentsPagination?.items||[],G=(0,j.H)(I),{isValid:ee,invalidVariables:es}=function(e){if(!e)return{isValid:!0,invalidVariables:[]};let s=e.matchAll(/\{\{([^}]+)\}\}/g),a=[];for(let e of Array.from(s)){let s=e[1];s&&/^[a-zA-Z0-9_]+$/.test(s)||a.push(s)}return{isValid:0===a.length,invalidVariables:a}}(I),ea=()=>{F(""),B(""),M(""),U("private"),q([]),L([]),T(!1),H([])},et=async()=>{if(!z.trim()){g.Am.error("Please enter a name for the prompt");return}if(!I.trim()){g.Am.error("Please enter prompt content");return}if(!ee){g.Am.error(`Invalid variable names: ${es.join(", ")}. Use only letters, numbers, and underscores.`);return}try{let e={name:z.trim(),description:E.trim()||void 0,content:I.trim(),rights_mode:R,RBAC:"private"!==R&&"public"!==R?{users:V.length>0?V:void 0,roles:O.length>0?O:void 0}:void 0,assigned_agents:W.length>0?W:void 0};D?(await P({variables:{id:a.id,...e}}),g.Am.success("Prompt updated successfully")):(await Z({variables:e}),g.Am.success("Prompt created successfully")),A(),s(!1),ea()}catch(e){console.error(e),g.Am.error(D?"Failed to update prompt":"Failed to create prompt")}};return t.jsx(r.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(r.cZ,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(r.fK,{children:[t.jsx(r.$N,{children:D?"Edit Prompt":"Create New Prompt"}),t.jsx(r.Be,{children:D?"Update your prompt template":"Create a reusable prompt template with variables"})]}),(0,t.jsxs)("div",{className:"space-y-6 py-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(c._,{htmlFor:"name",children:["Name ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(n.I,{id:"name",placeholder:"Customer Support Template",value:z,onChange:e=>F(e.target.value)})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(c._,{htmlFor:"description",children:"Description"}),t.jsx(n.I,{id:"description",placeholder:"Brief description of this prompt",value:E,onChange:e=>B(e.target.value)})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(c._,{htmlFor:"content",children:["Prompt Content ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(d.g,{id:"content",placeholder:"You are helping {{customer_name}} with their {{issue}}...",value:I,onChange:e=>M(e.target.value),rows:8,className:"font-mono text-sm"}),(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[t.jsx(m.Z,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),(0,t.jsxs)("span",{children:["Use"," ",(0,t.jsxs)("code",{className:"bg-muted px-1 py-0.5 rounded",children:["{","{","variable_name","}}"]})," ","format for dynamic content. Variable names can only contain letters, numbers, and underscores."]})]}),G.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 pt-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground mr-2",children:"Detected variables:"}),G.map(e=>t.jsx(o.C,{variant:"outline",className:"text-xs",children:e},e))]}),!ee&&(0,t.jsxs)("div",{className:"text-xs text-destructive",children:["Invalid variable names: ",es.join(", ")]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(c._,{children:"Assign to Agents"}),(0,t.jsxs)(w.J2,{modal:!0,open:J,onOpenChange:X,children:[t.jsx(w.xo,{asChild:!0,children:(0,t.jsxs)(l.z,{variant:"outline",role:"combobox","aria-expanded":J,className:"w-full justify-between",children:[0===W.length?"Select agents...":`${W.length} agent${1!==W.length?"s":""} selected`,t.jsx(x.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(w.yk,{className:"w-full p-0",children:(0,t.jsxs)(N.mY,{children:[t.jsx(N.sZ,{placeholder:"Search agents..."}),(0,t.jsxs)(N.e8,{children:[t.jsx(N.rb,{children:"No agents found."}),t.jsx(N.fu,{children:K.map(e=>(0,t.jsxs)(N.di,{value:e.id,onSelect:()=>{H(s=>s.includes(e.id)?s.filter(s=>s!==e.id):[...s,e.id])},children:[t.jsx(h.Z,{className:(0,C.cn)("mr-2 h-4 w-4",W.includes(e.id)?"opacity-100":"opacity-0")}),e.name]},e.id))})]})]})})]}),W.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:W.map(e=>{let s=K.find(s=>s.id===e);return s?(0,t.jsxs)(o.C,{variant:"secondary",className:"text-sm",children:[s.name,t.jsx("button",{type:"button",onClick:()=>H(s=>s.filter(s=>s!==e)),className:"ml-1.5 hover:text-destructive",children:t.jsx(p.Z,{className:"h-3 w-3"})})]},e):null})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Assign this prompt to specific agents to show it as recommended in chat"})]}),t.jsx(v.zF,{open:Q,onOpenChange:T,children:(0,t.jsxs)("div",{className:"space-y-2",children:[t.jsx(v.wy,{asChild:!0,children:(0,t.jsxs)(l.z,{variant:"outline",className:"w-full justify-between",children:["Access Control",(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["private"===R&&"Private","public"===R&&"Public","users"===R&&`${V.length} users`,"roles"===R&&`${O.length} roles`]})]})}),t.jsx(v.Fw,{className:"pt-2",children:t.jsx(f.P,{initialRightsMode:R,initialUsers:V,initialRoles:O,modalMode:!0,onChange:(e,s,a)=>{U(e),q(s),L(a)}})})]})})]}),(0,t.jsxs)(r.cN,{children:[t.jsx(l.z,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),t.jsx(l.z,{onClick:et,disabled:k||$||!z.trim()||!I.trim()||!ee,children:k||$?"Saving...":D?"Save Changes":"Create Prompt"})]})]})})}},52227:(e,s,a)=>{a.d(s,{EE:()=>n,Lq:()=>h,Sh:()=>l,VR:()=>o,er:()=>c,iJ:()=>d});var t=a(39167),i=a(18753),r=a(42270);let l=e=>(0,t.aM)(r.xx,{variables:{page:e?.page??1,limit:e?.limit??20,filters:e?.filters??[],sort:e?.sort??{field:"updatedAt",direction:"DESC"}}}),n=()=>(0,i.D)(r.Iv,{refetchQueries:[{query:r.xx,variables:{page:1,limit:20}}]}),c=()=>(0,i.D)(r.jA),d=()=>(0,i.D)(r.Ll,{refetchQueries:[{query:r.xx,variables:{page:1,limit:20}}]}),o=()=>(0,i.D)(r.re),m=()=>(0,i.D)(r.Nl),x=()=>(0,i.D)(r.m8),h=()=>{let[e]=m(),[s]=x(),[a]=(0,i.D)(r.UK);return{toggleFavorite:async(t,i,r,l,n)=>{r&&n?(await s({variables:{id:n}}),await a({variables:{id:t,favorite_count:Math.max(0,l-1)}})):(await e({variables:{user_id:i,prompt_id:t}}),await a({variables:{id:t,favorite_count:l+1}}))}}}},3151:(e,s,a)=>{a.d(s,{H:()=>t});function t(e){if(!e)return[];let s=e.matchAll(/\{\{([a-zA-Z0-9_]+)\}\}/g),a=new Set;for(let e of Array.from(s))a.add(e[1]);return Array.from(a).sort()}}};