@next-bricks/ai-portal 0.51.0 → 0.53.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.
- package/dist/bricks.json +37 -29
- package/dist/chunks/1889.0cd5c088.js +2 -0
- package/dist/chunks/1889.0cd5c088.js.map +1 -0
- package/dist/chunks/2084.0e9751e7.js +3 -0
- package/dist/chunks/2084.0e9751e7.js.map +1 -0
- package/dist/chunks/{2142.c02a98d9.js → 2142.0599aecd.js} +2 -2
- package/dist/chunks/{2142.c02a98d9.js.map → 2142.0599aecd.js.map} +1 -1
- package/dist/chunks/2893.c26f0be9.js +2 -0
- package/dist/chunks/2893.c26f0be9.js.map +1 -0
- package/dist/chunks/3020.acf9607e.js +2 -0
- package/dist/chunks/3020.acf9607e.js.map +1 -0
- package/dist/chunks/{3171.a4a34e43.js → 3171.a0251432.js} +2 -2
- package/dist/chunks/{3171.a4a34e43.js.map → 3171.a0251432.js.map} +1 -1
- package/dist/chunks/{7146.6cc7fa79.js → 4765.e2813cac.js} +2 -2
- package/dist/chunks/{4765.f5f33140.js.map → 4765.e2813cac.js.map} +1 -1
- package/dist/chunks/{4837.488c5888.js → 4837.c7f9a784.js} +2 -2
- package/dist/chunks/{9599.f127b5a1.js.map → 4837.c7f9a784.js.map} +1 -1
- package/dist/chunks/{5552.39ed2457.js → 5552.84bdc597.js} +2 -2
- package/dist/chunks/{5552.39ed2457.js.map → 5552.84bdc597.js.map} +1 -1
- package/dist/chunks/{6201.993201cb.js → 6201.58eeb93e.js} +2 -2
- package/dist/chunks/{6201.993201cb.js.map → 6201.58eeb93e.js.map} +1 -1
- package/dist/chunks/{6593.f25cfd6b.js → 6593.1afe9a04.js} +2 -2
- package/dist/chunks/{6593.f25cfd6b.js.map → 6593.1afe9a04.js.map} +1 -1
- package/dist/chunks/{4317.d0f5904b.js → 6947.1cec7258.js} +3 -3
- package/dist/chunks/6947.1cec7258.js.map +1 -0
- package/dist/chunks/{4765.f5f33140.js → 7146.1af0c62e.js} +2 -2
- package/dist/chunks/{7146.6cc7fa79.js.map → 7146.1af0c62e.js.map} +1 -1
- package/dist/chunks/{8717.fc81dec5.js → 8717.1e5ad2b1.js} +2 -2
- package/dist/chunks/{8717.fc81dec5.js.map → 8717.1e5ad2b1.js.map} +1 -1
- package/dist/chunks/948.d125d58c.js +3 -0
- package/dist/chunks/948.d125d58c.js.map +1 -0
- package/dist/chunks/{9599.f127b5a1.js → 9599.1f04dd1f.js} +2 -2
- package/dist/chunks/{4837.488c5888.js.map → 9599.1f04dd1f.js.map} +1 -1
- package/dist/chunks/{action-buttons.44ddca46.js → action-buttons.989fd1c9.js} +2 -2
- package/dist/chunks/{action-buttons.44ddca46.js.map → action-buttons.989fd1c9.js.map} +1 -1
- package/dist/chunks/activity-timeline.60adaa84.js +2 -0
- package/dist/chunks/activity-timeline.60adaa84.js.map +1 -0
- package/dist/chunks/{ai-agents.d47947e5.js → ai-agents.92ed0274.js} +3 -3
- package/dist/chunks/{ai-agents.d47947e5.js.map → ai-agents.92ed0274.js.map} +1 -1
- package/dist/chunks/{ai-employees.6d586b8d.js → ai-employees.12986d4b.js} +3 -3
- package/dist/chunks/{ai-employees.6d586b8d.js.map → ai-employees.12986d4b.js.map} +1 -1
- package/dist/chunks/blank-state.ad3eee7a.js +2 -0
- package/dist/chunks/blank-state.ad3eee7a.js.map +1 -0
- package/dist/chunks/{call-tool.28aa1c47.js → call-tool.89a848e0.js} +2 -2
- package/dist/chunks/{call-tool.28aa1c47.js.map → call-tool.89a848e0.js.map} +1 -1
- package/dist/chunks/chat-box.59ab1b62.js +2 -0
- package/dist/chunks/chat-box.59ab1b62.js.map +1 -0
- package/dist/chunks/chat-input.b09e4ba0.js +3 -0
- package/dist/chunks/chat-input.b09e4ba0.js.map +1 -0
- package/dist/chunks/{chat-stream.052c4869.js → chat-stream.11c6ade7.js} +2 -2
- package/dist/chunks/{chat-stream.052c4869.js.map → chat-stream.11c6ade7.js.map} +1 -1
- package/dist/chunks/{cruise-canvas.3600fc3c.js → cruise-canvas.60fa24a3.js} +2 -2
- package/dist/chunks/{cruise-canvas.3600fc3c.js.map → cruise-canvas.60fa24a3.js.map} +1 -1
- package/dist/chunks/{dropdown-select.11c89c58.js → dropdown-select.1140bf2b.js} +2 -2
- package/dist/chunks/{dropdown-select.11c89c58.js.map → dropdown-select.1140bf2b.js.map} +1 -1
- package/dist/chunks/{elevo-sidebar.402d464e.js → elevo-sidebar.bfad7500.js} +3 -3
- package/dist/chunks/{elevo-sidebar.402d464e.js.map → elevo-sidebar.bfad7500.js.map} +1 -1
- package/dist/chunks/flow-tabs.222a11ea.js +3 -0
- package/dist/chunks/flow-tabs.222a11ea.js.map +1 -0
- package/dist/chunks/{goal-card-list.11057103.js → goal-card-list.44c21cf2.js} +3 -3
- package/dist/chunks/{goal-card-list.11057103.js.map → goal-card-list.44c21cf2.js.map} +1 -1
- package/dist/chunks/{load-request-store.843b9a8c.js → load-request-store.b4cf045b.js} +2 -2
- package/dist/chunks/{load-request-store.843b9a8c.js.map → load-request-store.b4cf045b.js.map} +1 -1
- package/dist/chunks/main.2188a2bf.js +2 -0
- package/dist/chunks/{main.5dcdeb69.js.map → main.2188a2bf.js.map} +1 -1
- package/dist/chunks/{mcp-tools.16acda69.js → mcp-tools.0acb474a.js} +2 -2
- package/dist/chunks/{mcp-tools.16acda69.js.map → mcp-tools.0acb474a.js.map} +1 -1
- package/dist/chunks/{page-container.e59d6a94.js → page-container.97947b50.js} +2 -2
- package/dist/chunks/page-container.97947b50.js.map +1 -0
- package/dist/chunks/{preview-container.6b29ee97.js → preview-container.19631a7b.js} +2 -2
- package/dist/chunks/{preview-container.6b29ee97.js.map → preview-container.19631a7b.js.map} +1 -1
- package/dist/chunks/{project-conversations.9bd710bf.js → project-conversations.3f559e57.js} +3 -3
- package/dist/chunks/{project-conversations.9bd710bf.js.map → project-conversations.3f559e57.js.map} +1 -1
- package/dist/chunks/{project-knowledges.14b07366.js → project-knowledges.24611263.js} +3 -3
- package/dist/chunks/project-knowledges.24611263.js.LICENSE.txt +5 -0
- package/dist/chunks/{project-knowledges.14b07366.js.map → project-knowledges.24611263.js.map} +1 -1
- package/dist/chunks/{show-case.be5d82fd.js → show-case.7bc5fc9e.js} +2 -2
- package/dist/chunks/{show-case.be5d82fd.js.map → show-case.7bc5fc9e.js.map} +1 -1
- package/dist/chunks/{show-cases.e3d47e29.js → show-cases.85fe99d4.js} +2 -2
- package/dist/chunks/{show-cases.e3d47e29.js.map → show-cases.85fe99d4.js.map} +1 -1
- package/dist/chunks/stage-flow.7cfa123d.js +2 -0
- package/dist/chunks/stage-flow.7cfa123d.js.map +1 -0
- package/dist/examples.json +21 -15
- package/dist/images/60cd488d.svg +6 -0
- package/dist/images/c19e3f37.png +0 -0
- package/dist/images/ecaecc18.svg +6 -0
- package/dist/index.7d776211.js +2 -0
- package/dist/index.7d776211.js.map +1 -0
- package/dist/manifest.json +338 -228
- package/dist/types.json +895 -461
- package/dist-types/blank-state/index.d.ts +1 -1
- package/dist-types/bootstrap.d.ts +2 -0
- package/dist-types/flow-tabs/drawBg.d.ts +1 -0
- package/dist-types/flow-tabs/index.d.ts +20 -0
- package/dist-types/flow-tabs/index.spec.d.ts +1 -0
- package/dist-types/page-container/index.d.ts +2 -2
- package/dist-types/stage-flow/i18n.d.ts +21 -0
- package/dist-types/stage-flow/index.d.ts +39 -0
- package/dist-types/stage-flow/index.spec.d.ts +1 -0
- package/docs/flow-tabs.md +21 -0
- package/docs/stage-flow.md +32 -0
- package/package.json +2 -2
- package/dist/chunks/1889.b7766f77.js +0 -2
- package/dist/chunks/1889.b7766f77.js.map +0 -1
- package/dist/chunks/2084.37e19e93.js +0 -3
- package/dist/chunks/2084.37e19e93.js.map +0 -1
- package/dist/chunks/3506.da6e43af.js +0 -2
- package/dist/chunks/3506.da6e43af.js.map +0 -1
- package/dist/chunks/4317.d0f5904b.js.map +0 -1
- package/dist/chunks/6206.874a68ab.js +0 -2
- package/dist/chunks/6206.874a68ab.js.map +0 -1
- package/dist/chunks/948.85b663ec.js +0 -3
- package/dist/chunks/948.85b663ec.js.map +0 -1
- package/dist/chunks/activity-timeline.60e516fd.js +0 -2
- package/dist/chunks/activity-timeline.60e516fd.js.map +0 -1
- package/dist/chunks/blank-state.2b55f2c6.js +0 -2
- package/dist/chunks/blank-state.2b55f2c6.js.map +0 -1
- package/dist/chunks/chat-box.6156ad59.js +0 -2
- package/dist/chunks/chat-box.6156ad59.js.map +0 -1
- package/dist/chunks/chat-input.720e6130.js +0 -3
- package/dist/chunks/chat-input.720e6130.js.map +0 -1
- package/dist/chunks/main.5dcdeb69.js +0 -2
- package/dist/chunks/page-container.e59d6a94.js.map +0 -1
- package/dist/index.28d7dd85.js +0 -2
- package/dist/index.28d7dd85.js.map +0 -1
- /package/dist/chunks/{2084.37e19e93.js.LICENSE.txt → 2084.0e9751e7.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{4317.d0f5904b.js.LICENSE.txt → 6947.1cec7258.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{948.85b663ec.js.LICENSE.txt → 948.d125d58c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{ai-agents.d47947e5.js.LICENSE.txt → ai-agents.92ed0274.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{ai-employees.6d586b8d.js.LICENSE.txt → ai-employees.12986d4b.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-input.720e6130.js.LICENSE.txt → chat-input.b09e4ba0.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{elevo-sidebar.402d464e.js.LICENSE.txt → elevo-sidebar.bfad7500.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{goal-card-list.11057103.js.LICENSE.txt → flow-tabs.222a11ea.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{project-conversations.9bd710bf.js.LICENSE.txt → goal-card-list.44c21cf2.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{project-knowledges.14b07366.js.LICENSE.txt → project-conversations.3f559e57.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[4765,7146],{97146:(e,t,r)=>{function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,s){if("string"==typeof t?n.name===t:t.includes(n.name)){const t=[];for(let i=1;i<=r;i++){const r=s[s.length-i];if("MemberExpression"===(null==r?void 0:r.node.type)&&"object"===r.key){const s=r.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(o?`${n.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(o?`${n.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===r&&e.usedProperties.add(t.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){const e=n[n.length-1],o=n[n.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=o.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?r.usedArgs.add(t.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>b,createProviderClass:()=>c.createProviderClass,replaceUseChildren:()=>x,scanPermissionActionsInAny:()=>A,scanPermissionActionsInStoryboard:()=>m,strictCollectMemberUsage:()=>u,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=n("APP","getMenu"),i=n("INSTALLED_APPS","has");var a=r(71321),c=r(
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[4765,7146],{97146:(e,t,r)=>{function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,s){if("string"==typeof t?n.name===t:t.includes(n.name)){const t=[];for(let i=1;i<=r;i++){const r=s[s.length-i];if("MemberExpression"===(null==r?void 0:r.node.type)&&"object"===r.key){const s=r.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(o?`${n.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(o?`${n.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===r&&e.usedProperties.add(t.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){const e=n[n.length-1],o=n[n.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=o.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?r.usedArgs.add(t.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>b,createProviderClass:()=>c.createProviderClass,replaceUseChildren:()=>x,scanPermissionActionsInAny:()=>A,scanPermissionActionsInStoryboard:()=>m,strictCollectMemberUsage:()=>u,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=n("APP","getMenu"),i=n("INSTALLED_APPS","has");var a=r(71321),c=r(77019);function l(e,t,r){const o=new WeakSet,{matchExpressionString:n,visitNotMatchedExpressionString:s,visitNonExpressionString:i,visitObject:l}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,a.isEvaluable)(r))if(n(r))try{(0,a.preevaluate)(r,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,o){t(e,o,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==s||s(r);else null==i||i(r);else if((0,c.isObject)(r)){if(o.has(r))return;o.add(r),null==l||l(r);for(const t of Array.isArray(r)?r:Object.values(r))e(t)}}(e)}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{hasNonStaticUsage:o,nonStaticUsage:n,usedProperties:s}=p(e,t,r);if(o)throw new Error(`Non-static usage of ${t} is prohibited, check your expression: "${n}"`);return s}function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n={usedProperties:new Set,hasNonStaticUsage:!1},s=o(n,t,r);return l(e,((e,t,r)=>{s(e,t),n.hasNonStaticUsage&&(n.nonStaticUsage=r)}),t),n}const d=["CTX","STATE","FORM_STATE"];function f(e,t,r){if(e.includes(t)){const n={usedProperties:new Set,hasNonStaticUsage:!1},{expression:s}=(0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(n,r)}});let i;if("SequenceExpression"===s.type&&(i=s.expressions[0])&&"Literal"===i.type&&i.value===t){if(n.usedProperties.size>0)return n.usedProperties;console.warn(`You are using "${t}" but no \`${r}\` usage found in your expression: ${JSON.stringify(e)}`)}}return!1}function y(e){if(d.some((t=>e.includes(t)))){const t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(t,d,1,!0)}}),t.usedProperties.size>0){const e=[...t.usedProperties],r={context:!1,state:!1,formState:!1},o={CTX:"context",STATE:"state",FORM_STATE:"formState"};return e.forEach((e=>{const[t,n]=e.split(".");r[o[t]]||(r[o[t]]=[]),r[o[t]].push(n)})),r}console.warn(`You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: ${JSON.stringify(e)}`)}return!1}function h(e,t,r){if(Array.isArray(e))for(const o of e)null!=r&&r.matchSource&&!r.matchSource(o.source)||g(o,t)}function g(e,t,r){try{(0,a.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t},cacheKey:e})}catch(t){r||console.error(`Parse storyboard function "${e.name}" failed:`,t)}}function b(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const s={usedProperties:new Set,hasNonStaticUsage:!1};if(e.source.includes(t)&&g(e,o(s,t,n),r),s.hasNonStaticUsage&&!r)throw new Error(`Non-static usage of ${t} is prohibited, check your function: "${e.name}"`);return s.usedProperties.delete(e.name),s.usedProperties}const S="PERMISSIONS",v="check";function m(e){var t;const r=new Set,o=P(r),{customTemplates:n,functions:s}=null!==(t=e.meta)&&void 0!==t?t:{};return l([e.routes,n],o,S),h(s,o,{matchSource:e=>e.includes(S)}),Array.from(r)}function A(e){const t=new Set;return l(e,P(t),S),Array.from(t)}function P(e){return function(t,r){if(t.name===S){const t=r[r.length-1],o=r[r.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==t?void 0:t.node.type)&&"object"===t.key&&(t.node.computed?"Literal"===t.node.property.type&&t.node.property.value===v:"Identifier"===t.node.property.type&&t.node.property.name===v))for(const t of o.node.arguments)"Literal"===t.type&&"string"==typeof t.value&&e.add(t.value)}}}var k=r(41030);const{pull:w}=k,E=/^\[\w+\]$/;function x(e){if(Array.isArray(e))for(const t of e)T(t);else T(e)}function T(e){let t=e.slots;const r=new Map;if(Array.isArray(e.children)&&!t){const t=[];for(const n of e.children){var o;const e=null!==(o=n.slot)&&void 0!==o?o:"";if(E.test(e)){delete n.slot;const o=r.get(e);o?o.push(n):r.set(e,[n]),t.push(n)}T(n)}w(e.children,...t)}else{null!=t||(t={});for(const[e,o]of Object.entries(t)){if(E.test(e)){const{bricks:n}=o;Array.isArray(n)&&n.length>0&&(r.set(e,n),x(n)),delete t[e]}Array.isArray(o.bricks)&&x(o.bricks)}}r.size>0&&N(e.properties,r)}function N(e,t){if(Array.isArray(e))for(const r of e)N(r,t);else if((0,c.isObject)(e))for(const[r,o]of Object.entries(e))if("useChildren"===r){const n=t.get(o);n&&(delete e[r],e.useBrick=1===n.length?n[0]:n)}else N(o,t)}}}]);
|
|
2
|
+
//# sourceMappingURL=7146.1af0c62e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/7146.6cc7fa79.js","mappings":"kJAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EAA0BM,EAAKE,OAASR,EAAaA,EAAWS,SAASH,EAAKE,MAAO,CAC9F,MAAME,EAAW,GACjB,IAAK,IAAIC,EAAI,EAAGA,GAAKV,EAAOU,IAAK,CAC/B,MAAMC,EAAeL,EAAOA,EAAOJ,OAASQ,GAC5C,GAA6F,sBAAxFC,aAAmD,EAASA,EAAaN,KAAKO,OAAqD,WAArBD,EAAaE,IAAkB,CAChJ,MAAMC,EAAaH,EAAaN,KAC3BS,EAAWC,UAAyC,eAA7BD,EAAWE,SAASJ,KAErCE,EAAWC,UAAyC,YAA7BD,EAAWE,SAASJ,MAA2D,iBAA9BE,EAAWE,SAASC,MACrGR,EAASS,KAAKd,EAAqB,GAAGC,EAAKE,QAAQO,EAAWE,SAASC,QAAUH,EAAWE,SAASC,OAErGnB,EAAMqB,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AMJ,EAAWF,EAAeQ,IAAIF,GAChCJ,EACFA,EAASxG,KAAK0G,GAEdJ,EAAeS,IAAIH,EAAM,CAACF,IAE5BD,EAAazG,KAAK0G,EACpB,CACAN,EAAeM,EACjB,CACAX,EAAKI,EAAMK,YAAaC,EAC1B,KAAO,CACLJ,UAA6CA,EAAQ,CAAC,GACtD,IAAK,MAAOO,EAAMI,KAAa3E,OAAO4E,QAAQZ,GAAQ,CACpD,GAAIL,EAAyBa,KAAKD,GAAO,CACvC,MACEM,OAAQV,GACNQ,EACA7E,MAAMC,QAAQoE,IAAaA,EAASxH,OAAS,IAC/CsH,EAAeS,IAAIH,EAAMJ,GACzBP,EAAmBO,WAEdH,EAAMO,EACf,CACIzE,MAAMC,QAAQ4E,EAASE,SACzBjB,EAAmBe,EAASE,OAEhC,CACF,CACIZ,EAAejD,KAAO,GACxB8D,EAAoBhB,EAAMiB,WAAYd,EAE1C,CACA,SAASa,EAAoBpH,EAAOuG,GAClC,GAAInE,MAAMC,QAAQrC,GAChB,IAAK,MAAMmC,KAAQnC,EACjBoH,EAAoBjF,EAAMoE,QAEvB,IAAI,IAAAtE,UAASjC,GAClB,IAAK,MAAOsH,EAAG9F,KAAMc,OAAO4E,QAAQlH,GAClC,GAAU,gBAANsH,EAAqB,CACvB,MAAMb,EAAWF,EAAeQ,IAAIvF,GAChCiF,WACKzG,EAAMsH,GACbtH,EAAMuH,SAA+B,IAApBd,EAASxH,OAAewH,EAAS,GAAKA,EAE3D,MACEW,EAAoB5F,EAAG+E,EAI/B,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/replaceUseChildren.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n let rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n const segments = [];\n for (let i = 1; i <= level; i++) {\n const memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.name}` : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.value}` : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n const args = callParent.node.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport const collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport const collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n const memo = new WeakSet();\n const {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your expression: \"${nonStaticUsage}\"`);\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nconst TRACK_NAMES = [\"CTX\", \"STATE\", \"FORM_STATE\"];\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const {\n expression\n } = preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n let trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n // Do not pre-evaluate a string if it doesn't include track names.\n if (TRACK_NAMES.some(name => raw.includes(name))) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, TRACK_NAMES, 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n const usedProperties = [...usage.usedProperties];\n const result = {\n context: false,\n state: false,\n formState: false\n };\n const keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperties.forEach(item => {\n const [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using track all but no \"CTX\" or \"STATE\" or \"FORM_STATE\" usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal, options) {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n if (!(options !== null && options !== void 0 && options.matchSource) || options.matchSource(fn.source)) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n },\n cacheKey: fn\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n let level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n if (fn.source.includes(objectName)) {\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n }\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your function: \"${fn.name}\"`);\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n const collection = new Set();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions, {\n matchSource(source) {\n return source.includes(PERMISSIONS);\n }\n });\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n const collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (const arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map","import { isObject } from \"@next-core/utils/general\";\nimport lodash from \"lodash\";\nconst {\n pull\n} = lodash;\nconst USE_CHILDREN_SLOT_REGEXP = /^\\[\\w+\\]$/;\n\n/**\n * Replace `useChildren: \"[xxx]\"` with `useBrick`.\n *\n * This will mutate the input.\n */\nexport function replaceUseChildren(input) {\n if (Array.isArray(input)) {\n for (const brick of input) {\n replaceInBrick(brick);\n }\n } else {\n replaceInBrick(input);\n }\n}\nfunction replaceInBrick(brick) {\n let slots = brick.slots;\n const useChildrenMap = new Map();\n if (Array.isArray(brick.children) && !slots) {\n const removeBricks = [];\n for (const child of brick.children) {\n var _child$slot;\n const slot = (_child$slot = child.slot) !== null && _child$slot !== void 0 ? _child$slot : \"\";\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n delete child.slot;\n const children = useChildrenMap.get(slot);\n if (children) {\n children.push(child);\n } else {\n useChildrenMap.set(slot, [child]);\n }\n removeBricks.push(child);\n }\n replaceInBrick(child);\n }\n pull(brick.children, ...removeBricks);\n } else {\n slots !== null && slots !== void 0 ? slots : slots = {};\n for (const [slot, slotConf] of Object.entries(slots)) {\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n const {\n bricks: children\n } = slotConf;\n if (Array.isArray(children) && children.length > 0) {\n useChildrenMap.set(slot, children);\n replaceUseChildren(children);\n }\n delete slots[slot];\n }\n if (Array.isArray(slotConf.bricks)) {\n replaceUseChildren(slotConf.bricks);\n }\n }\n }\n if (useChildrenMap.size > 0) {\n replaceInProperties(brick.properties, useChildrenMap);\n }\n}\nfunction replaceInProperties(value, useChildrenMap) {\n if (Array.isArray(value)) {\n for (const item of value) {\n replaceInProperties(item, useChildrenMap);\n }\n } else if (isObject(value)) {\n for (const [k, v] of Object.entries(value)) {\n if (k === \"useChildren\") {\n const children = useChildrenMap.get(v);\n if (children) {\n delete value[k];\n value.useBrick = children.length === 1 ? children[0] : children;\n }\n } else {\n replaceInProperties(v, useChildrenMap);\n }\n }\n }\n}\n//# sourceMappingURL=replaceUseChildren.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","cache","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","TRACK_NAMES","track","raw","trackText","variableName","expression","trackCtxExp","expressions","size","warn","JSON","stringify","trackAll","some","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","matchSource","source","traverseStoryboardFunction","silentErrors","precookFunction","typescript","cacheKey","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg","pull","USE_CHILDREN_SLOT_REGEXP","replaceUseChildren","input","brick","replaceInBrick","slots","useChildrenMap","Map","children","removeBricks","child","_child$slot","slot","test","get","set","slotConf","entries","bricks","replaceInProperties","properties","k","useBrick"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/7146.1af0c62e.js","mappings":"kJAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EA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EAAG9F,KAAMc,OAAO4E,QAAQlH,GAClC,GAAU,gBAANsH,EAAqB,CACvB,MAAMb,EAAWF,EAAeQ,IAAIvF,GAChCiF,WACKzG,EAAMsH,GACbtH,EAAMuH,SAA+B,IAApBd,EAASxH,OAAewH,EAAS,GAAKA,EAE3D,MACEW,EAAoB5F,EAAG+E,EAI/B,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/replaceUseChildren.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n let rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n const segments = [];\n for (let i = 1; i <= level; i++) {\n const memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.name}` : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.value}` : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n const args = callParent.node.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport const collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport const collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n const memo = new WeakSet();\n const {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your expression: \"${nonStaticUsage}\"`);\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nconst TRACK_NAMES = [\"CTX\", \"STATE\", \"FORM_STATE\"];\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const {\n expression\n } = preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n let trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n // Do not pre-evaluate a string if it doesn't include track names.\n if (TRACK_NAMES.some(name => raw.includes(name))) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, TRACK_NAMES, 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n const usedProperties = [...usage.usedProperties];\n const result = {\n context: false,\n state: false,\n formState: false\n };\n const keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperties.forEach(item => {\n const [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using track all but no \"CTX\" or \"STATE\" or \"FORM_STATE\" usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal, options) {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n if (!(options !== null && options !== void 0 && options.matchSource) || options.matchSource(fn.source)) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n },\n cacheKey: fn\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n let level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n if (fn.source.includes(objectName)) {\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n }\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your function: \"${fn.name}\"`);\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n const collection = new Set();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions, {\n matchSource(source) {\n return source.includes(PERMISSIONS);\n }\n });\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n const collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (const arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map","import { isObject } from \"@next-core/utils/general\";\nimport lodash from \"lodash\";\nconst {\n pull\n} = lodash;\nconst USE_CHILDREN_SLOT_REGEXP = /^\\[\\w+\\]$/;\n\n/**\n * Replace `useChildren: \"[xxx]\"` with `useBrick`.\n *\n * This will mutate the input.\n */\nexport function replaceUseChildren(input) {\n if (Array.isArray(input)) {\n for (const brick of input) {\n replaceInBrick(brick);\n }\n } else {\n replaceInBrick(input);\n }\n}\nfunction replaceInBrick(brick) {\n let slots = brick.slots;\n const useChildrenMap = new Map();\n if (Array.isArray(brick.children) && !slots) {\n const removeBricks = [];\n for (const child of brick.children) {\n var _child$slot;\n const slot = (_child$slot = child.slot) !== null && _child$slot !== void 0 ? _child$slot : \"\";\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n delete child.slot;\n const children = useChildrenMap.get(slot);\n if (children) {\n children.push(child);\n } else {\n useChildrenMap.set(slot, [child]);\n }\n removeBricks.push(child);\n }\n replaceInBrick(child);\n }\n pull(brick.children, ...removeBricks);\n } else {\n slots !== null && slots !== void 0 ? slots : slots = {};\n for (const [slot, slotConf] of Object.entries(slots)) {\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n const {\n bricks: children\n } = slotConf;\n if (Array.isArray(children) && children.length > 0) {\n useChildrenMap.set(slot, children);\n replaceUseChildren(children);\n }\n delete slots[slot];\n }\n if (Array.isArray(slotConf.bricks)) {\n replaceUseChildren(slotConf.bricks);\n }\n }\n }\n if (useChildrenMap.size > 0) {\n replaceInProperties(brick.properties, useChildrenMap);\n }\n}\nfunction replaceInProperties(value, useChildrenMap) {\n if (Array.isArray(value)) {\n for (const item of value) {\n replaceInProperties(item, useChildrenMap);\n }\n } else if (isObject(value)) {\n for (const [k, v] of Object.entries(value)) {\n if (k === \"useChildren\") {\n const children = useChildrenMap.get(v);\n if (children) {\n delete value[k];\n value.useBrick = children.length === 1 ? children[0] : children;\n }\n } else {\n replaceInProperties(v, useChildrenMap);\n }\n }\n }\n}\n//# sourceMappingURL=replaceUseChildren.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","cache","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","TRACK_NAMES","track","raw","trackText","variableName","expression","trackCtxExp","expressions","size","warn","JSON","stringify","trackAll","some","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","matchSource","source","traverseStoryboardFunction","silentErrors","precookFunction","typescript","cacheKey","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg","pull","USE_CHILDREN_SLOT_REGEXP","replaceUseChildren","input","brick","replaceInBrick","slots","useChildrenMap","Map","children","removeBricks","child","_child$slot","slot","test","get","set","slotConf","entries","bricks","replaceInProperties","properties","k","useBrick"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[8717],{8778:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,'.heading--Uyl__y0l{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--TukugFGT{font-size:16px;line-height:26px}.caret--RIrd1Bh6{opacity:0;transition:transform 0.2s ease-in-out}.heading--Uyl__y0l:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--Uyl__y0l:hover .caret--RIrd1Bh6{opacity:1}.icon--i_Eo2KvU{display:flex;align-items:center;margin-right:12px}.title--dRyYSVof{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--eKJi4smD{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;color:#595959;cursor:pointer}.body--CUgbPhLT{padding-left:26px;margin-bottom:20px}.collapsed--RP7bbO2u .body--CUgbPhLT{display:none}.collapsed--RP7bbO2u .caret--RIrd1Bh6{transform:rotate(180deg);opacity:1}.content--zdMqn1ov{margin-top:14px}.content--zdMqn1ov .markdown--id3ANDOE [class*="code-wrapper--"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--zdMqn1ov:empty{display:none}.message--CC09F6Pi:first-child > .message-part--h0OExat1:first-child > :first-child{margin-top:0}.icon--i_Eo2KvU{color:#abaab7}.completed--NfHzTqxj .icon--i_Eo2KvU{color:#0fbe59}.failed--UHw5ym5a .icon--i_Eo2KvU{color:#f24c25}.working--hPmYriQY .icon--i_Eo2KvU{color:var(--elevo-color-brand)}.input-required--iLv9MI8X .icon--i_Eo2KvU{color:#12aacc}.canceled--xdorM4ka .icon--i_Eo2KvU{color:#fcaa07}ai-portal\\.chat-stream[hide-mermaid] .content--zdMqn1ov .markdown--id3ANDOE .mermaid{display:none}',""]),r.locals={heading:"heading--Uyl__y0l",main:"main--TukugFGT",caret:"caret--RIrd1Bh6",icon:"icon--i_Eo2KvU",title:"title--dRyYSVof",tool:"tool--eKJi4smD",body:"body--CUgbPhLT",collapsed:"collapsed--RP7bbO2u",content:"content--zdMqn1ov",markdown:"markdown--id3ANDOE",message:"message--CC09F6Pi","message-part":"message-part--h0OExat1",completed:"completed--NfHzTqxj",failed:"failed--UHw5ym5a",working:"working--hPmYriQY","input-required":"input-required--iLv9MI8X",canceled:"canceled--xdorM4ka"};const l=r},26598:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}",""]),r.locals={user:"user--HjXM9OHW"};const l=r},32360:(e,t,a)=>{e.exports=a.p+"images/72c24398.png"},35754:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,'.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{position:absolute;content:" ";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.error--vPC70WgS{color:var(--color-error);white-space:pre-wrap}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}',""]),r.locals={assistant:"assistant--CrlgPgYL",body:"body--sAIo2dhL",texting:"texting--Rpmsbpca",error:"error--vPC70WgS",avatar:"avatar--jaJhEiSV"};const l=r},48952:(e,t,a)=>{a.d(t,{I:()=>r,K:()=>o,NS:()=>i,t:()=>l});var n=a(68443);let o=function(e){return e.SWITCH_TO_CANVAS="SWITCH_TO_CANVAS",e}({});const i="bricks/ai-portal/chat-stream",r={en:{SWITCH_TO_CANVAS:"Switch to canvas"},zh:{SWITCH_TO_CANVAS:"切换为画布"}},l=n.i18n.getFixedT(null,i)},65438:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}",""]),r.locals={view:"view--O8CNDdS_",large:"large--jT3IWlRf"};const l=r},68717:(e,t,a)=>{a.d(t,{C:()=>pe});var n=a(18769),o=a.n(n),i=a(51921),r=a(99126),l=a(53373),s=a.n(l),c=a(33136),d=a(18122),m=a(30672),p=a(72591),u=a.n(p),h=a(1740),f=a.n(h),b=a(88128),g=a.n(b),v=a(30855),x=a.n(v),w=a(93051),k=a.n(w),y=a(73656),E=a.n(y),A=a(26598),N={};N.styleTagTransform=E(),N.setAttributes=x(),N.insert=g().bind(null,"head"),N.domAPI=f(),N.insertStyleElement=k(),u()(A.A,N);const C=A.A&&A.A.locals?A.A.locals:void 0;function T(e){let{content:t}=e;return o().createElement("div",{className:C.user},t)}var I=a(35754),j={};j.styleTagTransform=E(),j.setAttributes=x(),j.insert=g().bind(null,"head"),j.domAPI=f(),j.insertStyleElement=k(),u()(I.A,j);const S=I.A&&I.A.locals?I.A.locals:void 0;var _=a(89575),O=a(8778),R={};R.styleTagTransform=E(),R.setAttributes=x(),R.insert=g().bind(null,"head"),R.domAPI=f(),R.insertStyleElement=k(),u()(O.A,R);const U=O.A&&O.A.locals?O.A.locals:void 0;var P=a(36903),V=a(69606),z=a(42854),H=a(86976),F=a(65438),M={};M.styleTagTransform=E(),M.setAttributes=x(),M.insert=g().bind(null,"head"),M.domAPI=f(),M.insertStyleElement=k(),u()(F.A,M);const J=F.A&&F.A.locals?F.A.locals:void 0;function D(e){let{job:t}=e;const[a,i]=(0,n.useState)("medium"),r=(0,n.useCallback)((e=>{i(e)}),[]);return o().createElement("div",{className:s()(J.view,{[J.large]:"large"===a})},o().createElement(H.y,{job:t,onSizeChange:r}))}var L=a(76720);const q=(0,n.createContext)({lastToolCallJobId:null,setUserClosedAside:()=>{}}),K={lib:"fa",icon:"angle-up"};function W(e){var t,a;let{job:i,taskState:r}=e;const l=i.toolCall,c=(null==l||null===(t=l.annotations)||void 0===t?void 0:t.title)||(null==l?void 0:l.name),d=null==l?void 0:l.name,p=!!l,{setActiveToolCallJobId:u}=(0,n.useContext)(L.j),{lastToolCallJobId:h,setUserClosedAside:f}=(0,n.useContext)(q),{className:b,icon:g}=(0,n.useMemo)((()=>function(e,t){switch(e){case"completed":return{className:U.completed,icon:{lib:"antd",theme:"filled",icon:"check-circle"}};case"submitted":case"working":return"terminated"===t?{icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:U.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:U["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:U.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":case"terminated":return{className:U.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};case"skipped":return{icon:{lib:"fa",prefix:"fas",icon:"ban"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}(i.state,r)),[i.state,r]),[v,x]=(0,n.useMemo)((()=>{var e;const t=[],a=[],n=[];let o="llm_answer"===d;return null===(e=i.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const l of e.parts){var i;if("data"===l.type)switch(null===(i=l.data)||void 0===i?void 0:i.type){case"markdown":t.push(l.data.content);break;case"cmdb_instance_detail":var r;a.push(l.data),o||(o=Object.keys("object"===(null===(r=l.data)||void 0===r||null===(r=r.outputSchema)||void 0===r?void 0:r.type)?l.data.outputSchema.properties:l.data.detail).length>6)}else"file"===l.type&&n.push(l.file)}})),[t.join(""),a,n]}),[i.messages,d]),[w,k]=(0,n.useState)(!1);return o().createElement("div",{className:s()({[U.collapsed]:w})},o().createElement("div",{className:U.main},null===(a=i.messages)||void 0===a?void 0:a.map(((e,t)=>{var a;return"tool"===e.role?null:o().createElement("div",{key:t,className:s()(U.message,P.A.markdown)},null===(a=e.parts)||void 0===a?void 0:a.map(((e,t)=>o().createElement(o().Fragment,{key:t},"text"===e.type&&o().createElement(V.w,{className:s()(U["message-part"],P.A["markdown-wrapper"]),content:e.text})))))}))),p&&o().createElement(o().Fragment,null,o().createElement("div",{className:s()(U.heading,b),onClick:()=>k((e=>!e))},o().createElement("div",{className:U.icon},o().createElement(m.Bj,g)),o().createElement("div",{className:U.title},i.instruction||c),o().createElement(m.Bj,(0,_.A)({className:U.caret},K))),o().createElement("div",{className:U.body},o().createElement("div",{className:U.tool,onClick:()=>{u(i.id),i.id===h&&f(!1)}},c),o().createElement("div",{className:U.content},v&&o().createElement("div",{className:s()(U.markdown,P.A.markdown)},o().createElement(V.w,{className:P.A["markdown-wrapper"],content:v})),x.map(((e,t)=>o().createElement("div",{key:t,className:U.box},o().createElement(z.H,e)))),i.generatedView?o().createElement(D,{job:i}):null))))}var Y=a(40177);function B(e){let{jobs:t,taskState:a,error:i,isLatest:r}=e;const l=(0,n.useMemo)((()=>{if(!r||Y.Z5.includes(a))return!1;for(const e of t)if("input-required"===e.state)return!1;const e=t[t.length-1];return!e||"working"!==e.state||!e.toolCall}),[r,t,a]);return o().createElement("div",{className:S.assistant},o().createElement(m.Bj,{lib:"easyops",category:"image",icon:"elevo-avatar-png",className:S.avatar}),o().createElement("div",{className:S.body},t.map((e=>o().createElement(W,{key:e.id,job:e,taskState:a}))),l&&o().createElement("div",{className:S.texting}),null!=i&&o().createElement("div",{className:S.error},i)))}var X=a(70046),G=a(62309),Q=a(83090),Z={};Z.styleTagTransform=E(),Z.setAttributes=x(),Z.insert=g().bind(null,"head"),Z.domAPI=f(),Z.insertStyleElement=k(),u()(Q.A,Z);const $=Q.A&&Q.A.locals?Q.A.locals:void 0;var ee=a(39649);const te={lib:"easyops",icon:"shrink"};function ae(e){let{job:t}=e;const{setActiveToolCallJobId:a}=(0,n.useContext)(L.j),{setUserClosedAside:i}=(0,n.useContext)(q),[r,l]=(0,n.useMemo)((()=>{var e;const a=[],n=[],o=[];return null===(e=t.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const i of e.parts){var t;if("data"===i.type)switch(null===(t=i.data)||void 0===t?void 0:t.type){case"markdown":a.push(i.data.content);break;case"cmdb_instance_detail":n.push(i.data)}else"file"===i.type&&o.push(i.file)}})),[a.join(""),n,o]}),[t.messages]);return o().createElement("div",{className:$.aside},o().createElement("div",{className:$.box},o().createElement("div",{className:$.header},o().createElement("div",{className:$.title},"Elevo's Computer"),o().createElement(m.Py,{icon:te,variant:"mini",onClick:()=>{a(null),i(!0)}})),o().createElement("div",{className:$.body},o().createElement(ee.t,{job:t,variant:"read-only"}),t.generatedView?o().createElement(ne,{name:"View",source:t.generatedView.code,language:"jsx"}):r?o().createElement(ne,{name:"Content",source:r,language:"md"}):l.length>0?o().createElement(ne,{name:"CMDB",source:JSON.stringify(l,null,2),language:"json"}):null)))}function ne(e){let{name:t,source:a,language:n}=e;return o().createElement("div",{className:s()($.app,$.editor)},o().createElement("div",{className:$.heading},`${t}.${n}`),o().createElement("div",{className:s()($.content,P.A.markdown)},o().createElement("div",{className:$.scroller},o().createElement(m.yQ,{className:$["code-block"],source:a,language:n,themeVariant:"elevo"}))))}var oe=a(94625),ie=a(76239),re={};re.styleTagTransform=E(),re.setAttributes=x(),re.insert=g().bind(null,"head"),re.domAPI=f(),re.insertStyleElement=k(),u()(ie.A,re);const le=ie.A&&ie.A.locals?ie.A.locals:void 0;var se=a(86767),ce=a(48952),de=a(98153);const me={lib:"easyops",icon:"share"};function pe(e,t){var a;let{conversationId:l,initialRequest:p,replay:u,replayDelay:h,supports:f,showHumanActions:b,showFeedback:g,showFeedbackAfterFailed:v,showFeedbackOnView:x,showUiSwitch:w,previewUrlTemplate:k,showCases:y,exampleProjects:E,tryItOutUrl:A,onShare:N,onTerminate:C,onSubmitFeedback:I,onSwitchToCanvas:j,onFeedbackOnView:S,onDetailChange:_}=e;const{conversation:O,tasks:R,errors:U,humanInputRef:P,skipToResults:V,watchAgain:z}=(0,c.u)(l,p,u,h),H=null!==(a=null==O?void 0:O.title)&&void 0!==a?a:"",F=null==O?void 0:O.state,M=Y.QB.includes(F)||"input-required"===F,{messages:J,jobMap:D,lastToolCallJobId:K}=function(e,t,a,o){return(0,n.useMemo)((()=>{if(!e)return{messages:[],lastToolCallJobId:null};const n=[],{list:i,map:r,jobsWithFollowingErrors:l}=(0,d.$)(t,a);let s={role:"assistant",jobs:[]},c=null;for(const e of i){var m;const t=r.get(e);t.toolCall&&(c=e),"completed"===t.state&&null!==(m=t.messages)&&void 0!==m&&m.length&&t.messages.every((e=>"user"===e.role))?((s.jobs.length>0||s.error)&&n.push(s),n.push({role:"user",content:t.messages.flatMap((e=>e.parts.map((e=>"text"===e.type?e.text:"")))).join("")}),s={role:"assistant",jobs:[]}):s.jobs.push(t);const a=l.get(e);a&&(s.error=a),null!=o&&o.showHumanActions&&t.humanAction&&((s.jobs.length>0||s.error)&&n.push(s),n.push({role:"user",content:t.humanAction}),s={role:"assistant",jobs:[]})}return n.push(s),{messages:n,jobMap:r,lastToolCallJobId:c}}),[e,t,a])}(O,R,U,{showHumanActions:b});(0,n.useEffect)((()=>{_({projectId:null==O?void 0:O.projectId})}),[_,null==O?void 0:O.projectId]);const W=(0,n.useMemo)((()=>D?[...D.values()].flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[])):[]),[D]),[Q,Z]=(0,n.useState)(!1),[$,ee]=(0,n.useState)(!1),[te,ne]=(0,n.useState)(!!g);(0,n.useEffect)((()=>{ne(!!g)}),[g]);const[ie,re]=(0,n.useState)(),pe=(0,n.useCallback)((e=>{Z(!0),I(e)}),[I]);(0,n.useImperativeHandle)(t,(()=>({feedbackSubmitDone:()=>{ee(!0),setTimeout((()=>{ne(!1)}),3e3)},feedbackSubmitFailed:()=>{Z(!1)},feedbackOnViewDone:e=>{re((t=>{const a=new Set(t);return a.add(e),a}))}})),[]);const[ue,he]=(0,n.useState)(null),[fe,be]=(0,n.useState)(null),[ge,ve]=(0,n.useState)(!1),xe=(0,n.useRef)(!1),we=!!O;(0,n.useEffect)((()=>{if(we){const e=setTimeout((()=>{xe.current=!0}),1e3);return()=>{clearTimeout(e)}}}),[we]),(0,n.useEffect)((()=>{xe.current&&K&&!ge&&be(K)}),[K,ge]),(0,n.useEffect)((()=>{(0,i.getRuntime)().applyPageTitle(H)}),[H]);const ke=(0,n.useCallback)(((e,t,a)=>{var n;null===(n=P.current)||void 0===n||n.call(P,e,t,a)}),[P]),ye=J[0],Ee=(0,n.useMemo)((()=>{if("user"===(null==ye?void 0:ye.role))return ye.content}),[ye]),Ae=l,Ne=(0,n.useMemo)((()=>({conversationId:l,workspace:Ae,previewUrlTemplate:k,replay:u,showCases:y,exampleProjects:E,humanInput:ke,onShare:N,onTerminate:C,supports:f,activeExpandedViewJobId:ue,setActiveExpandedViewJobId:he,activeToolCallJobId:fe,setActiveToolCallJobId:be,submittingFeedback:Q,submittedFeedback:$,onSubmitFeedback:pe,setShowFeedback:ne,showFeedbackOnView:x,onFeedbackOnView:S,feedbackDoneViews:ie,skipToResults:V,watchAgain:z,tryItOut(){const e=window.open(`${(0,i.getBasePath)().slice(0,-1)}${null!=A?A:"/elevo"}`,"_blank");e&&(e.__elevo_try_it_out={content:Ee})}})),[l,Ae,k,u,y,E,ke,N,C,f,ue,fe,Q,$,pe,x,S,ie,V,z,Ee,A]),Ce=(0,n.useMemo)((()=>({lastToolCallJobId:K,setUserClosedAside:ve})),[K]),Te=(0,n.useRef)(!1),Ie=(0,n.useRef)(!1),je=(0,n.useRef)(null),[Se,_e]=(0,n.useState)(!1);(0,n.useEffect)((()=>{const e=je.current,t=null==e?void 0:e.firstElementChild;if(Ie.current||!e||!t)return;const a=()=>{_e(e.scrollTop+e.clientHeight+24<e.scrollHeight),Te.current&&(Ie.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let n;e.addEventListener("scroll",a);const o=new r.A((()=>{Ie.current||(Te.current=!1,e.scrollTo({top:t.scrollHeight,behavior:"instant"}),clearTimeout(n),n=setTimeout((()=>{Te.current=!0}),100))}));return o.observe(t),()=>{o.disconnect(),e.removeEventListener("scroll",a)}}),[we]);const Oe=(0,n.useCallback)((()=>{const e=je.current;null==e||e.scrollTo({top:null==e?void 0:e.scrollHeight,behavior:"instant"})}),[]),Re=(0,n.useMemo)((()=>fe&&(null==D?void 0:D.get(fe))||null),[fe,D]);return o().createElement(L.j.Provider,{value:Ne},o().createElement(q.Provider,{value:Ce},o().createElement("div",{className:le.container},o().createElement("div",{className:le.header},o().createElement("div",{className:le.left}),o().createElement("h1",null,H),o().createElement("div",{className:le.right},w&&o().createElement(m.Py,{className:le["navbar-switch-ui"],icon:Y.Rq,variant:"mini",title:(0,ce.t)(ce.K.SWITCH_TO_CANVAS),onClick:j}),o().createElement(m.Py,{icon:me,variant:"mini",onClick:N}))),we?o().createElement(o().Fragment,null,o().createElement("div",{className:le.main,ref:je},o().createElement("div",{className:le.narrow},J.map(((e,t,a)=>o().createElement("div",{className:le.message,key:t},"user"===e.role?o().createElement(T,{content:e.content}):o().createElement(B,{jobs:e.jobs,taskState:F,error:e.error,isLatest:t===a.length-1})))),u?(null==O?void 0:O.finished)&&o().createElement(de.A,{finished:!0,ui:"chat"}):te&&("completed"===F||"failed"===F&&v)&&o().createElement(oe.k,{className:le.feedback}))),o().createElement("div",{className:le["scroll-down"],hidden:!Se,onClick:Oe},o().createElement(m.Bj,{lib:"antd",icon:"down"})),(u?null==O||!O.finished:null==f?void 0:f.chat)?o().createElement("div",{className:le.footer},o().createElement("div",{className:le.narrow},u?o().createElement(de.A,null):o().createElement(X.s,{state:F,canChat:M}))):null):o().createElement("div",{className:le["loading-icon"]},o().createElement(m.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))),o().createElement("div",{className:s()(le.aside,{[le.expanded]:!!Re})},Re&&o().createElement(ae,{job:Re})),ue&&o().createElement(G.f,{views:W}),w&&o().createElement("div",{className:s()(se.A.toolbar,le.toolbar)},o().createElement(m.Py,{icon:Y.Rq,variant:"mini",title:(0,ce.t)(ce.K.SWITCH_TO_CANVAS),onClick:j}))))}},76239:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i),l=a(20062),s=a.n(l),c=new URL(a(32360),a.b),d=r()(o()),m=s()(c);d.push([e.id,`ai-portal\\.chat-stream{display:flex;position:relative;width:100%;height:100%;overflow:hidden;background-color:#f3f3f4;background-image:url(${m});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:rgba(0,0,0,0.88);--cruise-canvas-node-width-small:330px;--cruise-canvas-node-width-medium:453px;--cruise-canvas-node-width-large:800px;--cruise-canvas-primary-color:var(--elevo-color-brand);--cruise-canvas-input-background:rgba(255,255,255,0.8);--cruise-canvas-input-box-shadow:0px 1px 0px 0px #ffffff,inset 0px 2px 4px 0px #b3bcf9}.container--IOwk4fR1{display:flex;flex-direction:column;position:relative;flex:1;min-width:0}.header--O9c4lNA3{height:54px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.header--O9c4lNA3 h1{font-weight:500;font-size:14px;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.header--O9c4lNA3 .left--ed9ka1jF,.header--O9c4lNA3 .right--fs8TyVN3{width:56px}.header--O9c4lNA3 .right--fs8TyVN3{display:flex;align-items:center;justify-content:end;gap:8px}.main--KDIjetJs{overflow-y:auto;flex:1;padding:20px 24px}.narrow--xWih9UIb{width:100%;max-width:800px;margin:0 auto}.message--YIXGDQNi + .message--YIXGDQNi{margin-top:40px}.loading-icon--lagcmORP{flex:1;display:flex;align-items:center;justify-content:center;font-size:48px;color:#fff}.footer--aLZ8UWjM{padding:0 20px 24px}.aside--Xjd6To2A{width:0%;height:100%;transition:width 0.2s ease-in-out}.expanded--xZgk3uBF{width:50%}.feedback--YbYylTcK{margin:24px auto 0}.scroll-down--uNre4ZYi{display:flex;align-items:center;justify-content:center;position:absolute;left:50%;bottom:120px;transform:translateX(-50%);width:32px;height:32px;font-size:12px;border-radius:16px;background:#ffffff;box-shadow:0px 4px 8px 0px rgba(0,0,0,0.06);border:1px solid rgba(0,0,0,0.02);cursor:pointer}.scroll-down--uNre4ZYi:hover{box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1)}.toolbar--uiLshJmw{left:20px;bottom:20px}.navbar-switch-ui--hREVJ6zG{display:none}@media (max-width: 1123px){div.toolbar--uiLshJmw{display:none}.navbar-switch-ui--hREVJ6zG{display:block}}`,""]),d.locals={container:"container--IOwk4fR1",header:"header--O9c4lNA3",left:"left--ed9ka1jF",right:"right--fs8TyVN3",main:"main--KDIjetJs",narrow:"narrow--xWih9UIb",message:"message--YIXGDQNi","loading-icon":"loading-icon--lagcmORP",footer:"footer--aLZ8UWjM",aside:"aside--Xjd6To2A",expanded:"expanded--xZgk3uBF",feedback:"feedback--YbYylTcK","scroll-down":"scroll-down--uNre4ZYi",toolbar:"toolbar--uiLshJmw","navbar-switch-ui":"navbar-switch-ui--hREVJ6zG"};const p=d},83090:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".aside--DDIdDtkt{padding:12px 12px 12px 0;height:100%}.box--niuFBiiQ{background:#ffffff;box-shadow:1px 1px 10px 0px rgba(0,10,26,0.1);border-radius:12px;height:100%;display:flex;flex-direction:column}.header--DPl_hrTp{height:52px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,0.15);padding:0 20px}.title--HlE9yRcJ{font-weight:500;font-size:16px;color:#262626}.body--OLKz1zeC{flex:1;min-height:0;padding:20px;display:flex;flex-direction:column}.app--UanK0TGf{flex:1;min-height:0;background:#ffffff;border-radius:9px;border:1px solid #ccd1de;margin-top:16px;overflow:hidden;display:flex;flex-direction:column}.heading--ngRi_rQ4{background:#e6e9f3;color:#5e6472;padding:5px 14px}.content--I2i0y65v{font-size:12px;flex:1;min-height:0;position:relative}.scroller--mLfznC_I{height:100%;overflow-x:hidden;overflow-y:auto;overflow:hidden auto;padding:10px}.scroller--mLfznC_I.loading--U1GWHEp9{display:flex;align-items:center;justify-content:center}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(wrapper){position:static;margin:0}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(pre){background:none!important;padding:0;border-radius:0;border:0}",""]),r.locals={aside:"aside--DDIdDtkt",box:"box--niuFBiiQ",header:"header--DPl_hrTp",title:"title--HlE9yRcJ",body:"body--OLKz1zeC",app:"app--UanK0TGf",heading:"heading--ngRi_rQ4",content:"content--I2i0y65v",scroller:"scroller--mLfznC_I",loading:"loading--U1GWHEp9",editor:"editor--p_Sqs1os","code-block":"code-block--XiUVX7st"};const l=r}}]);
|
|
2
|
-
//# sourceMappingURL=8717.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[8717],{8778:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,'.heading--Uyl__y0l{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--TukugFGT{font-size:16px;line-height:26px}.caret--RIrd1Bh6{opacity:0;transition:transform 0.2s ease-in-out}.heading--Uyl__y0l:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--Uyl__y0l:hover .caret--RIrd1Bh6{opacity:1}.icon--i_Eo2KvU{display:flex;align-items:center;margin-right:12px}.title--dRyYSVof{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--eKJi4smD{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;color:#595959;cursor:pointer}.body--CUgbPhLT{padding-left:26px;margin-bottom:20px}.collapsed--RP7bbO2u .body--CUgbPhLT{display:none}.collapsed--RP7bbO2u .caret--RIrd1Bh6{transform:rotate(180deg);opacity:1}.content--zdMqn1ov{margin-top:14px}.content--zdMqn1ov .markdown--id3ANDOE [class*="code-wrapper--"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--zdMqn1ov:empty{display:none}.message--CC09F6Pi:first-child > .message-part--h0OExat1:first-child > :first-child{margin-top:0}.icon--i_Eo2KvU{color:#abaab7}.completed--NfHzTqxj .icon--i_Eo2KvU{color:#0fbe59}.failed--UHw5ym5a .icon--i_Eo2KvU{color:#f24c25}.working--hPmYriQY .icon--i_Eo2KvU{color:var(--elevo-color-brand)}.input-required--iLv9MI8X .icon--i_Eo2KvU{color:#12aacc}.canceled--xdorM4ka .icon--i_Eo2KvU{color:#fcaa07}ai-portal\\.chat-stream[hide-mermaid] .content--zdMqn1ov .markdown--id3ANDOE .mermaid{display:none}',""]),r.locals={heading:"heading--Uyl__y0l",main:"main--TukugFGT",caret:"caret--RIrd1Bh6",icon:"icon--i_Eo2KvU",title:"title--dRyYSVof",tool:"tool--eKJi4smD",body:"body--CUgbPhLT",collapsed:"collapsed--RP7bbO2u",content:"content--zdMqn1ov",markdown:"markdown--id3ANDOE",message:"message--CC09F6Pi","message-part":"message-part--h0OExat1",completed:"completed--NfHzTqxj",failed:"failed--UHw5ym5a",working:"working--hPmYriQY","input-required":"input-required--iLv9MI8X",canceled:"canceled--xdorM4ka"};const l=r},26598:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}",""]),r.locals={user:"user--HjXM9OHW"};const l=r},32360:(e,t,a)=>{e.exports=a.p+"images/72c24398.png"},35754:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,'.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{position:absolute;content:" ";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.error--vPC70WgS{color:var(--color-error);white-space:pre-wrap}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}',""]),r.locals={assistant:"assistant--CrlgPgYL",body:"body--sAIo2dhL",texting:"texting--Rpmsbpca",error:"error--vPC70WgS",avatar:"avatar--jaJhEiSV"};const l=r},48952:(e,t,a)=>{a.d(t,{I:()=>r,K:()=>o,NS:()=>i,t:()=>l});var n=a(52616);let o=function(e){return e.SWITCH_TO_CANVAS="SWITCH_TO_CANVAS",e}({});const i="bricks/ai-portal/chat-stream",r={en:{SWITCH_TO_CANVAS:"Switch to canvas"},zh:{SWITCH_TO_CANVAS:"切换为画布"}},l=n.i18n.getFixedT(null,i)},65438:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}",""]),r.locals={view:"view--O8CNDdS_",large:"large--jT3IWlRf"};const l=r},68717:(e,t,a)=>{a.d(t,{C:()=>pe});var n=a(18769),o=a.n(n),i=a(30348),r=a(99126),l=a(53373),s=a.n(l),c=a(33136),d=a(18122),m=a(30672),p=a(72591),u=a.n(p),h=a(1740),f=a.n(h),b=a(88128),g=a.n(b),v=a(30855),x=a.n(v),w=a(93051),k=a.n(w),y=a(73656),E=a.n(y),A=a(26598),N={};N.styleTagTransform=E(),N.setAttributes=x(),N.insert=g().bind(null,"head"),N.domAPI=f(),N.insertStyleElement=k(),u()(A.A,N);const C=A.A&&A.A.locals?A.A.locals:void 0;function T(e){let{content:t}=e;return o().createElement("div",{className:C.user},t)}var I=a(35754),j={};j.styleTagTransform=E(),j.setAttributes=x(),j.insert=g().bind(null,"head"),j.domAPI=f(),j.insertStyleElement=k(),u()(I.A,j);const S=I.A&&I.A.locals?I.A.locals:void 0;var _=a(89575),O=a(8778),R={};R.styleTagTransform=E(),R.setAttributes=x(),R.insert=g().bind(null,"head"),R.domAPI=f(),R.insertStyleElement=k(),u()(O.A,R);const U=O.A&&O.A.locals?O.A.locals:void 0;var P=a(36903),V=a(69606),z=a(42854),H=a(86976),F=a(65438),M={};M.styleTagTransform=E(),M.setAttributes=x(),M.insert=g().bind(null,"head"),M.domAPI=f(),M.insertStyleElement=k(),u()(F.A,M);const J=F.A&&F.A.locals?F.A.locals:void 0;function D(e){let{job:t}=e;const[a,i]=(0,n.useState)("medium"),r=(0,n.useCallback)((e=>{i(e)}),[]);return o().createElement("div",{className:s()(J.view,{[J.large]:"large"===a})},o().createElement(H.y,{job:t,onSizeChange:r}))}var L=a(76720);const q=(0,n.createContext)({lastToolCallJobId:null,setUserClosedAside:()=>{}}),K={lib:"fa",icon:"angle-up"};function W(e){var t,a;let{job:i,taskState:r}=e;const l=i.toolCall,c=(null==l||null===(t=l.annotations)||void 0===t?void 0:t.title)||(null==l?void 0:l.name),d=null==l?void 0:l.name,p=!!l,{setActiveToolCallJobId:u}=(0,n.useContext)(L.j),{lastToolCallJobId:h,setUserClosedAside:f}=(0,n.useContext)(q),{className:b,icon:g}=(0,n.useMemo)((()=>function(e,t){switch(e){case"completed":return{className:U.completed,icon:{lib:"antd",theme:"filled",icon:"check-circle"}};case"submitted":case"working":return"terminated"===t?{icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:U.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:U["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:U.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":case"terminated":return{className:U.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};case"skipped":return{icon:{lib:"fa",prefix:"fas",icon:"ban"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}(i.state,r)),[i.state,r]),[v,x]=(0,n.useMemo)((()=>{var e;const t=[],a=[],n=[];let o="llm_answer"===d;return null===(e=i.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const l of e.parts){var i;if("data"===l.type)switch(null===(i=l.data)||void 0===i?void 0:i.type){case"markdown":t.push(l.data.content);break;case"cmdb_instance_detail":var r;a.push(l.data),o||(o=Object.keys("object"===(null===(r=l.data)||void 0===r||null===(r=r.outputSchema)||void 0===r?void 0:r.type)?l.data.outputSchema.properties:l.data.detail).length>6)}else"file"===l.type&&n.push(l.file)}})),[t.join(""),a,n]}),[i.messages,d]),[w,k]=(0,n.useState)(!1);return o().createElement("div",{className:s()({[U.collapsed]:w})},o().createElement("div",{className:U.main},null===(a=i.messages)||void 0===a?void 0:a.map(((e,t)=>{var a;return"tool"===e.role?null:o().createElement("div",{key:t,className:s()(U.message,P.A.markdown)},null===(a=e.parts)||void 0===a?void 0:a.map(((e,t)=>o().createElement(o().Fragment,{key:t},"text"===e.type&&o().createElement(V.w,{className:s()(U["message-part"],P.A["markdown-wrapper"]),content:e.text})))))}))),p&&o().createElement(o().Fragment,null,o().createElement("div",{className:s()(U.heading,b),onClick:()=>k((e=>!e))},o().createElement("div",{className:U.icon},o().createElement(m.Bj,g)),o().createElement("div",{className:U.title},i.instruction||c),o().createElement(m.Bj,(0,_.A)({className:U.caret},K))),o().createElement("div",{className:U.body},o().createElement("div",{className:U.tool,onClick:()=>{u(i.id),i.id===h&&f(!1)}},c),o().createElement("div",{className:U.content},v&&o().createElement("div",{className:s()(U.markdown,P.A.markdown)},o().createElement(V.w,{className:P.A["markdown-wrapper"],content:v})),x.map(((e,t)=>o().createElement("div",{key:t,className:U.box},o().createElement(z.H,e)))),i.generatedView?o().createElement(D,{job:i}):null))))}var Y=a(40177);function B(e){let{jobs:t,taskState:a,error:i,isLatest:r}=e;const l=(0,n.useMemo)((()=>{if(!r||Y.Z5.includes(a))return!1;for(const e of t)if("input-required"===e.state)return!1;const e=t[t.length-1];return!e||"working"!==e.state||!e.toolCall}),[r,t,a]);return o().createElement("div",{className:S.assistant},o().createElement(m.Bj,{lib:"easyops",category:"image",icon:"elevo-avatar-png",className:S.avatar}),o().createElement("div",{className:S.body},t.map((e=>o().createElement(W,{key:e.id,job:e,taskState:a}))),l&&o().createElement("div",{className:S.texting}),null!=i&&o().createElement("div",{className:S.error},i)))}var X=a(70046),G=a(62309),Q=a(83090),Z={};Z.styleTagTransform=E(),Z.setAttributes=x(),Z.insert=g().bind(null,"head"),Z.domAPI=f(),Z.insertStyleElement=k(),u()(Q.A,Z);const $=Q.A&&Q.A.locals?Q.A.locals:void 0;var ee=a(39649);const te={lib:"easyops",icon:"shrink"};function ae(e){let{job:t}=e;const{setActiveToolCallJobId:a}=(0,n.useContext)(L.j),{setUserClosedAside:i}=(0,n.useContext)(q),[r,l]=(0,n.useMemo)((()=>{var e;const a=[],n=[],o=[];return null===(e=t.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const i of e.parts){var t;if("data"===i.type)switch(null===(t=i.data)||void 0===t?void 0:t.type){case"markdown":a.push(i.data.content);break;case"cmdb_instance_detail":n.push(i.data)}else"file"===i.type&&o.push(i.file)}})),[a.join(""),n,o]}),[t.messages]);return o().createElement("div",{className:$.aside},o().createElement("div",{className:$.box},o().createElement("div",{className:$.header},o().createElement("div",{className:$.title},"Elevo's Computer"),o().createElement(m.Py,{icon:te,variant:"mini",onClick:()=>{a(null),i(!0)}})),o().createElement("div",{className:$.body},o().createElement(ee.t,{job:t,variant:"read-only"}),t.generatedView?o().createElement(ne,{name:"View",source:t.generatedView.code,language:"jsx"}):r?o().createElement(ne,{name:"Content",source:r,language:"md"}):l.length>0?o().createElement(ne,{name:"CMDB",source:JSON.stringify(l,null,2),language:"json"}):null)))}function ne(e){let{name:t,source:a,language:n}=e;return o().createElement("div",{className:s()($.app,$.editor)},o().createElement("div",{className:$.heading},`${t}.${n}`),o().createElement("div",{className:s()($.content,P.A.markdown)},o().createElement("div",{className:$.scroller},o().createElement(m.yQ,{className:$["code-block"],source:a,language:n,themeVariant:"elevo"}))))}var oe=a(94625),ie=a(76239),re={};re.styleTagTransform=E(),re.setAttributes=x(),re.insert=g().bind(null,"head"),re.domAPI=f(),re.insertStyleElement=k(),u()(ie.A,re);const le=ie.A&&ie.A.locals?ie.A.locals:void 0;var se=a(86767),ce=a(48952),de=a(98153);const me={lib:"easyops",icon:"share"};function pe(e,t){var a;let{conversationId:l,initialRequest:p,replay:u,replayDelay:h,supports:f,showHumanActions:b,showFeedback:g,showFeedbackAfterFailed:v,showFeedbackOnView:x,showUiSwitch:w,previewUrlTemplate:k,showCases:y,exampleProjects:E,tryItOutUrl:A,onShare:N,onTerminate:C,onSubmitFeedback:I,onSwitchToCanvas:j,onFeedbackOnView:S,onDetailChange:_}=e;const{conversation:O,tasks:R,errors:U,humanInputRef:P,skipToResults:V,watchAgain:z}=(0,c.u)(l,p,u,h),H=null!==(a=null==O?void 0:O.title)&&void 0!==a?a:"",F=null==O?void 0:O.state,M=Y.QB.includes(F)||"input-required"===F,{messages:J,jobMap:D,lastToolCallJobId:K}=function(e,t,a,o){return(0,n.useMemo)((()=>{if(!e)return{messages:[],lastToolCallJobId:null};const n=[],{list:i,map:r,jobsWithFollowingErrors:l}=(0,d.$)(t,a);let s={role:"assistant",jobs:[]},c=null;for(const e of i){var m;const t=r.get(e);t.toolCall&&(c=e),"completed"===t.state&&null!==(m=t.messages)&&void 0!==m&&m.length&&t.messages.every((e=>"user"===e.role))?((s.jobs.length>0||s.error)&&n.push(s),n.push({role:"user",content:t.messages.flatMap((e=>e.parts.map((e=>"text"===e.type?e.text:"")))).join("")}),s={role:"assistant",jobs:[]}):s.jobs.push(t);const a=l.get(e);a&&(s.error=a),null!=o&&o.showHumanActions&&t.humanAction&&((s.jobs.length>0||s.error)&&n.push(s),n.push({role:"user",content:t.humanAction}),s={role:"assistant",jobs:[]})}return n.push(s),{messages:n,jobMap:r,lastToolCallJobId:c}}),[e,t,a])}(O,R,U,{showHumanActions:b});(0,n.useEffect)((()=>{_({projectId:null==O?void 0:O.projectId})}),[_,null==O?void 0:O.projectId]);const W=(0,n.useMemo)((()=>D?[...D.values()].flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[])):[]),[D]),[Q,Z]=(0,n.useState)(!1),[$,ee]=(0,n.useState)(!1),[te,ne]=(0,n.useState)(!!g);(0,n.useEffect)((()=>{ne(!!g)}),[g]);const[ie,re]=(0,n.useState)(),pe=(0,n.useCallback)((e=>{Z(!0),I(e)}),[I]);(0,n.useImperativeHandle)(t,(()=>({feedbackSubmitDone:()=>{ee(!0),setTimeout((()=>{ne(!1)}),3e3)},feedbackSubmitFailed:()=>{Z(!1)},feedbackOnViewDone:e=>{re((t=>{const a=new Set(t);return a.add(e),a}))}})),[]);const[ue,he]=(0,n.useState)(null),[fe,be]=(0,n.useState)(null),[ge,ve]=(0,n.useState)(!1),xe=(0,n.useRef)(!1),we=!!O;(0,n.useEffect)((()=>{if(we){const e=setTimeout((()=>{xe.current=!0}),1e3);return()=>{clearTimeout(e)}}}),[we]),(0,n.useEffect)((()=>{xe.current&&K&&!ge&&be(K)}),[K,ge]),(0,n.useEffect)((()=>{(0,i.getRuntime)().applyPageTitle(H)}),[H]);const ke=(0,n.useCallback)(((e,t,a)=>{var n;null===(n=P.current)||void 0===n||n.call(P,e,t,a)}),[P]),ye=J[0],Ee=(0,n.useMemo)((()=>{if("user"===(null==ye?void 0:ye.role))return ye.content}),[ye]),Ae=l,Ne=(0,n.useMemo)((()=>({conversationId:l,workspace:Ae,previewUrlTemplate:k,replay:u,showCases:y,exampleProjects:E,humanInput:ke,onShare:N,onTerminate:C,supports:f,activeExpandedViewJobId:ue,setActiveExpandedViewJobId:he,activeToolCallJobId:fe,setActiveToolCallJobId:be,submittingFeedback:Q,submittedFeedback:$,onSubmitFeedback:pe,setShowFeedback:ne,showFeedbackOnView:x,onFeedbackOnView:S,feedbackDoneViews:ie,skipToResults:V,watchAgain:z,tryItOut(){const e=window.open(`${(0,i.getBasePath)().slice(0,-1)}${null!=A?A:"/elevo"}`,"_blank");e&&(e.__elevo_try_it_out={content:Ee})}})),[l,Ae,k,u,y,E,ke,N,C,f,ue,fe,Q,$,pe,x,S,ie,V,z,Ee,A]),Ce=(0,n.useMemo)((()=>({lastToolCallJobId:K,setUserClosedAside:ve})),[K]),Te=(0,n.useRef)(!1),Ie=(0,n.useRef)(!1),je=(0,n.useRef)(null),[Se,_e]=(0,n.useState)(!1);(0,n.useEffect)((()=>{const e=je.current,t=null==e?void 0:e.firstElementChild;if(Ie.current||!e||!t)return;const a=()=>{_e(e.scrollTop+e.clientHeight+24<e.scrollHeight),Te.current&&(Ie.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let n;e.addEventListener("scroll",a);const o=new r.A((()=>{Ie.current||(Te.current=!1,e.scrollTo({top:t.scrollHeight,behavior:"instant"}),clearTimeout(n),n=setTimeout((()=>{Te.current=!0}),100))}));return o.observe(t),()=>{o.disconnect(),e.removeEventListener("scroll",a)}}),[we]);const Oe=(0,n.useCallback)((()=>{const e=je.current;null==e||e.scrollTo({top:null==e?void 0:e.scrollHeight,behavior:"instant"})}),[]),Re=(0,n.useMemo)((()=>fe&&(null==D?void 0:D.get(fe))||null),[fe,D]);return o().createElement(L.j.Provider,{value:Ne},o().createElement(q.Provider,{value:Ce},o().createElement("div",{className:le.container},o().createElement("div",{className:le.header},o().createElement("div",{className:le.left}),o().createElement("h1",null,H),o().createElement("div",{className:le.right},w&&o().createElement(m.Py,{className:le["navbar-switch-ui"],icon:Y.Rq,variant:"mini",title:(0,ce.t)(ce.K.SWITCH_TO_CANVAS),onClick:j}),o().createElement(m.Py,{icon:me,variant:"mini",onClick:N}))),we?o().createElement(o().Fragment,null,o().createElement("div",{className:le.main,ref:je},o().createElement("div",{className:le.narrow},J.map(((e,t,a)=>o().createElement("div",{className:le.message,key:t},"user"===e.role?o().createElement(T,{content:e.content}):o().createElement(B,{jobs:e.jobs,taskState:F,error:e.error,isLatest:t===a.length-1})))),u?(null==O?void 0:O.finished)&&o().createElement(de.A,{finished:!0,ui:"chat"}):te&&("completed"===F||"failed"===F&&v)&&o().createElement(oe.k,{className:le.feedback}))),o().createElement("div",{className:le["scroll-down"],hidden:!Se,onClick:Oe},o().createElement(m.Bj,{lib:"antd",icon:"down"})),(u?null==O||!O.finished:null==f?void 0:f.chat)?o().createElement("div",{className:le.footer},o().createElement("div",{className:le.narrow},u?o().createElement(de.A,null):o().createElement(X.s,{state:F,canChat:M}))):null):o().createElement("div",{className:le["loading-icon"]},o().createElement(m.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))),o().createElement("div",{className:s()(le.aside,{[le.expanded]:!!Re})},Re&&o().createElement(ae,{job:Re})),ue&&o().createElement(G.f,{views:W}),w&&o().createElement("div",{className:s()(se.A.toolbar,le.toolbar)},o().createElement(m.Py,{icon:Y.Rq,variant:"mini",title:(0,ce.t)(ce.K.SWITCH_TO_CANVAS),onClick:j}))))}},76239:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i),l=a(20062),s=a.n(l),c=new URL(a(32360),a.b),d=r()(o()),m=s()(c);d.push([e.id,`ai-portal\\.chat-stream{display:flex;position:relative;width:100%;height:100%;overflow:hidden;background-color:#f3f3f4;background-image:url(${m});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:rgba(0,0,0,0.88);--cruise-canvas-node-width-small:330px;--cruise-canvas-node-width-medium:453px;--cruise-canvas-node-width-large:800px;--cruise-canvas-primary-color:var(--elevo-color-brand);--cruise-canvas-input-background:rgba(255,255,255,0.8);--cruise-canvas-input-box-shadow:0px 1px 0px 0px #ffffff,inset 0px 2px 4px 0px #b3bcf9}.container--IOwk4fR1{display:flex;flex-direction:column;position:relative;flex:1;min-width:0}.header--O9c4lNA3{height:54px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.header--O9c4lNA3 h1{font-weight:500;font-size:14px;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.header--O9c4lNA3 .left--ed9ka1jF,.header--O9c4lNA3 .right--fs8TyVN3{width:56px}.header--O9c4lNA3 .right--fs8TyVN3{display:flex;align-items:center;justify-content:end;gap:8px}.main--KDIjetJs{overflow-y:auto;flex:1;padding:20px 24px}.narrow--xWih9UIb{width:100%;max-width:800px;margin:0 auto}.message--YIXGDQNi + .message--YIXGDQNi{margin-top:40px}.loading-icon--lagcmORP{flex:1;display:flex;align-items:center;justify-content:center;font-size:48px;color:#fff}.footer--aLZ8UWjM{padding:0 20px 24px}.aside--Xjd6To2A{width:0%;height:100%;transition:width 0.2s ease-in-out}.expanded--xZgk3uBF{width:50%}.feedback--YbYylTcK{margin:24px auto 0}.scroll-down--uNre4ZYi{display:flex;align-items:center;justify-content:center;position:absolute;left:50%;bottom:120px;transform:translateX(-50%);width:32px;height:32px;font-size:12px;border-radius:16px;background:#ffffff;box-shadow:0px 4px 8px 0px rgba(0,0,0,0.06);border:1px solid rgba(0,0,0,0.02);cursor:pointer}.scroll-down--uNre4ZYi:hover{box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1)}.toolbar--uiLshJmw{left:20px;bottom:20px}.navbar-switch-ui--hREVJ6zG{display:none}@media (max-width: 1123px){div.toolbar--uiLshJmw{display:none}.navbar-switch-ui--hREVJ6zG{display:block}}`,""]),d.locals={container:"container--IOwk4fR1",header:"header--O9c4lNA3",left:"left--ed9ka1jF",right:"right--fs8TyVN3",main:"main--KDIjetJs",narrow:"narrow--xWih9UIb",message:"message--YIXGDQNi","loading-icon":"loading-icon--lagcmORP",footer:"footer--aLZ8UWjM",aside:"aside--Xjd6To2A",expanded:"expanded--xZgk3uBF",feedback:"feedback--YbYylTcK","scroll-down":"scroll-down--uNre4ZYi",toolbar:"toolbar--uiLshJmw","navbar-switch-ui":"navbar-switch-ui--hREVJ6zG"};const p=d},83090:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),o=a.n(n),i=a(40935),r=a.n(i)()(o());r.push([e.id,".aside--DDIdDtkt{padding:12px 12px 12px 0;height:100%}.box--niuFBiiQ{background:#ffffff;box-shadow:1px 1px 10px 0px rgba(0,10,26,0.1);border-radius:12px;height:100%;display:flex;flex-direction:column}.header--DPl_hrTp{height:52px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,0.15);padding:0 20px}.title--HlE9yRcJ{font-weight:500;font-size:16px;color:#262626}.body--OLKz1zeC{flex:1;min-height:0;padding:20px;display:flex;flex-direction:column}.app--UanK0TGf{flex:1;min-height:0;background:#ffffff;border-radius:9px;border:1px solid #ccd1de;margin-top:16px;overflow:hidden;display:flex;flex-direction:column}.heading--ngRi_rQ4{background:#e6e9f3;color:#5e6472;padding:5px 14px}.content--I2i0y65v{font-size:12px;flex:1;min-height:0;position:relative}.scroller--mLfznC_I{height:100%;overflow-x:hidden;overflow-y:auto;overflow:hidden auto;padding:10px}.scroller--mLfznC_I.loading--U1GWHEp9{display:flex;align-items:center;justify-content:center}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(wrapper){position:static;margin:0}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(pre){background:none!important;padding:0;border-radius:0;border:0}",""]),r.locals={aside:"aside--DDIdDtkt",box:"box--niuFBiiQ",header:"header--DPl_hrTp",title:"title--HlE9yRcJ",body:"body--OLKz1zeC",app:"app--UanK0TGf",heading:"heading--ngRi_rQ4",content:"content--I2i0y65v",scroller:"scroller--mLfznC_I",loading:"loading--U1GWHEp9",editor:"editor--p_Sqs1os","code-block":"code-block--XiUVX7st"};const l=r}}]);
|
|
2
|
+
//# sourceMappingURL=8717.1e5ad2b1.js.map
|