@next-bricks/visual-builder 1.37.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +26 -26
- package/dist/chunks/{2464.b7163b41.js → 2464.676686cc.js} +2 -2
- package/dist/chunks/2464.676686cc.js.map +1 -0
- package/dist/chunks/{main.c8c9b11f.js → main.9f436558.js} +2 -2
- package/dist/chunks/{main.c8c9b11f.js.map → main.9f436558.js.map} +1 -1
- package/dist/chunks/pre-generated-config.ffac69ed.js +2 -0
- package/dist/chunks/pre-generated-config.ffac69ed.js.map +1 -0
- package/dist/examples.json +3 -3
- package/dist/index.f976a0ef.js +2 -0
- package/dist/index.f976a0ef.js.map +1 -0
- package/dist/manifest.json +129 -129
- package/dist/types.json +1246 -1246
- package/package.json +2 -2
- package/dist/chunks/2464.b7163b41.js.map +0 -1
- package/dist/chunks/pre-generated-config.2339bb56.js +0 -2
- package/dist/chunks/pre-generated-config.2339bb56.js.map +0 -1
- package/dist/index.c58723df.js +0 -2
- package/dist/index.c58723df.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[2464,5238],{2464:(e,t,n)=>{var i,a=n(4635),r=n(918),o=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),p=n(8769),h=n.n(p),u=n(1123),m=n(9006),g=n(7180),v=n(9765),b=n(8013),A=n(3373),f=n.n(A);let y,w,k,E,x,N,C,M,T,L,I,S,O,_,R;const W=(0,m.wrapBrick)("eo-icon"),{defineElement:D,property:P,event:$}=(0,u.createDecorators)();let B;var U=new WeakMap,F=new WeakMap,V=new WeakMap,j=new WeakMap,z=new WeakSet,X=new WeakMap,K=new WeakMap,J=new WeakMap;class H extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,z),(0,r.A)(this,U,w(this)),(0,r.A)(this,F,(k(this),E(this))),(0,r.A)(this,V,(x(this),N(this))),(0,r.A)(this,j,(C(this),M(this))),(0,r.A)(this,X,(I(this),e=>{e!==this.active&&(this.active=e,(0,s.A)(z,this,T).emit(e))})),(0,r.A)(this,K,S(this)),(0,r.A)(this,J,(R(this),()=>{(0,s.A)(z,this,O).emit()}))}get titleLabel(){return(0,c.A)(U,this)}set titleLabel(e){(0,l.A)(U,this,e)}get active(){return(0,c.A)(F,this)}set active(e){(0,l.A)(F,this,e)}get badge(){return(0,c.A)(V,this)}set badge(e){(0,l.A)(V,this,e)}render(){return h().createElement(q,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,c.A)(X,this),onFirstActivated:(0,c.A)(J,this)})}}function q(e){let{titleLabel:t,active:n,badge:i,onActiveChange:a,onFirstActivated:r}=e;const[o,s]=(0,p.useState)(n),[l,c]=(0,p.useState)(!1);(0,p.useEffect)((()=>{s(n)}),[n]),(0,p.useEffect)((()=>{null==a||a(o)}),[o,a]);const d=(0,p.useCallback)((()=>{s((e=>!e)),l||o||(c(!0),null==r||r())}),[l,o,r]),u=(0,p.useRef)(),[m,g]=(0,p.useState)(!1),v=(0,p.useMemo)((()=>(0,b.G)((()=>{g(u.current.scrollTop>0)}))),[]);return h().createElement("div",{className:f()("pane",{scrolled:m})},h().createElement("div",{className:"pane-header",tabIndex:0,onClick:d},h().createElement("div",{className:"pane-title"},h().createElement("span",{className:"title-icon"},o?h().createElement(W,{lib:"antd",theme:"outlined",icon:"down"}):h().createElement(W,{lib:"antd",theme:"outlined",icon:"right"})),h().createElement("div",{className:"title-label"},t),h().createElement("slot",{name:"title"})),h().createElement("slot",{name:"actions"}),i&&h().createElement("div",{className:"badge"},i),h().createElement("div",{className:"pane-scroll-shadow"})),h().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:v,ref:u},h().createElement("slot",null,h().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}i=H,({e:[w,k,E,x,N,C,M,T,L,I,S,O,_,R],c:[B,y]}=(0,d.A)(i,[D("visual-builder.workbench-pane",{styleTexts:[g.A,v.A]})],[[P(),1,"titleLabel"],[P({type:Boolean}),1,"active"],[P({type:Number}),1,"badge"],[$({type:"active.change"}),1,"activeChangeEvent",e=>(0,c.A)(j,e),(e,t)=>(0,l.A)(j,e,t)],[$({type:"active.firstActivated"}),1,"activeFirstActivatedEvent",e=>(0,c.A)(K,e),(e,t)=>(0,l.A)(K,e,t)]],0,(e=>J.has((0,o.A)(e))),m.ReactNextElement)),y();var Y,G=n(4586),Z=n(2150);let Q,ee,te;const{defineElement:ne,property:ie}=(0,u.createDecorators)();let ae;var re=new WeakMap,oe=new WeakMap,se=new WeakMap,le=new WeakMap;class ce extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,re,ee(this)),(0,r.A)(this,oe,(te(this),()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")})),(0,r.A)(this,se,(()=>{const e=(0,c.A)(oe,this).call(this).assignedNodes();for(const n of e){var t;n.active?n.style.flex=String(null!==(t=n.activeFlex)&&void 0!==t?t:"1"):n.style.flex="initial"}})),(0,r.A)(this,le,(e=>{const t=e.target.assignedNodes();for(const e of t)e.addEventListener("active.change",(0,c.A)(se,this))})),(0,G.A)(this,"refCallback",(()=>{(0,c.A)(se,this).call(this);const e=(0,c.A)(oe,this).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,c.A)(le,this).call(this,e)}))}))}get titleLabel(){return(0,c.A)(re,this)}set titleLabel(e){(0,l.A)(re,this,e)}render(){return h().createElement(de,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function de(e){let{titleLabel:t,refCallback:n}=e;return h().createElement("div",{className:"sidebar",ref:n},h().createElement("div",{className:"title-container"},h().createElement("div",{className:"title-label"},t),h().createElement("slot",{name:"titleToolbar"})),h().createElement("div",{className:"pane-container"},h().createElement("slot",null)))}Y=ce,({e:[ee,te],c:[ae,Q]}=(0,d.A)(Y,[ne("visual-builder.workbench-sidebar",{styleTexts:[Z.A]})],[[ie(),1,"titleLabel"]],0,void 0,m.ReactNextElement)),Q();var pe=n(2591),he=n.n(pe),ue=n(1740),me=n.n(ue),ge=n(8128),ve=n.n(ge),be=n(855),Ae=n.n(be),fe=n(3051),ye=n.n(fe),we=n(3656),ke=n.n(we),Ee=n(2984),xe={};xe.styleTagTransform=ke(),xe.setAttributes=Ae(),xe.insert=ve().bind(null,"head"),xe.domAPI=me(),xe.insertStyleElement=ye(),he()(Ee.A,xe),Ee.A&&Ee.A.locals&&Ee.A.locals;var Ne,Ce=n(5292);let Me,Te,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be;const{defineElement:Ue,property:Fe}=(0,u.createDecorators)(),Ve=(0,m.wrapBrick)("eo-link"),je=(0,m.wrapBrick)("eo-icon"),ze=(0,m.wrapBrick)("eo-tooltip");let Xe;var Ke=new WeakMap,Je=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ge=new WeakMap;class Ze extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Ke,Te(this)),(0,r.A)(this,Je,(Le(this),Ie(this))),(0,r.A)(this,He,(Se(this),Oe(this))),(0,r.A)(this,qe,(_e(this),Re(this))),(0,r.A)(this,Ye,(We(this),De(this))),(0,r.A)(this,Ge,(Pe(this),$e(this))),Be(this)}get icon(){return(0,c.A)(Ke,this)}set icon(e){(0,l.A)(Ke,this,e)}get to(){return(0,c.A)(Je,this)}set to(e){(0,l.A)(Je,this,e)}get active(){return(0,c.A)(He,this)}set active(e){(0,l.A)(He,this,e)}get href(){return(0,c.A)(qe,this)}set href(e){(0,l.A)(qe,this,e)}get target(){return(0,c.A)(Ye,this)}set target(e){(0,l.A)(Ye,this,e)}get tooltip(){return(0,c.A)(Ge,this)}set tooltip(e){(0,l.A)(Ge,this,e)}render(){return h().createElement(Qe,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target,tooltip:this.tooltip})}}function Qe(e){let{icon:t,to:n,active:i,href:a,target:r,tooltip:o}=e;return h().createElement(ze,{content:o,placement:"right"},h().createElement(Ve,{className:f()("action",{active:i}),url:n,href:a,target:r},h().createElement(je,t)))}Ne=Ze,({e:[Te,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be],c:[Xe,Me]}=(0,d.A)(Ne,[Ue("visual-builder.workbench-action",{styleTexts:[Ce.A]})],[[Fe({attribute:!1}),1,"icon"],[Fe(),1,"to"],[Fe({type:Boolean}),1,"active"],[Fe(),1,"href"],[Fe(),1,"target"],[Fe(),1,"tooltip"]],0,void 0,m.ReactNextElement)),Me();var et=n(2716),tt=n(63),nt=n(607),it={};it.styleTagTransform=ke(),it.setAttributes=Ae(),it.insert=ve().bind(null,"head"),it.domAPI=me(),it.insertStyleElement=ye(),he()(nt.A,it),nt.A&&nt.A.locals&&nt.A.locals;var at,rt=n(3430);let ot,st,lt,ct,dt;const pt=(0,m.wrapBrick)("visual-builder.workbench-action"),{defineElement:ht,property:ut}=(0,u.createDecorators)();let mt;var gt=new WeakMap,vt=new WeakMap;class bt extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,gt,st(this)),(0,r.A)(this,vt,(lt(this),ct(this))),dt(this)}get appId(){return(0,c.A)(gt,this)}set appId(e){(0,l.A)(gt,this,e)}get menu(){return(0,c.A)(vt,this)}set menu(e){(0,l.A)(vt,this,e)}render(){return h().createElement(yt,{appId:this.appId,menu:this.menu})}}let At;at=bt,({e:[st,lt,ct,dt],c:[mt,ot]}=(0,d.A)(at,[ht("visual-builder.workbench-action-list",{styleTexts:[rt.A]})],[[ut(),1,"appId"],[ut({attribute:!1}),1,"menu"]],0,void 0,m.ReactNextElement)),ot();const ft=new Map;function yt(e){var t;let{appId:n,menu:i}=e;const a=(0,et.getHistory)(),[r,o]=(0,p.useState)(),[s,l]=(0,p.useState)(a.location);return(0,p.useEffect)((()=>{const e=a.listen((e=>{l(e)}));return e}),[a]),(0,p.useEffect)((()=>{At||(At=n),At!==n&&(ft.clear(),At=n)}),[n]),(0,p.useEffect)((()=>{var e;const{pathname:t,search:n}=s,{selectedKeys:a}=(0,tt.LP)(null!==(e=null==i?void 0:i.menuItems)&&void 0!==e?e:[],t,n,"");o(Number(a[0]))}),[i,s]),h().createElement(h().Fragment,null,null==i||null===(t=i.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){let n=e.to;return r!==t&&ft.has(t)&&(n=ft.get(t)),h().createElement(pt,{key:t,icon:e.icon,to:n,href:e.href,target:e.target,tooltip:e.text,active:r===t,onClick:()=>(e=>{e.href||ft.set(r,`${s.pathname}${s.search}`)})(e)})}})).filter(Boolean))}var wt,kt=n(1030),Et=n(4940),xt=n(7758),Nt=n(9406),Ct=n(675),Mt=n(7995),Tt=n(6275);let Lt,It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,Vt,jt,zt,Xt,Kt,Jt,Ht,qt,Yt,Gt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,hn,un,mn,gn,vn,bn,An,fn,yn,wn,kn,En,xn,Nn,Cn,Mn,Tn,Ln,In,Sn,On;function _n(e){return e.key}n(6477);const{defineElement:Rn,property:Wn,event:Dn}=(0,u.createDecorators)();let Pn;var $n=new WeakMap,Bn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Vn=new WeakMap,jn=new WeakMap,zn=new WeakMap,Xn=new WeakMap,Kn=new WeakMap,Jn=new WeakMap,Hn=new WeakMap,qn=new WeakMap,Yn=new WeakMap,Gn=new WeakMap,Zn=new WeakMap,Qn=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ii=new WeakSet,ai=new WeakMap,ri=new WeakMap,oi=new WeakMap,si=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,pi=new WeakMap,hi=new WeakMap;class ui extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ii),(0,r.A)(this,$n,It(this)),(0,r.A)(this,Bn,(St(this),Ot(this))),(0,r.A)(this,Un,(_t(this),Rt(this))),(0,r.A)(this,Fn,(Wt(this),Dt(this))),(0,r.A)(this,Vn,(Pt(this),$t(this))),(0,r.A)(this,jn,(Bt(this),Ut(this))),(0,r.A)(this,zn,(Ft(this),Vt(this))),(0,r.A)(this,Xn,(jt(this),zt(this))),(0,r.A)(this,Kn,(Xt(this),Kt(this))),(0,r.A)(this,Jn,(Jt(this),Ht(this))),(0,r.A)(this,Hn,(qt(this),Yt(this))),(0,r.A)(this,qn,(Gt(this),Zt(this))),(0,r.A)(this,Yn,(Qt(this),en(this))),(0,r.A)(this,Gn,(tn(this),nn(this))),(0,r.A)(this,Zn,(an(this),rn(this))),(0,r.A)(this,Qn,(on(this),sn(this))),(0,r.A)(this,ei,(ln(this),cn(this))),(0,r.A)(this,ti,(dn(this),pn(this))),(0,r.A)(this,ni,(hn(this),un(this))),(0,r.A)(this,ai,(vn(this),e=>{(0,s.A)(ii,this,mn).emit(e)})),(0,r.A)(this,ri,bn(this)),(0,r.A)(this,oi,(yn(this),e=>()=>{(0,s.A)(ii,this,An).emit(e.data)})),(0,r.A)(this,si,wn(this)),(0,r.A)(this,li,(xn(this),e=>{(0,s.A)(ii,this,kn).emit(e)})),(0,r.A)(this,ci,Nn(this)),(0,r.A)(this,di,(Tn(this),e=>t=>{t.preventDefault(),(0,s.A)(ii,this,Cn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,r.A)(this,pi,Ln(this)),(0,r.A)(this,hi,(On(this),(e,t)=>{(0,s.A)(ii,this,In).emit({nodeId:e,collapsed:t})}))}get nodes(){return(0,c.A)($n,this)}set nodes(e){(0,l.A)($n,this,e)}get actions(){return(0,c.A)(Bn,this)}set actions(e){(0,l.A)(Bn,this,e)}get actionsHidden(){return(0,c.A)(Un,this)}set actionsHidden(e){(0,l.A)(Un,this,e)}get placeholder(){return(0,c.A)(Fn,this)}set placeholder(e){(0,l.A)(Fn,this,e)}get isTransformName(){return(0,c.A)(Vn,this)}set isTransformName(e){(0,l.A)(Vn,this,e)}get searchPlaceholder(){return(0,c.A)(jn,this)}set searchPlaceholder(e){(0,l.A)(jn,this,e)}get noSearch(){return(0,c.A)(zn,this)}set noSearch(e){(0,l.A)(zn,this,e)}get activeKey(){return(0,c.A)(Xn,this)}set activeKey(e){(0,l.A)(Xn,this,e)}get showMatchedNodeOnly(){return(0,c.A)(Kn,this)}set showMatchedNodeOnly(e){(0,l.A)(Kn,this,e)}get matchNodeDataFields(){return(0,c.A)(Jn,this)}set matchNodeDataFields(e){(0,l.A)(Jn,this,e)}get fixedActionsFor(){return(0,c.A)(Hn,this)}set fixedActionsFor(e){(0,l.A)(Hn,this,e)}get collapsible(){return(0,c.A)(qn,this)}set collapsible(e){(0,l.A)(qn,this,e)}get collapsedNodes(){return(0,c.A)(Yn,this)}set collapsedNodes(e){(0,l.A)(Yn,this,e)}get allowDrag(){return(0,c.A)(Gn,this)}set allowDrag(e){(0,l.A)(Gn,this,e)}get allowDragToRoot(){return(0,c.A)(Zn,this)}set allowDragToRoot(e){(0,l.A)(Zn,this,e)}get allowDragToInside(){return(0,c.A)(Qn,this)}set allowDragToInside(e){(0,l.A)(Qn,this,e)}get nodeKey(){return(0,c.A)(ei,this)}set nodeKey(e){(0,l.A)(ei,this,e)}get skipNotify(){return(0,c.A)(ti,this)}set skipNotify(e){(0,l.A)(ti,this,e)}render(){return h().createElement(Et.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,c.A)(ai,this)}},h().createElement(Nt.N.Provider,{value:{activeKey:this.activeKey,basePaddingLeft:5,showMatchedNodeOnly:this.showMatchedNodeOnly,isTransformName:this.isTransformName,fixedActionsFor:this.fixedActionsFor,nodeKey:this.nodeKey,collapsible:this.collapsible,collapsedNodes:this.collapsedNodes,getCollapsedId:_n,onNodeToggle:(0,c.A)(hi,this),skipNotify:this.skipNotify,clickFactory:(0,c.A)(oi,this),contextMenuFactory:(0,c.A)(di,this),matchNode:(e,t)=>{var n;return(0,Ct.U)(e.name,t)||!(null===(n=this.matchNodeDataFields)||void 0===n||!n.length)&&(0,Ct.U)("*"===this.matchNodeDataFields?e.data:(0,kt.pick)(e.data,this.matchNodeDataFields),t)}}},h().createElement(xt.cU,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,c.A)(li,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}wt=ui,({e:[It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,Vt,jt,zt,Xt,Kt,Jt,Ht,qt,Yt,Gt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,hn,un,mn,gn,vn,bn,An,fn,yn,wn,kn,En,xn,Nn,Cn,Mn,Tn,Ln,In,Sn,On],c:[Pn,Lt]}=(0,d.A)(wt,[Rn("visual-builder.workbench-tree",{styleTexts:[Mt.A,Tt.A]})],[[Wn({attribute:!1}),1,"nodes"],[Wn({attribute:!1}),1,"actions"],[Wn({type:Boolean}),1,"actionsHidden"],[Wn(),1,"placeholder"],[Wn({type:Boolean}),1,"isTransformName"],[Wn(),1,"searchPlaceholder"],[Wn({type:Boolean}),1,"noSearch"],[Wn({attribute:!1}),1,"activeKey"],[Wn({type:Boolean}),1,"showMatchedNodeOnly"],[Wn({attribute:!1}),1,"matchNodeDataFields"],[Wn({attribute:!1}),1,"fixedActionsFor"],[Wn({type:Boolean}),1,"collapsible"],[Wn({attribute:!1}),1,"collapsedNodes"],[Wn({type:Boolean}),1,"allowDrag"],[Wn({type:Boolean}),1,"allowDragToRoot"],[Wn({type:Boolean}),1,"allowDragToInside"],[Wn({type:String}),1,"nodeKey"],[Wn({type:Boolean}),1,"skipNotify"],[Dn({type:"action.click"}),1,"actionClickEvent",e=>(0,c.A)(ni,e),(e,t)=>(0,l.A)(ni,e,t)],[Dn({type:"node.click"}),1,"nodeClickEvent",e=>(0,c.A)(ri,e),(e,t)=>(0,l.A)(ri,e,t)],[Dn({type:"node.drop"}),1,"nodeDropEvent",e=>(0,c.A)(si,e),(e,t)=>(0,l.A)(si,e,t)],[Dn({type:"context.menu"}),1,"nodeContextMenuEvent",e=>(0,c.A)(ci,e),(e,t)=>(0,l.A)(ci,e,t)],[Dn({type:"node.toggle"}),1,"nodeToggleEvent",e=>(0,c.A)(pi,e),(e,t)=>(0,l.A)(pi,e,t)]],0,(e=>hi.has((0,o.A)(e))),m.ReactNextElement)),Lt();var mi=n(155),gi=n.n(mi),vi=n(1361),bi=n(9704);let Ai=function(e){return e.LOAD_MORE="LOAD_MORE",e.LOADING="LOADING",e.NO_DATA="NO_DATA",e.NODE="NODE",e.ADD="ADD",e.EDIT="EDIT",e.DELETE="DELETE",e.IMPORT="IMPORT",e.CLONE="CLONE",e.APPEND_RELATION="APPEND_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REMOVE_RELATION="REMOVE_RELATION",e.ROLLBACK="ROLLBACK",e.ROLLBACK_ALL="ROLLBACK_ALL",e.ADD_FULL="ADD_FULL",e.EDIT_FULL="EDIT_FULL",e.DELETE_FULL="DELETE_FULL",e.IMPORT_FULL="IMPORT_FULL",e.CLONE_FULL="CLONE_FULL",e.APPEND_RELATION_FULL="APPEND_RELATION_FULL",e.UPDATE_RELATION_FULL="UPDATE_RELATION_FULL",e.REMOVE_RELATION_FULL="REMOVE_RELATION_FULL",e.ROLLBACK_FULL="ROLLBACK_FULL",e.ROLLBACK_ALL_FULL="ROLLBACK_ALL_FULL",e.PROJECT="PROJECT",e.USER="USER",e.PERMISSION="PERMISSION",e.BRICK="BRICK",e.ROUTE="ROUTE",e.TEMPLATE="TEMPLATE",e.SNIPPET="SNIPPET",e.I18N="I18N",e.IMAGE="IMAGE",e.FUNCTION="FUNCTION",e.MENU="MENU",e.MENU_ITEM="MENU_ITEM",e.WORKFLOW="WORKFLOW",e}({});const fi="bricks/visual-builder/workbench-history-action";var yi=n(4107),wi=n(9733);const ki={add:`${fi}:${Ai.ADD}`,edit:`${fi}:${Ai.EDIT}`,delete:`${fi}:${Ai.DELETE}`,batch_delete:`${fi}:${Ai.DELETE}`,import:`${fi}:${Ai.IMPORT}`,clone:`${fi}:${Ai.CLONE}`,append_relation:`${fi}:${Ai.APPEND_RELATION}`,update_relation:`${fi}:${Ai.UPDATE_RELATION}`,remove_relation:`${fi}:${Ai.REMOVE_RELATION}`,rollback:`${fi}:${Ai.ROLLBACK}`,rollback_all:`${fi}:${Ai.ROLLBACK_ALL}`},Ei={add:`${fi}:${Ai.ADD_FULL}`,edit:`${fi}:${Ai.EDIT_FULL}`,delete:`${fi}:${Ai.DELETE_FULL}`,batch_delete:`${fi}:${Ai.DELETE_FULL}`,import:`${fi}:${Ai.IMPORT_FULL}`,clone:`${fi}:${Ai.CLONE_FULL}`,append_relation:`${fi}:${Ai.APPEND_RELATION_FULL}`,update_relation:`${fi}:${Ai.UPDATE_RELATION_FULL}`,remove_relation:`${fi}:${Ai.REMOVE_RELATION_FULL}`,rollback:`${fi}:${Ai.ROLLBACK_FULL}`,rollback_all:`${fi}:${Ai.ROLLBACK_ALL_FULL}`},xi={project:`${fi}:${Ai.PROJECT}`,userGroup:`${fi}:${Ai.USER}`,permission:`${fi}:${Ai.PERMISSION}`,brick:`${fi}:${Ai.BRICK}`,route:`${fi}:${Ai.ROUTE}`,template:`${fi}:${Ai.TEMPLATE}`,snippet:`${fi}:${Ai.SNIPPET}`,i18n:`${fi}:${Ai.I18N}`,image:`${fi}:${Ai.IMAGE}`,function:`${fi}:${Ai.FUNCTION}`,menu:`${fi}:${Ai.MENU}`,menuItem:`${fi}:${Ai.MENU_ITEM}`,workflow:`${fi}:${Ai.WORKFLOW}`},Ni={PROJECT_MICRO_APP:`${fi}:${Ai.PROJECT}`,"MICRO_APP_USER_GROUP@EASYOPS":`${fi}:${Ai.USER}`,MICRO_APP_RESOURCE_PERMISSION:`${fi}:${Ai.PERMISSION}`,STORYBOARD_BRICK:`${fi}:${Ai.BRICK}`,STORYBOARD_ROUTE:`${fi}:${Ai.ROUTE}`,STORYBOARD_TEMPLATE:`${fi}:${Ai.TEMPLATE}`,STORYBOARD_SNIPPET:`${fi}:${Ai.SNIPPET}`,STORYBOARD_I18N:`${fi}:${Ai.I18N}`,MICRO_APP_RESOURCE_IMAGE:`${fi}:${Ai.IMAGE}`,STORYBOARD_FUNCTION:`${fi}:${Ai.FUNCTION}`,MICRO_APP_RESOURCE_MENU:`${fi}:${Ai.MENU}`,MICRO_APP_RESOURCE_MENU_ITEM:`${fi}:${Ai.MENU_ITEM}`,"WORKFLOW_DEF@EASYOPS":`${fi}:${Ai.WORKFLOW}`};function Ci(e){var t,n,i,a,r,o,s,l,c,d,p,h,u,m,g,v,b;const A="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",f=wi.i18n.t(null!==(t=xi[e.category])&&void 0!==t?t:e.category),y=wi.i18n.t(null!==(n=ki[A])&&void 0!==n?n:A),w=wi.i18n.t(null!==(i=Ni[null===(a=e.abstract)||void 0===a?void 0:a.leftObjectId])&&void 0!==i?i:null===(r=e.abstract)||void 0===r?void 0:r.leftObjectId),k=wi.i18n.t(null!==(o=Ni[null===(s=e.abstract)||void 0===s?void 0:s.rightObjectId])&&void 0!==o?o:null===(l=e.abstract)||void 0===l?void 0:l.rightObjectId),E=Mi(null===(c=e.abstract)||void 0===c?void 0:c.nodes,null===(d=e.abstract)||void 0===d?void 0:d.nodesCount),x=Mi(null===(p=e.abstract)||void 0===p?void 0:p.leftNodes,null===(h=e.abstract)||void 0===h?void 0:h.leftNodesCount),N=Mi(null===(u=e.abstract)||void 0===u?void 0:u.rightNodes,null===(m=e.abstract)||void 0===m?void 0:m.rightNodesCount),C="rollback"===A?Ci(e.rollBackIdInfo).abstract:null;return{category:f,action:y,leftObjectId:w,rightObjectId:k,nodes:E,leftNodes:x,rightNodes:N,abstract:wi.i18n.t(null!==(g=Ei[A])&&void 0!==g?g:A,{category:f,nodes:E,leftNodes:x,rightNodes:N,nodeChanges:null===(v=e.abstract)||void 0===v||null===(v=v.nodeChanges)||void 0===v?void 0:v.join(", "),relationChanges:null===(b=e.abstract)||void 0===b||null===(b=b.relationChanges)||void 0===b?void 0:b.join(", "),leftObjectId:w,rightObjectId:k,rollbackAbstract:C}),rollbackAbstract:C}}function Mi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return wi.i18n.t(`${fi}:${Ai.NODE}`,{nodes:e.join(n),context:t>e.length?"ellipsis":void 0,count:t})}var Ti;let Li,Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,Vi,ji,zi,Xi;(0,bi.initializeReactI18n)(fi,{en:{LOAD_MORE:"Load more",LOADING:"Loading",NO_DATA:"No data",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }} etc., a total of {{ count }} items",ADD:"Add node",EDIT:"Edit node",DELETE:"Delete node",IMPORT:"Batch import node",CLONE:"Clone node",APPEND_RELATION:"Append Relation",UPDATE_RELATION:"Update Relation",REMOVE_RELATION:"Remove Relation",ROLLBACK:"Rollback",ROLLBACK_ALL:"Rollback all operations",ADD_FULL:"Add {{ category }} ({{ nodes }})",EDIT_FULL:"Edit {{ nodeChanges }} of {{ category }} ({{ nodes }})",DELETE_FULL:"Delete {{ category }} ({{ nodes }})",IMPORT_FULL:"Batch Import {{ category }} ({{ nodes }})",CLONE_FULL:"Clone {{ category }} ({{ nodes }})",APPEND_RELATION_FULL:"Append the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",UPDATE_RELATION_FULL:"Update the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",REMOVE_RELATION_FULL:"Remove the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",ROLLBACK_FULL:"Rollback to [{{ rollbackAbstract }}]",ROLLBACK_ALL_FULL:"Rollback all operations",PROJECT:"Project",USER:"User Group",PERMISSION:"Permission",BRICK:"Brick",ROUTE:"Route",TEMPLATE:"Template",SNIPPET:"Snippet",I18N:"I18N",IMAGE:"Image",FUNCTION:"Function",MENU:"Menu",MENU_ITEM:"Menu item",WORKFLOW:"Workflow"},zh:{LOAD_MORE:"加载更多",LOADING:"加载中",NO_DATA:"没有数据",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }}等共{{ count }}项",ADD:"新增节点",EDIT:"编辑节点",DELETE:"删除节点",IMPORT:"批量导入节点",CLONE:"克隆节点",APPEND_RELATION:"添加关系",UPDATE_RELATION:"更新关系",REMOVE_RELATION:"移除关系",ROLLBACK:"回滚",ROLLBACK_ALL:"回滚全部操作",ADD_FULL:"新增{{ category }}({{ nodes }})",EDIT_FULL:"编辑{{ category }}({{ nodes }})的 {{ nodeChanges }}",DELETE_FULL:"删除{{ category }}({{ nodes }})",IMPORT_FULL:"批量导入{{ category }}({{ nodes }})",CLONE_FULL:"克隆{{ category }}({{ nodes }})",APPEND_RELATION_FULL:"添加{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",UPDATE_RELATION_FULL:"更新{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",REMOVE_RELATION_FULL:"移除{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",ROLLBACK_FULL:"回滚到【{{ rollbackAbstract }}】",ROLLBACK_ALL_FULL:"回滚全部操作",PROJECT:"项目",USER:"用户组",PERMISSION:"权限点",BRICK:"构件",ROUTE:"路由",TEMPLATE:"模版",SNIPPET:"片段",I18N:"国际化",IMAGE:"图片",FUNCTION:"函数",MENU:"菜单",MENU_ITEM:"菜单项",WORKFLOW:"工作流"}});const{defineElement:Ki,property:Ji,event:Hi}=(0,u.createDecorators)(),qi=(0,m.wrapBrick)("eo-button"),Yi=(0,m.wrapBrick)("eo-link"),Gi=(0,m.wrapBrick)("eo-icon"),Zi=(0,m.wrapBrick)("eo-easyops-avatar"),Qi=(0,m.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});let ea;var ta=new WeakMap,na=new WeakMap,ia=new WeakMap,aa=new WeakSet,ra=new WeakMap,oa=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap;class da extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,aa),(0,r.A)(this,ta,Ii(this)),(0,r.A)(this,na,(Si(this),Oi(this))),(0,r.A)(this,ia,(_i(this),Ri(this))),(0,r.A)(this,ra,(Pi(this),e=>{(0,s.A)(aa,this,Wi).emit(e)})),(0,r.A)(this,oa,$i(this)),(0,r.A)(this,sa,(Fi(this),e=>{(0,s.A)(aa,this,Bi).emit(e)})),(0,r.A)(this,la,Vi(this)),(0,r.A)(this,ca,(Xi(this),()=>{(0,s.A)(aa,this,ji).emit()}))}get appId(){return(0,c.A)(ta,this)}set appId(e){(0,l.A)(ta,this,e)}get projectId(){return(0,c.A)(na,this)}set projectId(e){(0,l.A)(na,this,e)}render(){return h().createElement(pa,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,c.A)(ra,this),onRollback:(0,c.A)(sa,this),onRollbackAll:(0,c.A)(ca,this)})}}function pa(e){const{appId:t,onHistoryItemClick:n,onRollback:i,onRollbackAll:a}=e,{t:r}=(0,bi.useTranslation)(fi),[o,s]=(0,p.useState)(!1),[l,c]=(0,p.useState)(!0),[d,u]=(0,p.useState)(!1),[m,g]=(0,p.useState)([]),v=(0,p.useRef)(""),b=e=>{s(!0),(0,yi.R)(t,{ts:v.current,limit:20}).then((t=>{g((n=>{const i=t.list.map((e=>({...e,translation:Ci(e)})));return e?i:n.concat(i)})),v.current=t.ts,u(t.list.length<20),c(t.list.length<20)})).catch((e=>{(0,et.handleHttpError)(e)})).finally((()=>{s(!1)}))};return h().createElement(Qi,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",onBeforeVisibleChange:e=>{e.detail&&(c(!0),u(!1),g([]),v.current="",b(!0))}},h().createElement(qi,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),h().createElement("div",null,h().createElement("div",{className:"history-title"},"History"),h().createElement("div",{className:"history-list"},m.length?h().createElement(h().Fragment,null,m.map(((e,t)=>h().createElement(ha,{key:`${e.uniqueKey}-${e.ts}`,data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:n,onRollback:i}))),!l&&h().createElement("span",{className:"load-more-container"},h().createElement(Yi,{className:"load-more",disabled:o,onClick:()=>b()},r(Ai.LOAD_MORE))),d&&h().createElement("span",{className:"end-container"},"The End",h().createElement(Gi,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>a()}))):h().createElement("div",{className:"empty"},r(o?Ai.LOADING:Ai.NO_DATA))),h().createElement("slot",null)))}function ha(e){const{data:t,enableRollback:n,current:i,onHistoryItemClick:a,onRollback:r}=e,o=gi()(Number(t.ts)/1e6),s=gi().duration(o.diff(gi()())),l=s.days()<=-1?o.format("YYYY-MM-DD HH:mm:ss"):s.humanize(!0,{ss:0,s:60,m:60,h:24});return h().createElement("div",{className:"item-container"},h().createElement("div",{className:"item-title"},h().createElement("div",{className:"title-left",onClick:()=>a({...t,enableRollback:n})},h().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),i&&h().createElement("div",{className:"branch"},"(current)")),h().createElement("div",{className:"title-right"},n&&h().createElement(Gi,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>r(t)}))),h().createElement("div",{className:"item-info"},h().createElement(Zi,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),h().createElement("div",{className:"time"},l),h().createElement("div",{className:"operator"},t.user)))}Ti=da,({e:[Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,Vi,ji,zi,Xi],c:[ea,Li]}=(0,d.A)(Ti,[Ki("visual-builder.workbench-history-action",{styleTexts:[vi.A]})],[[Ji(),1,"appId"],[Ji(),1,"projectId"],[Hi({type:"history.item.click"}),1,"historyItemClickEvent",e=>(0,c.A)(ia,e),(e,t)=>(0,l.A)(ia,e,t)],[Hi({type:"rollback"}),1,"rollbackEvent",e=>(0,c.A)(oa,e),(e,t)=>(0,l.A)(oa,e,t)],[Hi({type:"rollback.all"}),1,"rollbackAllEvent",e=>(0,c.A)(la,e),(e,t)=>(0,l.A)(la,e,t)]],0,(e=>ca.has((0,o.A)(e))),m.ReactNextElement)),Li();var ua,ma=n(2381);let ga,va,ba,Aa,fa,ya,wa,ka,Ea,xa,Na,Ca,Ma,Ta,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,Va,ja,za,Xa,Ka,Ja,Ha,qa,Ya,Ga,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,hr,ur;const{defineElement:mr,property:gr,event:vr}=(0,u.createDecorators)(),br=(0,m.wrapBrick)("eo-icon"),Ar=(0,m.wrapBrick)("eo-tooltip"),fr=new Set;let yr;var wr=new WeakMap,kr=new WeakMap,Er=new WeakMap,xr=new WeakMap,Nr=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,Tr=new WeakMap,Lr=new WeakMap,Ir=new WeakSet,Sr=new WeakMap,Or=new WeakMap,_r=new WeakMap,Rr=new WeakMap,Wr=new WeakMap,Dr=new WeakMap,Pr=new WeakMap,$r=new WeakMap,Br=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,Vr=new WeakMap,jr=new WeakMap,zr=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,Jr=new WeakMap;class Hr extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ir),(0,r.A)(this,wr,va(this)),(0,r.A)(this,kr,(ba(this),Aa(this))),(0,r.A)(this,Er,(fa(this),ya(this))),(0,r.A)(this,xr,(wa(this),ka(this))),(0,r.A)(this,Nr,(Ea(this),xa(this))),(0,r.A)(this,Cr,(Na(this),Ca(this))),(0,r.A)(this,Mr,(Ma(this),Ta(this))),(0,r.A)(this,Tr,(La(this),Ia(this))),(0,r.A)(this,Lr,(Sa(this),Oa(this))),(0,r.A)(this,Sr,(Wa(this),e=>{(0,s.A)(Ir,this,_a).emit(e)})),(0,r.A)(this,Or,Da(this)),(0,r.A)(this,_r,(Ba(this),e=>{(0,s.A)(Ir,this,Pa).emit(e)})),(0,r.A)(this,Rr,Ua(this)),(0,r.A)(this,Wr,(ja(this),()=>{(0,s.A)(Ir,this,Fa).emit()})),(0,r.A)(this,Dr,za(this)),(0,r.A)(this,Pr,(Ja(this),()=>{(0,s.A)(Ir,this,Xa).emit()})),(0,r.A)(this,$r,Ha(this)),(0,r.A)(this,Br,(Ga(this),e=>{(0,s.A)(Ir,this,qa).emit(e)})),(0,r.A)(this,Ur,Za(this)),(0,r.A)(this,Fr,(tr(this),()=>{(0,s.A)(Ir,this,Qa).emit()})),(0,r.A)(this,Vr,nr(this)),(0,r.A)(this,jr,(rr(this),e=>{(0,s.A)(Ir,this,ir).emit(e)})),(0,r.A)(this,zr,or(this)),(0,r.A)(this,Xr,(cr(this),e=>{(0,s.A)(Ir,this,sr).emit(e)})),(0,r.A)(this,Kr,dr(this)),(0,r.A)(this,Jr,(ur(this),e=>{(0,s.A)(Ir,this,pr).emit(e)}))}get label(){return(0,c.A)(wr,this)}set label(e){(0,l.A)(wr,this,e)}get type(){return(0,c.A)(kr,this)}set type(e){(0,l.A)(kr,this,e)}get external(){return(0,c.A)(Er,this)}set external(e){(0,l.A)(Er,this,e)}get subNodes(){return(0,c.A)(xr,this)}set subNodes(e){(0,l.A)(xr,this,e)}get active(){return(0,c.A)(Nr,this)}set active(e){(0,l.A)(Nr,this,e)}get notSynced(){return(0,c.A)(Cr,this)}set notSynced(e){(0,l.A)(Cr,this,e)}get disableChildAppend(){return(0,c.A)(Mr,this)}set disableChildAppend(e){(0,l.A)(Mr,this,e)}get autoFocusOnce(){return(0,c.A)(Tr,this)}set autoFocusOnce(e){(0,l.A)(Tr,this,e)}render(){return h().createElement(qr,{label:this.label,type:this.type,external:this.external,subNodes:this.subNodes,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,c.A)(Sr,this),onLabelChange:(0,c.A)(_r,this),onNodeClick:(0,c.A)(Wr,this),onNodeDoubleClick:(0,c.A)(Pr,this),onNodeContextMenu:(0,c.A)(Br,this),onChildAppend:(0,c.A)(Fr,this),onExternalClick:(0,c.A)(jr,this),onSubNodeDoubleClick:(0,c.A)(Xr,this),onSubNodeContextMenu:(0,c.A)(Jr,this)})}}function qr(e){var t;let{label:n,type:i,external:a,subNodes:r,autoFocusOnce:o,onLabelEditingChange:s,onLabelChange:l,onNodeClick:c,onNodeDoubleClick:d,onNodeContextMenu:u,onChildAppend:m,onExternalClick:g,onSubNodeDoubleClick:v,onSubNodeContextMenu:b}=e;const A="board"===i?"board":"page",[y,w]=(0,p.useState)(n),[k,E]=(0,p.useState)(!1),x=(0,p.useRef)(!1),[N,C]=(0,p.useState)(!1),M=(0,p.useRef)(null);(0,p.useEffect)((()=>{w(n)}),[n]);const T=(0,p.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),E(!0)}),[]);(0,p.useEffect)((()=>{o&&!fr.has(o)&&(fr.add(o),setTimeout((()=>{E(!0)}),1))}),[o]),(0,p.useEffect)((()=>{var e,t;k&&(null===(e=M.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=M.current)||void 0===t||t.select())}),[k]),(0,p.useEffect)((()=>{x.current?null==s||s(k):x.current=!0}),[k,s]);const L=(0,p.useCallback)((e=>{w(e.target.value)}),[]),I=(0,p.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=M.current)||void 0===n||n.blur()}),[]),S=(0,p.useCallback)((()=>{E(!1),C(!0)}),[]);(0,p.useEffect)((()=>{N&&(null==l||l(y),C(!1))}),[y,l,N]);const O=(0,p.useCallback)((e=>{e.stopPropagation(),null==m||m()}),[m]),_=(0,p.useCallback)((e=>{e.stopPropagation(),null==g||g(a)}),[a,g]),R=(0,p.useCallback)((e=>{e.stopPropagation()}),[]),W=38*Math.max(0,Math.floor((null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0)-3));return h().createElement(h().Fragment,null,h().createElement("div",{className:f()("node",A,{"editing-label":k}),style:{height:"board"===A?70:130+W},onClick:c,onDoubleClick:d,onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==u||u({clientX:e.clientX,clientY:e.clientY})}},h().createElement("input",{className:"label-input",value:y,ref:M,onChange:L,onKeyDown:I,onBlur:S,onDoubleClick:R,onContextMenu:R,onMouseDown:R}),h().createElement("div",{className:"label",onDoubleClick:T,onMouseDown:R},y),"board"===A?h().createElement("div",{className:"icon-container"},h().createElement(br,{lib:"antd",icon:"unordered-list"})):h().createElement("div",{className:"thumbnail-container",style:{height:98+W}},h().createElement("div",{className:"thumbnail-placeholder"},h().createElement(br,{lib:"antd",icon:"ellipsis"})),a&&h().createElement("div",{className:"external",onClick:_,onDoubleClick:R,onMouseDown:R},h().createElement(br,{lib:"antd",icon:"desktop"}),h().createElement("span",{className:"external-label"},a.label)),null!=r&&r.length?h().createElement("div",{className:"sub-nodes"},r.map((e=>h().createElement(Yr,{key:e.id,subNode:e,onSubNodeDoubleClick:v,onSubNodeContextMenu:b})))):null)),h().createElement("div",{className:"add-button",role:"button",onClick:O,onMouseDown:R},h().createElement(br,{lib:"fa",icon:"plus"})))}function Yr(e){let{subNode:t,onSubNodeDoubleClick:n,onSubNodeContextMenu:i}=e;return h().createElement(Ar,{key:t.id,content:t.label},h().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==n||n(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==i||i({node:t,clientX:e.clientX,clientY:e.clientY})}},h().createElement("div",{className:"sub-node-skeleton-title"}),h().createElement("div",{className:"sub-node-skeleton-content"}),h().createElement("div",{className:"sub-node-skeleton-button"})))}ua=Hr,({e:[va,ba,Aa,fa,ya,wa,ka,Ea,xa,Na,Ca,Ma,Ta,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,Va,ja,za,Xa,Ka,Ja,Ha,qa,Ya,Ga,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,hr,ur],c:[yr,ga]}=(0,d.A)(ua,[mr("visual-builder.page-arch-node",{styleTexts:[ma.A]})],[[gr(),1,"label"],[gr(),1,"type"],[gr({attribute:!1}),1,"external"],[gr({attribute:!1}),1,"subNodes"],[gr({type:Boolean,render:!1}),1,"active"],[gr({type:Boolean,render:!1}),1,"notSynced"],[gr({type:Boolean,render:!1}),1,"disableChildAppend"],[gr(),1,"autoFocusOnce"],[vr({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,c.A)(Lr,e),(e,t)=>(0,l.A)(Lr,e,t)],[vr({type:"label.change"}),1,"labelChange",e=>(0,c.A)(Or,e),(e,t)=>(0,l.A)(Or,e,t)],[vr({type:"node.click"}),1,"nodeClick",e=>(0,c.A)(Rr,e),(e,t)=>(0,l.A)(Rr,e,t)],[vr({type:"node.dblclick"}),1,"nodeDoubleClick",e=>(0,c.A)(Dr,e),(e,t)=>(0,l.A)(Dr,e,t)],[vr({type:"node.contextmenu"}),1,"nodeContextMenu",e=>(0,c.A)($r,e),(e,t)=>(0,l.A)($r,e,t)],[vr({type:"child.append"}),1,"childAppend",e=>(0,c.A)(Ur,e),(e,t)=>(0,l.A)(Ur,e,t)],[vr({type:"external.click"}),1,"externalClick",e=>(0,c.A)(Vr,e),(e,t)=>(0,l.A)(Vr,e,t)],[vr({type:"subNode.dblclick"}),1,"subNodeDoubleClick",e=>(0,c.A)(zr,e),(e,t)=>(0,l.A)(zr,e,t)],[vr({type:"subNode.contextmenu"}),1,"subNodeContextMenu",e=>(0,c.A)(Kr,e),(e,t)=>(0,l.A)(Kr,e,t)]],0,(e=>Jr.has((0,o.A)(e))),m.ReactNextElement)),ga();var Gr,Zr=n(3848),Qr=n(6213),eo=n(9492);let to,no,io,ao,ro,oo,so,lo,co;const{method:po,property:ho}=(0,u.createDecorators)();var uo=new WeakMap,mo=new WeakSet,go=new WeakMap,vo=new WeakMap,bo=new WeakMap,Ao=new WeakMap,fo=new WeakMap,yo=new WeakMap;class wo extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,mo),(0,r.A)(this,uo,(to(this),!1)),(0,r.A)(this,go,"normal"),(0,r.A)(this,vo,!1),(0,r.A)(this,bo,no(this)),(0,r.A)(this,Ao,(io(this),ao(this))),(0,r.A)(this,fo,(ro(this),oo(this))),(0,r.A)(this,yo,(so(this),lo(this))),co(this)}get isFormItemElement(){return!0}set validateState(e){(0,eo.A)(mo,No,this,e),this._render()}get validateState(){return(0,s.A)(mo,this,xo)}set notRender(e){this.hidden=e,(0,eo.A)(mo,Eo,this,e),this._render()}get notRender(){return(0,s.A)(mo,this,ko)}get $bindFormItem(){return(0,s.A)(mo,this,Co)}set $bindFormItem(e){(0,eo.A)(mo,Mo,this,e),this._render()}get helpBrick(){return(0,c.A)(bo,this)}set helpBrick(e){(0,l.A)(bo,this,e)}get labelBrick(){return(0,c.A)(Ao,this)}set labelBrick(e){(0,l.A)(Ao,this,e)}get labelCol(){return(0,c.A)(fo,this)}set labelCol(e){(0,l.A)(fo,this,e)}get wrapperCol(){return(0,c.A)(yo,this)}set wrapperCol(e){(0,l.A)(yo,this,e)}setNotRender(e){this.notRender=e}getFormElement(){let e=this;for(;(e=e.parentNode)&&e&&!e.isFormElement;);return e}}function ko(e){return(0,c.A)(uo,e)}function Eo(e,t){(0,l.A)(uo,e,t)}function xo(e){return(0,c.A)(go,e)}function No(e,t){(0,l.A)(go,e,t)}function Co(e){return(0,c.A)(vo,e)}function Mo(e,t){(0,l.A)(vo,e,t)}Gr=wo,[no,io,ao,ro,oo,so,lo,co,to]=(0,d.A)(Gr,[],[[ho({attribute:!1}),1,"helpBrick"],[ho({attribute:!1}),1,"labelBrick"],[ho({attribute:!1}),1,"labelCol"],[ho({attribute:!1}),1,"wrapperCol"],[po(),2,"setNotRender"],[po(),2,"getFormElement"]],0,void 0,m.ReactNextElement).e;var To=n(4244);let Lo=function(e){return e.CONTRACT_OPTIONS_TIPS_PREFIX="CONTRACT_OPTIONS_TIPS_PREFIX",e.CONTRACT_OPTIONS_TIPS_SUFFIX="CONTRACT_OPTIONS_TIPS_SUFFIX",e.CONTRACT_VALIDATE_MESSAGE="CONTRACT_VALIDATE_MESSAGE",e}({});const Io="bricks/visual-builder/contract-select",So={en:{CONTRACT_OPTIONS_TIPS_PREFIX:"Only the first",CONTRACT_OPTIONS_TIPS_SUFFIX:"items are displayed, please search for more results",CONTRACT_VALIDATE_MESSAGE:"Please fill in the correct contract name "},zh:{CONTRACT_OPTIONS_TIPS_PREFIX:"仅展示前",CONTRACT_OPTIONS_TIPS_SUFFIX:"项,更多结果请搜索",CONTRACT_VALIDATE_MESSAGE:"请填写正确的契约名称"}};(0,bi.initializeReactI18n)(Io,So);const Oo=(0,m.wrapBrick)("eo-icon"),_o=(0,m.wrapBrick)("eo-input",{onChange:"change"});function Ro(e){const{itemsCount:t=20,onBlur:n}=e,[i,a]=(0,p.useState)(t),{t:r}=(0,bi.useTranslation)(Io),[o,s]=(0,p.useState)(!1);return h().createElement("div",{className:"options-tips",slot:e.slot},r(Lo.CONTRACT_OPTIONS_TIPS_PREFIX)," ",o?h().createElement(_o,{autoFocus:!0,inputStyle:{width:65},value:String(i),onBlur:()=>{s(!1),null==n||n(i)},onChange:e=>{a(Number(e.detail))}}):h().createElement("span",null,i," ",h().createElement(Oo,{icon:"edit",lib:"antd",onClick:()=>{s(!0)}}))," ",r(Lo.CONTRACT_OPTIONS_TIPS_SUFFIX))}var Wo;let Do,Po,$o,Bo,Uo,Fo,Vo,jo,zo,Xo,Ko,Jo,Ho,qo,Yo;(0,bi.initializeReactI18n)(Io,So);const{defineElement:Go,property:Zo,event:Qo}=(0,u.createDecorators)(),es=(0,m.wrapBrick)("eo-form-item"),ts=(0,m.wrapBrick)("eo-auto-complete",{onChange:"change"});let ns;var is=new WeakMap,as=new WeakMap,rs=new WeakMap,os=new WeakMap,ss=new WeakMap,ls=new WeakMap,cs=new WeakSet;function ds(e){if("string"!=typeof e)return{name:"",version:""};const[t,n]=e.split(":");return{name:t,version:n}}function ps(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function hs(e){return(0,kt.isNil)(e)||ps(e)?"":wi.i18n.t(`${Io}:${Lo.CONTRACT_VALIDATE_MESSAGE}`)}function us(e){let{value:t,inputStyle:n,validateState:i,suffix:a,onChange:r}=e;const[o,s]=(0,p.useState)(),[l,c]=(0,p.useState)(20),d=function(e){let{pageSize:t=20,q:n=""}=e;const[i,a]=(0,p.useState)([]),[r,o]=(0,p.useState)(n),[s,l]=(0,p.useState)(t);return(0,p.useEffect)((()=>{o(n)}),[n]),(0,p.useEffect)((()=>{l(t)}),[t]),(0,p.useEffect)((()=>{(async()=>{try{const{list:e}=await(0,To.f)({page:1,pageSize:s,fullContractName:r},{interceptorParams:{ignoreLoadingBar:!0}});a(e)}catch(e){console.error(e),a([])}})()}),[r,s]),i}({q:o,pageSize:l}),[u,m]=(0,p.useState)(ds(t)),[g,v]=(0,p.useState)([]);(0,p.useEffect)((()=>{m(ds(t))}),[t]);const b=(0,p.useMemo)((()=>(0,kt.debounce)((e=>{s(e)}),200)),[]);return h().createElement("div",{className:"contract-wrapper"},h().createElement(ts,{className:"contract-selector",options:null==d?void 0:d.map((e=>({value:e.fullContractName,label:e.fullContractName}))),value:u.name,inputStyle:n,validateState:i,onChange:e=>{const t=e.detail;if(ps(t))m(ds(t)),null==r||r(t);else{var n,i;const e=null===(n=d.find((e=>e.fullContractName===t)))||void 0===n?void 0:n.version,a=null!==(i=null==e?void 0:e[0])&&void 0!==i?i:"";v(e),m({name:t,version:a}),null==r||r(`${t}:${a}`)}b(t)}},h().createElement(Ro,{onBlur:e=>c(e),slot:"options-toolbar"})),h().createElement(ts,{className:"version-selector",value:u.version,validateState:i,options:null==g?void 0:g.map((e=>({value:e,label:e}))),onChange:e=>{const t=e.detail;m({name:u.name,version:t}),null==r||r(`${u.name}:${t}`)}}),null!=a&&a.useBrick?h().createElement(Zr.ReactUseMultipleBricks,a):null)}Wo=class extends wo{constructor(){super(...arguments),(0,a.A)(this,cs),(0,r.A)(this,is,Po(this)),(0,r.A)(this,as,($o(this),Bo(this))),(0,r.A)(this,rs,(Uo(this),Fo(this))),(0,r.A)(this,os,(Vo(this),jo(this))),(0,r.A)(this,ss,(zo(this),Xo(this))),(0,r.A)(this,ls,(Ko(this),Jo(this))),(0,G.A)(this,"handleChange",(Yo(this),e=>{(0,s.A)(cs,this,Ho).emit(e)}))}get name(){return(0,c.A)(is,this)}set name(e){(0,l.A)(is,this,e)}get required(){return(0,c.A)(as,this)}set required(e){(0,l.A)(as,this,e)}get label(){return(0,c.A)(rs,this)}set label(e){(0,l.A)(rs,this,e)}get value(){return(0,c.A)(os,this)}set value(e){(0,l.A)(os,this,e)}get suffix(){return(0,c.A)(ss,this)}set suffix(e){(0,l.A)(ss,this,e)}render(){return h().createElement(es,{exportparts:"message",curElement:this,formElement:this.getFormElement(),name:this.name,label:this.label,required:this.required,labelBrick:this.labelBrick,helpBrick:this.helpBrick,notRender:this.notRender,trigger:"handleChange",validator:hs},h().createElement(us,{value:this.value,suffix:this.suffix,validateState:this.validateState,onChange:this.handleChange}))}},({e:[Po,$o,Bo,Uo,Fo,Vo,jo,zo,Xo,Ko,Jo,Ho,qo,Yo],c:[ns,Do]}=(0,d.A)(Wo,[Go("visual-builder.contract-select",{styleTexts:[Qr.A]})],[[Zo(),1,"name"],[Zo({type:Boolean}),1,"required"],[Zo(),1,"label"],[Zo({attribute:!1}),1,"value"],[Zo({attribute:!1}),1,"suffix"],[Qo({type:"change"}),1,"changeEvent",e=>(0,c.A)(ls,e),(e,t)=>(0,l.A)(ls,e,t)]],0,(e=>cs.has((0,o.A)(e))),wo)),Do();var ms=n(2729);var gs,vs=n(7540);let bs,As,fs,ys,ws,ks,Es,xs,Ns,Cs,Ms,Ts,Ls,Is,Ss,Os;const _s=(0,m.wrapBrick)("eo-menu"),Rs=(0,m.wrapBrick)("eo-menu-item"),Ws=(0,m.wrapBrick)("eo-tooltip"),Ds=(0,ms.unwrapProvider)("basic.lock-body-scroll");(0,bi.initializeReactI18n)("bricks/visual-builder/generate-snippets-context-menu",{en:{},zh:{}});const{defineElement:Ps,property:$s,event:Bs,method:Us}=(0,u.createDecorators)();let Fs;var Vs=new WeakMap,js=new WeakMap,zs=new WeakMap,Xs=new WeakMap,Ks=new WeakSet,Js=new WeakMap,Hs=new WeakMap,qs=new WeakMap;class Ys extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ks),(0,r.A)(this,Vs,(bs(this),fs(this))),(0,r.A)(this,js,(ys(this),ws(this))),(0,r.A)(this,zs,(ks(this),Es(this))),(0,r.A)(this,Xs,(xs(this),Ns(this))),(0,r.A)(this,Js,(Ts(this),Ls(this))),(0,r.A)(this,Hs,(Os(this),e=>{(0,s.A)(Ks,this,Cs).emit(e)})),(0,r.A)(this,qs,(e=>{(0,s.A)(Ks,this,Is).emit(e)}))}get options(){return(0,c.A)(Vs,this)}set options(e){(0,l.A)(Vs,this,e)}get active(){return(0,c.A)(js,this)}set active(e){(0,l.A)(js,this,e)}get position(){return(0,c.A)(zs,this)}set position(e){(0,l.A)(zs,this,e)}open(e){let{position:t}=e;this.active=!0,this.position=t}close(){this.active=!1,this.position=void 0}disconnectedCallback(){super.disconnectedCallback(),Ds(this,!1)}render(){return h().createElement(Gs,{active:this.active,element:this,position:this.position,onItemDragStart:(0,c.A)(Hs,this),onItemDragEnd:(0,c.A)(qs,this),options:this.options})}}function Gs(e){var t,n;let{element:i,active:a,onItemDragEnd:r,onItemDragStart:o,options:s,position:l}=e;const[c,d]=(0,p.useState)(!1),u=(0,p.useRef)(null),[m,g]=(0,p.useState)(null),v=(0,p.useCallback)((e=>{e.preventDefault(),null==i||i.close()}),[i]),b=(0,p.useCallback)(((e,t)=>{var n;d(!0),t.dragConf&&(null===(n=e.dataTransfer)||void 0===n||n.setData(t.dragConf.format,JSON.stringify(t.dragConf.data))),e.target.classList.add("dragging"),null==o||o(t)}),[o]),A=(0,p.useCallback)(((e,t)=>{d(!1),e.target.classList.remove("dragging"),null==i||i.close(),null==r||r(t)}),[i,r]);return(0,p.useEffect)((()=>{Ds(i,a)}),[a,i]),(0,p.useEffect)((()=>{if(a&&u.current&&l){const e=u.current.getBoundingClientRect(),t=e.width+8,n=e.height+8,{clientWidth:i,clientHeight:a}=document.documentElement,r=[...l];i>t&&l[0]+t>i&&(r[0]=l[0]-t),a>n&&l[1]+n>a&&(r[1]=a-n),g(r)}else g(null)}),[a,l]),h().createElement(h().Fragment,null,!c&&h().createElement("div",{className:"mask",onClick:v,onContextMenu:v}),h().createElement("div",{className:"container",ref:u,style:{left:null===(t=null!=m?m:l)||void 0===t?void 0:t[0],top:null===(n=null!=m?m:l)||void 0===n?void 0:n[1],visibility:m?"visible":"hidden"}},null==s?void 0:s.map(((e,t)=>{var n,i;return h().createElement("div",{key:t},h().createElement("div",{className:"title"},e.title),(null===(n=e.children)||void 0===n?void 0:n.length)&&h().createElement(_s,null,null===(i=e.children)||void 0===i?void 0:i.map(((e,t)=>h().createElement(Ws,{content:e.tooltip,hoist:!0,placement:"left",key:t},h().createElement(Rs,{disabled:e.disabled,icon:e.icon,draggable:!e.disabled,onDragStart:t=>b(t,e),onDragEnd:t=>A(t,e)},e.text))))))}))))}gs=Ys,({e:[fs,ys,ws,ks,Es,xs,Ns,Cs,Ms,Ts,Ls,Is,Ss,Os,bs],c:[Fs,As]}=(0,d.A)(gs,[Ps("visual-builder.generate-snippets-context-menu",{styleTexts:[vs.A]})],[[$s({attribute:!1}),1,"options"],[$s({type:Boolean}),1,"active"],[$s({attribute:!1}),1,"position"],[Bs({type:"item.drag.start"}),1,"itemDragStartEvent",e=>(0,c.A)(Xs,e),(e,t)=>(0,l.A)(Xs,e,t)],[Bs({type:"item.drag.end"}),1,"itemDragEndEvent",e=>(0,c.A)(Js,e),(e,t)=>(0,l.A)(Js,e,t)],[Us(),2,"open"],[Us(),2,"close"]],0,(e=>qs.has((0,o.A)(e))),m.ReactNextElement)),As();var Zs=n(1085),Qs=n(3091),el=n(7447),tl=n(3640),nl=n(4360),il=n(3544),al=n(4650),rl=n(9830);function ol(){function e(e,t,n){if(!n||"pre"!==n.tagName||"code"!==e.tagName)return;const i=function(e){const t=e.properties.className||[];for(const e of t)if("language-"===e.slice(0,9))return e.slice(9).toLowerCase();return null}(e);if(null===i)return;let a;try{n.properties.className=(n.properties.className||[]).concat("language-"+i),a=rl.L.highlight((0,al.d)(e),i)}catch{return}e.children=a.children}return t=>{(0,il.YR)(t,"element",e)}}const sl={Fragment:Zs.Fragment,jsx:Zs.jsx,jsxs:Zs.jsxs};function ll(e){let{content:t}=e;const[n,i]=(0,p.useState)(null);return(0,p.useEffect)((()=>{let e=!1;return(0,Qs.l)().use(el.A).use(tl.A).use([ol]).use(nl.A,sl).process(t).then((t=>{e||i(t.result)})).catch((t=>{e||(console.error("Convert markdown failed:",t),i(null))})),()=>{e=!0}}),[t]),n}const cl=(0,m.wrapBrick)("eo-avatar");function dl(e){let{message:t}=e;const n=(0,p.useMemo)((()=>{const e=[];if("assistant"===t.role){const n=/(?:^|\n)```(easy_cmd_\S+)\n([\s\S]*?)\n```(?:$|\n)/gm;let i,a=0;for(;i=n.exec(t.content);){const[r,o,s]=i,l=i.index,c=t.content.slice(a,l).trim();c.length>0&&e.push({type:"markdown",content:c}),e.push({type:"command",command:o,content:s.trim(),raw:r}),a=n.lastIndex}const r=t.content.slice(a).trim();r.length>0&&e.push({type:"markdown",content:r})}else e.push({type:"plain",content:t.content});return e}),[t.content,t.role]),i=(0,p.useRef)(null);return(0,p.useEffect)((()=>{const e=i.current;e&&setTimeout((()=>{const n=e.parentElement.querySelectorAll(".texting");for(const e of n)e.classList.remove("texting");if(!t.partial)return;let i=e;for(;i;){const e=i.lastChild;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE||"DETAILS"===(null==e?void 0:e.tagName)&&!e.open){var a;if((null==e?void 0:e.nodeType)!==Node.TEXT_NODE||0!==e.textContent.trim().length||(null===(a=e.previousSibling)||void 0===a?void 0:a.nodeType)!==Node.ELEMENT_NODE)break;i=e.previousSibling}else i=e}i.classList.add("texting")}),1)}),[t.partial,t.content]),h().createElement("div",{className:f()("message",{failed:t.failed})},h().createElement("div",{className:"avatar"},h().createElement(cl,{icon:{lib:"easyops",icon:"assistant"===t.role?"robot":"account"},size:"small",className:`role-${t.role}`})),h().createElement("div",{className:"main"},h().createElement("div",{className:"label"},"assistant"===t.role?"Assistant":"You"),h().createElement("div",{className:"content",ref:i},n.map(((e,t)=>h().createElement(pl,{key:t,chunk:e}))))))}function pl(e){let{chunk:t}=e;return h().createElement(h().Fragment,null,"markdown"===t.type?h().createElement("div",{className:"markdown"},h().createElement(ll,{content:t.content})):"command"===t.type?h().createElement(h().Fragment,null,h().createElement("details",{className:"command"},h().createElement("summary",null,"```",t.command),h().createElement("pre",null,h().createElement("code",null,t.content)))):h().createElement("div",{className:"plain"},t.content))}var hl,ul=n(7236);let ml,gl,vl,bl,Al,fl,yl,wl,kl;const{defineElement:El,property:xl,event:Nl}=(0,u.createDecorators)();let Cl;var Ml=new WeakMap,Tl=new WeakMap,Ll=new WeakMap,Il=new WeakSet,Sl=new WeakMap;class Ol extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Il),(0,r.A)(this,Ml,gl(this)),(0,r.A)(this,Tl,(vl(this),bl(this))),(0,r.A)(this,Ll,(Al(this),fl(this))),(0,r.A)(this,Sl,(kl(this),e=>{(0,s.A)(Il,this,yl).emit(e)}))}get messages(){return(0,c.A)(Ml,this)}set messages(e){(0,l.A)(Ml,this,e)}get errorBoundary(){return(0,c.A)(Tl,this)}set errorBoundary(e){(0,l.A)(Tl,this,e)}render(){return h().createElement(_l,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(Sl,this)})}}function _l(e){let{messages:t,host:n,errorBoundary:i,onStoryboardUpdate:a}=e;const r=(0,p.useMemo)((()=>/(?:^|\n)```easy_cmd_vb_block_(page|storyboard)\n([\s\S]*?)\n```(?:$|\n)/gm),[]),o=(0,p.useRef)(new Map),[s,l]=(0,p.useState)([]),c=(0,p.useRef)(!1);(0,p.useEffect)((()=>{for(const n of null!=t?t:[]){var e;if("assistant"!==n.role)continue;let t;r.lastIndex=null!==(e=o.current.get(n.key))&&void 0!==e?e:0;const i=[];let a=!1;for(;t=r.exec(n.content);){o.current.set(n.key,r.lastIndex);const[,e,s]=t;try{const t=JSON.parse(s);"page"===e?(a=!0,i.push(...t)):i.push({...t,type:"item"})}catch(e){console.error("parse storyboard failed:",e)}}a?l(i):i.length>0&&l((e=>[...e,...i]))}}),[r,t]);const[d,u]=(0,p.useState)([]);(0,p.useEffect)((()=>{const e=[],t=new Map;for(const n of s)"block"===n.type?e.push(n):n.storyboard&&t.set(n.uuid,n.storyboard);e.sort(((e,t)=>e.seq-t.seq));const n={brick:"eo-content-layout",children:[]},a={brick:"eo-main-view",children:[{brick:"eo-page-title",slot:"pageTitle",properties:{pageTitle:"测试页面"}}]};let r=!1;for(const o of e)if("全局操作区"===o.name)for(const e of o.children){const n=t.get(e);n&&(a.children.push({...n,properties:{...n.properties,slot:void 0},errorBoundary:i,slot:"toolbar",iid:`item:${e}`,meta:{type:"item",uuid:e,block:{uuid:o.uuid,name:o.name}}}),r=!0)}else{const e=t.get(o.uuid);if(e){const a={...e,children:[],errorBoundary:i,iid:`block:${o.uuid}`,meta:{type:"block",uuid:o.uuid,name:o.name}};r=!0,n.children.push(a);for(const e of o.children){const n=t.get(e);n&&a.children.push({...n,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}})}}else if(!o.hasContainer)for(const e of o.children){const a=t.get(e);a&&(n.children.push({...a,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}}),r=!0)}}a.children.push(n),u((e=>r?[a]:0===e.length?e:[]))}),[s,i]),(0,p.useEffect)((()=>{null==a||a(d)}),[a,d]);const m=(0,p.useMemo)((()=>{let e=n;for(;e;){const t=getComputedStyle(e,null).getPropertyValue("overflow-y");if("auto"===t||"scroll"===t)return e;if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else{if(!(e.parentNode instanceof Element))break;e=e.parentNode}}return document.scrollingElement||document.documentElement}),[n]);return(0,p.useEffect)((()=>{c.current||setTimeout((()=>{m.scrollTo(0,m.scrollHeight)}),1)}),[t,m]),(0,p.useEffect)((()=>{const e=()=>{c.current=m.scrollTop+m.clientHeight+6<m.scrollHeight};return m.addEventListener("scroll",e),()=>{m.removeEventListener("scroll",e)}}),[m]),h().createElement(h().Fragment,null,null==t?void 0:t.map(((e,t)=>{var n;return h().createElement(dl,{key:null!==(n=e.key)&&void 0!==n?n:`index-${t}`,message:e})})))}hl=Ol,({e:[gl,vl,bl,Al,fl,yl,wl,kl],c:[Cl,ml]}=(0,d.A)(hl,[El("visual-builder.chat-conversation",{styleTexts:[ul.A]})],[[xl({attribute:!1}),1,"messages"],[xl({type:Boolean}),1,"errorBoundary"],[Nl({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Ll,e),(e,t)=>(0,l.A)(Ll,e,t)]],0,(e=>Sl.has((0,o.A)(e))),m.ReactNextElement)),ml();var Rl=n(9575),Wl=n(5310);function Dl(e){let{variant:t,width:n,height:i,left:a,top:r,label:o}=e;return h().createElement("div",{className:"outline "+t,style:{width:n+8,height:i+8,left:a-4,top:r-4}},h().createElement("div",{className:"label"},o))}var Pl,$l=n(1563);let Bl,Ul,Fl,Vl,jl,zl,Xl,Kl,Jl,Hl,ql,Yl,Gl,Zl,Ql,ec;const{defineElement:tc,property:nc,event:ic,method:ac}=(0,u.createDecorators)();let rc;var oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,cc=new WeakMap,dc=new WeakMap,pc=new WeakMap,hc=new WeakSet,uc=new WeakMap;class mc extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,hc),(0,r.A)(this,oc,(Bl(this),Fl(this))),(0,r.A)(this,sc,(Vl(this),jl(this))),(0,r.A)(this,lc,(zl(this),Xl(this))),(0,r.A)(this,cc,(Kl(this),Jl(this))),(0,r.A)(this,dc,(Hl(this),ql(this))),(0,r.A)(this,pc,(Yl(this),Gl(this))),(0,r.A)(this,uc,(ec(this),e=>{(0,s.A)(hc,this,Zl).emit(e)}))}get storyboard(){return(0,c.A)(oc,this)}set storyboard(e){(0,l.A)(oc,this,e)}get theme(){return(0,c.A)(sc,this)}set theme(e){(0,l.A)(sc,this,e)}get uiVersion(){return(0,c.A)(lc,this)}set uiVersion(e){(0,l.A)(lc,this,e)}get app(){return(0,c.A)(cc,this)}set app(e){(0,l.A)(cc,this,e)}get inspecting(){return(0,c.A)(dc,this)}set inspecting(e){(0,l.A)(dc,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return h().createElement(gc,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(uc,this)})}}function gc(e){let{storyboard:t,theme:n,uiVersion:i,app:a,inspecting:r,onActiveTargetChange:o}=e;const s=(0,p.useRef)(),[l,c]=(0,p.useState)(!1),[d,u]=(0,p.useState)(!1),[m,g]=(0,p.useState)({x:0,y:0}),[v,b]=(0,p.useState)([]),[A,y]=(0,p.useState)([]),[w,k]=(0,p.useState)([]),[E,x]=(0,p.useState)([]),N=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=s.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?c(!0):setTimeout(e,100)};e()}),[]);(0,p.useEffect)((()=>{var e,t;if(!l)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...n,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(t=window.PUBLIC_ROOT)&&void 0!==t?t:""}${n.filePath}`})}),[l]),(0,p.useEffect)((()=>{var e;if(!l)return;const r=null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;r&&r("yaml",{yaml:(0,Wl.safeDump)(t,{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:a,theme:n,uiVersion:i})}),[a,l,t,n,i]);const C=(0,p.useMemo)((()=>{if(d)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[d]);(0,p.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":u(!0);break;case"inspect-hover":b(e.data.payload.outlines);break;case"scroll":g(e.data.payload);break;case"inspect-active":y(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,p.useEffect)((()=>{var e;d&&(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:r}},location.origin))}),[d,r]);const M=(0,p.useCallback)((e=>e.map((e=>{var t,n,i,a;const r=null!==(t=null==s||null===(n=s.current)||void 0===n?void 0:n.offsetLeft)&&void 0!==t?t:0,o=null!==(i=null==s||null===(a=s.current)||void 0===a?void 0:a.offsetTop)&&void 0!==i?i:0,{width:l,height:c,left:d,top:p,...h}=e;return{width:1*l,height:1*c,left:1*(d-m.x)+r,top:1*(p-m.y)+o,...h}}))),[m.x,m.y]);return(0,p.useEffect)((()=>{o(A[0])}),[A,o]),(0,p.useEffect)((()=>{x(M(A))}),[A,M]),(0,p.useEffect)((()=>{k(M(v))}),[v,M]),h().createElement("div",{className:f()("container",{inspecting:r})},h().createElement("iframe",{ref:s,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:N,onMouseOut:C}),w.map(((e,t)=>h().createElement(Dl,(0,Rl.A)({key:t,variant:"hover"},e)))),E.map(((e,t)=>h().createElement(Dl,(0,Rl.A)({key:t,variant:"active"},e)))))}Pl=mc,({e:[Fl,Vl,jl,zl,Xl,Kl,Jl,Hl,ql,Yl,Gl,Zl,Ql,ec,Bl],c:[rc,Ul]}=(0,d.A)(Pl,[tc("visual-builder.chat-preview",{styleTexts:[$l.A]})],[[nc({attribute:!1}),1,"storyboard"],[nc(),1,"theme"],[nc(),1,"uiVersion"],[nc(),1,"app"],[nc({type:Boolean}),1,"inspecting"],[ic({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(pc,e),(e,t)=>(0,l.A)(pc,e,t)],[ac(),2,"select"]],0,(e=>uc.has((0,o.A)(e))),m.ReactNextElement)),Ul();let vc=!1;const bc="item:";let Ac=null;function fc(e){e.preventDefault(),e.stopPropagation(),function(e){const t=xc(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(Nc)}},location.origin)}(e)}function yc(e){e.preventDefault(),e.stopPropagation()}const wc=(0,kt.debounce)(((e,t,n)=>{let i=xc(e);if(0===i.length)for(const a of e)if(a instanceof HTMLElement&&a.shadowRoot){i=xc(a.shadowRoot.elementsFromPoint(t,n));break}const a=i.length>0?i[0].element:null;a!==Ac&&(Ac=a,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:i.map(Nc)}},location.origin))}),20,{leading:!0});function kc(e){wc(e.composedPath(),e.clientX,e.clientY)}function Ec(e){e.preventDefault(),e.stopPropagation(),Ac=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function xc(e){const t=[];return e.forEach((e=>{let n;if(e.nodeType===Node.ELEMENT_NODE&&e instanceof HTMLElement&&(n=e.dataset.iid)&&n.startsWith(bc)){const i=n.substring(bc.length);t.push({type:"item",uuid:i,label:Cc(e),element:e})}})),t}function Nc(e){const{element:t,type:n,uuid:i,label:a}=e,{width:r,height:o,left:s,top:l}=t.getBoundingClientRect();return{width:r,height:o,left:s+window.scrollX,top:l+window.scrollY,type:n,uuid:i,label:a}}function Cc(e){return e.tagName.toLowerCase().split(".").pop()}let Mc=!1;function Tc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,ms.createProviderClass)((async function(){Mc||(Mc=!0,n.e(2201).then(n.bind(n,2201)),Tc({type:"initialized"}),window.addEventListener("message",(e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"toggle-inspecting":!function(e){if(vc===e)return;vc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",fc,!0),window[t]("mousedown",yc,!0),window[t]("mouseover",yc,!0),window[t]("mouseup",yc,!0),window[t]("pointerdown",yc,!0),window[t]("pointerover",yc,!0),window[t]("pointerup",yc,!0),window[t]("pointerleave",Ec,!0),window[t]("pointermove",kc,!0)}(e.data.payload.inspecting);break;case"select":!function(e){const t=function(e,t){const n=[];return function t(i){const a=i.querySelectorAll(`[data-iid="${e}"]`);if(n.push(...a),!(i===document&&a.length>0))for(const e of i.querySelectorAll("*"))e.shadowRoot&&t(e.shadowRoot)}(document),n}(`${e.type}:${e.uuid}`);window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map((t=>Nc({...e,element:t,label:Cc(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{Tc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var Lc,Ic=n(4014),Sc=n(8918);let Oc,_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc;const{defineElement:jc,property:zc}=(0,u.createDecorators)();let Xc;var Kc=new WeakMap,Jc=new WeakMap,Hc=new WeakMap,qc=new WeakMap,Yc=new WeakMap;class Gc extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Kc,_c(this)),(0,r.A)(this,Jc,(Rc(this),Wc(this))),(0,r.A)(this,Hc,(Dc(this),Pc(this))),(0,r.A)(this,qc,($c(this),Bc(this))),(0,r.A)(this,Yc,(Uc(this),Fc(this))),Vc(this)}get generations(){return(0,c.A)(Kc,this)}set generations(e){(0,l.A)(Kc,this,e)}get category(){return(0,c.A)(Jc,this)}set category(e){(0,l.A)(Jc,this,e)}get theme(){return(0,c.A)(Hc,this)}set theme(e){(0,l.A)(Hc,this,e)}get uiVersion(){return(0,c.A)(qc,this)}set uiVersion(e){(0,l.A)(qc,this,e)}get app(){return(0,c.A)(Yc,this)}set app(e){(0,l.A)(Yc,this,e)}render(){return h().createElement(Zc,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Zc(e){let{generations:t,category:n,theme:i,uiVersion:a,app:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),[c,d]=(0,p.useState)(!1),u=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;if(!s)return;const t=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=o.current.contentWindow._preview_only_inject,i={...t,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${t.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>n(e,i,void 0,!0)))).then((()=>{d(!0)}))}),[s]),(0,p.useEffect)((()=>{var e;if(!c)return;const s=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const l=new Map,d=new Map;for(const e of t){var p;let t=l.get(e.propertyId);t||l.set(e.propertyId,t=new Map);let n=t.get(e.rwType);n||t.set(e.rwType,n=new Map),n.set(null!==(p=e.displayLevel)&&void 0!==p?p:0,e),d.set(e.propertyId,e.mockData)}const h=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"类别",className:"head-cell"}},{brick:"div",properties:{textContent:"展示等级",className:"head-cell last-col-cell",style:{gridColumn:"span 5",textAlign:"center"}}}],u={brick:"visual-builder.pre-generated-table-view",properties:{style:{gridTemplateColumns:"120px 80px repeat(5, 1fr)"}},children:h};let m=0;for(const[e,t]of l){let i=0;const a=m===l.size-1;for(const[r,o]of t){if(0===i){let n;for(const t of o.values()){var g;n=null!==(g=t.propertyName)&&void 0!==g?g:e;break}h.push({brick:"div",properties:{textContent:n,className:f()("body-cell",{"last-row-cell":a}),style:{gridRow:`span ${t.size}`}}})}const s=a&&i===t.size-1;h.push({brick:"div",properties:{textContent:r,className:f()("body-cell",{"last-row-cell":s})}});for(let t=-2;t<3;t++){var v,b,A;const i=o.get(t),a=null!==(v=null==i?void 0:i.category)&&void 0!==v?v:n;let r;if(null!=i&&null!==(b=i.mockData)&&void 0!==b&&b.length){const t=i.mockData[Math.floor(Math.random()*i.mockData.length)];switch(a){case"detail-item":case"form-item":case"card-item":r={[e]:t};break;case"table-column":r={cellData:t}}}const l=[].concat(null!==(A=null==i?void 0:i.storyboard)&&void 0!==A?A:[]).filter((e=>!!(0,ms.isObject)(e)||(console.error("Unexpected type of storyboard:",typeof e),!1)));let c;switch(l.forEach(Qc),a){case"form-item":c={brick:"eo-form",properties:{layout:"inline",values:r,className:"form-container"},children:l.map((e=>({...e,errorBoundary:!0})))};break;case"card-item":c={brick:":forEach",dataSource:[r],children:l.map((e=>({...e,errorBoundary:!0})))};break;default:c={brick:"visual-builder.pre-generated-container",properties:{useBrick:l,dataSource:r},errorBoundary:!0}}h.push({brick:"div",properties:{className:f()("body-cell",{"last-col-cell":2===t,"last-row-cell":s})},children:[{...c,errorBoundary:!0}]})}i++}m++}s("yaml",{yaml:(0,Wl.safeDump)(u,{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:r,theme:i,uiVersion:a,styleText:Sc.A})}),[r,c,t,i,a,n]),h().createElement("div",{className:f()("container")},h().createElement("iframe",{ref:o,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:u}))}function Qc(e){var t;null!==(t=e.properties)&&void 0!==t&&t.prefix&&(console.error("Unexpected readonly property of 'prefix' in:",e),delete e.properties.prefix)}Lc=Gc,({e:[_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc],c:[Xc,Oc]}=(0,d.A)(Lc,[jc("visual-builder.pre-generated-preview",{styleTexts:[Ic.A]})],[[zc({attribute:!1}),1,"generations"],[zc(),1,"category"],[zc(),1,"theme"],[zc(),1,"uiVersion"],[zc(),1,"app"]],0,void 0,m.ReactNextElement)),Oc();var ed,td=n(9216);let nd;const{defineElement:id}=(0,u.createDecorators)();let ad;class rd extends m.ReactNextElement{render(){return h().createElement(od,null)}}function od(){return h().createElement("slot",null)}ed=rd,[ad,nd]=(0,d.A)(ed,[id("visual-builder.pre-generated-table-view",{styleTexts:[td.A]})],[],0,void 0,m.ReactNextElement).c,nd();var sd,ld=n(4967);let cd,dd,pd,hd,ud;const{defineElement:md,property:gd}=(0,u.createDecorators)();let vd;var bd=new WeakMap,Ad=new WeakMap;class fd extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,bd,dd(this)),(0,r.A)(this,Ad,(pd(this),hd(this))),ud(this)}get useBrick(){return(0,c.A)(bd,this)}set useBrick(e){(0,l.A)(bd,this,e)}get dataSource(){return(0,c.A)(Ad,this)}set dataSource(e){(0,l.A)(Ad,this,e)}render(){return h().createElement(yd,{useBrick:this.useBrick,dataSource:this.dataSource})}}function yd(e){let{useBrick:t,dataSource:n}=e;return t?h().createElement(Zr.ReactUseMultipleBricks,{useBrick:t,data:n,errorBoundary:!0}):null}sd=fd,({e:[dd,pd,hd,ud],c:[vd,cd]}=(0,d.A)(sd,[md("visual-builder.pre-generated-container",{styleTexts:[ld.A]})],[[gd({attribute:!1}),1,"useBrick"],[gd({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),cd(),n(2080),customElements.define("visual-builder.check-editor-by-name",(0,ms.createProviderClass)((async function(e){try{await et.__secret_internals.loadEditors([e])}catch{return!1}return!!et.customEditors.get(e)})));var wd=n(6376);function kd(e,t){const n=new Map;for(const i of e){const e=(0,wd.collectMemberUsage)([i.if,i.value,i.resolve],t);n.set(i,e)}return n}function Ed(e,t){e.forEach((n=>{!function(e,t){var n;const{dependencyList:i,nodeList:a,parents:r,result:o}=t,s=(0,kt.cloneDeep)(e);o.push(s);const l=i.find((e=>e.node.key===s.key));if(null!==(n=l.deps)&&void 0!==n&&n.length&&!r.some((e=>e.key===s.key))){const e=s.children=[];!function(e,t){const n=[];e.deps.forEach((e=>{const i=t.nodeList.filter((t=>t.name===e));n.push(...i)})),Ed(n,t)}(l,{dependencyList:i,nodeList:a,parents:[...r,s],result:e})}}(n,{...t,nodeList:e})}))}customElements.define("visual-builder.get-data-deps",(0,ms.createProviderClass)(kd)),customElements.define("visual-builder.get-dependency-tree",(0,ms.createProviderClass)((function(e,t){const n=e,i=kd(n.map((e=>e.data)),t.dataType),a=[];for(const[e,t]of i)a.push({deps:Array.from(t.usedProperties),node:n.find((t=>t.data===e))});const r=[];return Ed(n,{result:r,dependencyList:a,parents:[]}),r})));let xd=et.__secret_internals;try{var Nd;const e=window.dll;if(e&&null!==(Nd=window.BRICK_NEXT_VERSIONS)&&void 0!==Nd&&null!==(Nd=Nd["brick-container"])&&void 0!==Nd&&Nd.startsWith("2.")){const{developHelper:t}=e("tYg3");xd={getBrickPackagesById(e){var n;return null===(n=t.getBrickPackages)||void 0===n?void 0:n.call(t).find((t=>t.id===e))}}}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}const Cd=xd;var Md,Td=n(1304),Ld=n(9034),Id=n(4162);let Sd,Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,jd,zd,Xd,Kd,Jd,Hd,qd,Yd,Gd,Zd,Qd,ep,tp,np,ip,ap,rp;const{defineElement:op,property:sp,event:lp}=(0,u.createDecorators)();let cp;var dp=new WeakMap,pp=new WeakMap,hp=new WeakMap,up=new WeakMap,mp=new WeakMap,gp=new WeakMap,vp=new WeakMap,bp=new WeakMap,Ap=new WeakMap,fp=new WeakSet,yp=new WeakMap,wp=new WeakMap,kp=new WeakMap,Ep=new WeakMap,xp=new WeakMap;class Np extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,fp),(0,r.A)(this,dp,Od(this)),(0,r.A)(this,pp,(_d(this),Rd(this))),(0,r.A)(this,hp,(Wd(this),Dd(this))),(0,r.A)(this,up,(Pd(this),$d(this))),(0,r.A)(this,mp,(Bd(this),Ud(this))),(0,r.A)(this,gp,(Fd(this),Vd(this))),(0,r.A)(this,vp,(jd(this),zd(this))),(0,r.A)(this,bp,(Xd(this),Kd(this))),(0,r.A)(this,Ap,(Jd(this),Hd(this))),(0,r.A)(this,yp,(Gd(this),e=>{(0,s.A)(fp,this,qd).emit(e)})),(0,r.A)(this,wp,Zd(this)),(0,r.A)(this,kp,(tp(this),e=>{(0,s.A)(fp,this,Qd).emit(e)})),(0,r.A)(this,Ep,np(this)),(0,r.A)(this,xp,(rp(this),e=>{(0,s.A)(fp,this,ip).emit(e)}))}get previewUrl(){return(0,c.A)(dp,this)}set previewUrl(e){(0,l.A)(dp,this,e)}get generations(){return(0,c.A)(pp,this)}set generations(e){(0,l.A)(pp,this,e)}get mocks(){return(0,c.A)(hp,this)}set mocks(e){(0,l.A)(hp,this,e)}get busy(){return(0,c.A)(up,this)}set busy(e){(0,l.A)(up,this,e)}get category(){return(0,c.A)(mp,this)}set category(e){(0,l.A)(mp,this,e)}get theme(){return(0,c.A)(gp,this)}set theme(e){(0,l.A)(gp,this,e)}get uiVersion(){return(0,c.A)(vp,this)}set uiVersion(e){(0,l.A)(vp,this,e)}get app(){return(0,c.A)(bp,this)}set app(e){(0,l.A)(bp,this,e)}render(){return h().createElement(Cp,{previewUrl:this.previewUrl,generations:this.generations,mocks:this.mocks,busy:this.busy,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app,onComment:(0,c.A)(yp,this),onApprove:(0,c.A)(kp,this),onViewAttrPrompt:(0,c.A)(xp,this)})}}function Cp(e){let{previewUrl:t,generations:n,mocks:i,busy:a,category:r,theme:o,uiVersion:s,app:l,onComment:c,onApprove:d,onViewAttrPrompt:u}=e;const m=(0,p.useRef)(),[g,v]=(0,p.useState)(!1),[b,A]=(0,p.useState)(!1),y=(0,p.useRef)([]),w=(0,p.useRef)([]),k=(0,p.useRef)([]);(0,p.useEffect)((()=>{var e;k.current=null!==(e=null==n?void 0:n.filter((e=>e.approved)).map((e=>e.propertyId)))&&void 0!==e?e:[]}),[n]);const E=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=m.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?v(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{g&&m.current.contentWindow.postMessage({channel:"raw-data-preview",type:"busy",payload:a},location.origin)}),[a,g]),(0,p.useEffect)((()=>{if(g){const e=m.current.contentWindow,t=e=>{let{data:t}=e;if("raw-data-preview"===(null==t?void 0:t.channel))switch(t.type){case"comment":c(t.payload);break;case"approve":d(t.payload);break;case"viewAttrPrompt":u(t.payload);break;case"updatePropertyToggleState":y.current=t.payload;break;case"updatePropertyExpandState":w.current=t.payload;break;case"updatePropertyApproveState":k.current=t.payload}};return e.addEventListener("message",t),()=>{e.removeEventListener("message",t)}}}),[d,c,u,g]),(0,p.useEffect)((()=>{var e;if(!g)return;const n=Cd.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=m.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>i(e,a,void 0,!0)))).then((()=>{A(!0)}))}),[t,g]),(0,p.useEffect)((()=>{var e;if(!b)return;const t=null===(e=m.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!t)return;const a=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"",className:"head-cell"}},{brick:"div",properties:{textContent:"类型",className:"head-cell"}},{brick:"div",properties:{textContent:"原始数据",className:"head-cell"}},{brick:"div",properties:{textContent:"视觉重量 (由低至高)",className:"head-cell",style:{gridColumn:"span 4",textAlign:"center"}}},{brick:"div",properties:{textContent:"确认",className:"head-cell"}},{brick:"div",properties:{className:"head-cell last-col-cell"},children:[{brick:"span",properties:{textContent:"批注"}},{brick:"span",properties:{className:"tips",textContent:"(补充提示词,按住 ⌘ 或 ctrl + 回车提交)"}}]}],r={brick:"visual-builder.pre-generated-table-view",context:[{name:"propertyToggleState",value:y.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyToggleState",payload:"<% CTX.propertyToggleState %>"}]}},{name:"propertyExpandState",value:w.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyExpandState",payload:"<% CTX.propertyExpandState %>"}]}},{name:"propertyApproveState",value:k.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyApproveState",payload:"<% CTX.propertyApproveState %>"}]}},{name:"busy"}],properties:{style:{gridTemplateColumns:"minmax(120px, 0.5fr) 32px auto repeat(5, 1fr) auto 1fr"}},children:a};for(let e=0,t=n.length;e<t;e++){var c,d;const r=n[e],o=e===t-1,s=new Map;for(const e of null!==(p=r.candidates)&&void 0!==p?p:[]){var p,h;s.set(null!==(h=e.visualWeight)&&void 0!==h?h:0,e)}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"span",properties:{textContent:`${null!==(c=r.propertyName)&&void 0!==c?c:r.propertyId}`}},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyToggleState",`<%\n CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyToggleState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyToggleState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]},{brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:null!==(d=r.candidates)&&void 0!==d&&d.length?[{brick:"eo-icon",properties:{lib:"fa",prefix:"fas",icon:"circle",style:{color:r.generationId?"var(--palette-green-6)":"var(--palette-gray-6)",transformOrigin:"center center",transform:"scale(0.5)"}}}]:void 0},{brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"eo-link",properties:{type:"text",textContent:r.propertyType},events:{click:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"viewAttrPrompt",payload:r}]}}}]});let l=r.propertyValues;if(!l){var u,g;const e=(null!==(u=null!==(g=r.mockData)&&void 0!==g?g:i)&&void 0!==u?u:[]).slice();e.sort(((e,t)=>{const n=null==e?void 0:e[r.propertyId],i=null==t?void 0:t[r.propertyId],a=Array.isArray(n),o=Array.isArray(i);if(a||o)return(o?i.length:-1)-(a?n.length:-1);const s=null==n,l=null==i;if(s||l)return(l?0:1)-(s?0:1);const c="string"==typeof n&&0===n.length,d="string"==typeof i&&0===i.length;return c||d?(d?0:1)-(c?0:1):0})),l=e.map((e=>e[r.propertyId]))}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:l.map(((e,t)=>({brick:"div",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{className:`<%= \`raw-content\${ CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? " expand" : "" }\` %>`,textContent:void 0===e?"":"string"==typeof e?e:JSON.stringify(e,null,2)}})))},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyExpandState",`<%\n CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyExpandState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyExpandState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]});for(let e=-1;e<3;e++){const t=s.get(e);let n;t&&(n=(0,Td.w)(t,r.propertyId)),a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:n?l.map(((e,t)=>({brick:"visual-builder.pre-generated-container",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{useBrick:[n],dataSource:{[r.propertyId]:e}},errorBoundary:!0}))):void 0}]})}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:r.candidates?[{brick:"eo-checkbox",properties:{value:`<%= CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) ? ["approved"] : [] %>`,options:[{label:"",value:"approved"}],disabled:`<%= CTX.busy || ${JSON.stringify(!r.generationId)} %>`},events:{change:[{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"approve",payload:{approved:"<% EVENT.detail.length > 0 %>",propertyInstanceId:r.propertyInstanceId}}]},{action:"context.replace",args:["propertyApproveState",`<%\n EVENT.detail.length > 0\n ? CTX.propertyApproveState.concat(${JSON.stringify(r.propertyId)})\n : CTX.propertyApproveState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n %>`]}]}}]:void 0},{brick:"div",properties:{className:f()("body-cell",{"last-col-cell":!0,"last-row-cell":o})},children:r.candidates?[{brick:"eo-textarea",properties:{value:r.comment?`<% ${JSON.stringify(r.comment)} %>`:void 0,autoSize:!0,style:{width:"100%"},disabled:`<%= CTX.busy || CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) %>`},events:{keydown:{if:"<% EVENT.code === 'Enter' && (EVENT.metaKey || EVENT.ctrlKey) %>",action:"window.postMessage",args:[{channel:"raw-data-preview",type:"comment",payload:{comment:"<% EVENT.target.value %>",propertyInstanceId:r.propertyInstanceId}}]}}}]:void 0})}t("yaml",{yaml:(0,Wl.safeDump)([r,{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'raw-data-preview' && EVENT.detail.data.type === 'busy' %>",action:"context.replace",args:["busy","<% EVENT.detail.data.payload %>"]}},portal:!0,errorBoundary:!0}],{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:Id.A})}),[l,b,n,o,s,r,i]),h().createElement("div",{className:f()("container")},h().createElement("iframe",{ref:m,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:E}))}Md=Np,({e:[Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,jd,zd,Xd,Kd,Jd,Hd,qd,Yd,Gd,Zd,Qd,ep,tp,np,ip,ap,rp],c:[cp,Sd]}=(0,d.A)(Md,[op("visual-builder.raw-data-preview",{styleTexts:[Ld.A]})],[[sp(),1,"previewUrl"],[sp({attribute:!1}),1,"generations"],[sp({attribute:!1}),1,"mocks"],[sp({type:Boolean}),1,"busy"],[sp(),1,"category"],[sp(),1,"theme"],[sp(),1,"uiVersion"],[sp(),1,"app"],[lp({type:"comment"}),1,"commentEvent",e=>(0,c.A)(Ap,e),(e,t)=>(0,l.A)(Ap,e,t)],[lp({type:"approve"}),1,"approveEvent",e=>(0,c.A)(wp,e),(e,t)=>(0,l.A)(wp,e,t)],[lp({type:"view.attr.prompt"}),1,"viewAttrPromptEvent",e=>(0,c.A)(Ep,e),(e,t)=>(0,l.A)(Ep,e,t)]],0,(e=>xp.has((0,o.A)(e))),m.ReactNextElement)),Sd();var Mp=n(264);customElements.define("visual-builder.parse-path",(0,ms.createProviderClass)((async function(e,t){const n=[];return{regexp:(0,Mp.MM)(e,n,(0,kt.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:n}})));var Tp=n(780);customElements.define("visual-builder.batch-update-raw-data-generated-view",(0,ms.createProviderClass)((async function(e){return Promise.allSettled(e.map((e=>{let{attrInstanceId:t,...n}=e;return(0,Tp._)("RAW_DATA_GENERATED_VIEW@EASYOPS",{...n,attr:[t]})})))})));var Lp=n(3084),Ip=n(7710),Sp=n(5799),Op=n(4671),_p=n(8397),Rp=n(3404),Wp=n(3287),Dp=n(76);customElements.define("visual-builder.get-raw-data-system-prompts",(0,ms.createProviderClass)((function(){return{boolean:Lp,"date-time":Ip,enum:Sp,number:Op,others:_p,"struct-list":Rp,struct:Wp,json:Dp}})));const Pp="bricks/visual-builder/pre-generated-config";wi.i18n.getFixedT(null,Pp);var $p,Bp=n(8027),Up=n(8488),Fp=n(2120);let Vp,jp,zp,Xp,Kp,Jp,Hp,qp,Yp,Gp,Zp,Qp,eh,th,nh,ih,ah;(0,wi.initializeI18n)(Pp,{en:{},zh:{}});const{defineElement:rh,property:oh,event:sh}=(0,u.createDecorators)();let lh;var ch,dh=new WeakMap,ph=new WeakMap,hh=new WeakMap,uh=new WeakMap,mh=new WeakMap,gh=new WeakSet,vh=new WeakMap,bh=new WeakMap,Ah=new WeakMap;class fh extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,gh),(0,r.A)(this,dh,jp(this)),(0,r.A)(this,ph,(zp(this),Xp(this))),(0,r.A)(this,hh,(Kp(this),Jp(this))),(0,r.A)(this,uh,(Hp(this),qp(this))),(0,r.A)(this,mh,(Yp(this),Gp(this))),(0,r.A)(this,vh,(eh(this),th(this))),(0,r.A)(this,bh,(ah(this),e=>{(0,s.A)(gh,this,Zp).emit(e)})),(0,r.A)(this,Ah,(e=>{(0,s.A)(gh,this,nh).emit(e)}))}get previewUrl(){return(0,c.A)(dh,this)}set previewUrl(e){(0,l.A)(dh,this,e)}get attrList(){return(0,c.A)(ph,this)}set attrList(e){(0,l.A)(ph,this,e)}get mockList(){return(0,c.A)(hh,this)}set mockList(e){(0,l.A)(hh,this,e)}get containerConfig(){return(0,c.A)(uh,this)}set containerConfig(e){(0,l.A)(uh,this,e)}render(){return h().createElement(yh,{previewUrl:this.previewUrl,attrList:this.attrList,mockList:this.mockList,containerConfig:this.containerConfig,onChange:(0,c.A)(bh,this),onBrickChange:(0,c.A)(Ah,this),root:this})}}function yh(e){let{previewUrl:t,attrList:n,mockList:i,containerConfig:a,root:r,onChange:o,onBrickChange:s}=e;const l=(0,p.useRef)(),[c,d]=(0,p.useState)(!1),[u,m]=(0,p.useState)(!1),[g,v]=(0,p.useState)(null);(0,p.useEffect)((()=>{g&&o(g)}),[g,o]),(0,p.useEffect)((()=>{if(g){const e=function(e,t){let{type:n,dataName:i,dataType:a,settings:r}=t;if(!n||!i)return null;const o=`${"state"===a?"STATE":"CTX"}${(0,Bp._)(i)}`;if("chart"===n){var s,l;const e=`<%= ${o}${null!=r&&r.pagination?".list":""} %>`;return{brick:"eo-mini-line-chart",properties:{width:600,height:200,xField:null===(s=r.fields)||void 0===s?void 0:s.xField,yField:null===(l=r.fields)||void 0===l?void 0:l.yField,lineColor:"var(--palette-orange-6)",data:e}}}if("cards"===n)return{brick:"eo-grid-layout",properties:{templateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--card-content-gap)"},slots:{"":{type:"bricks",bricks:[{brick:":forEach",dataSource:`<%= ${o}${null!=r&&r.pagination?".list":""} %>`,slots:{"":{type:"bricks",bricks:[{brick:"eo-card-item",properties:{cardTitle:(0,kt.has)(null==r?void 0:r.fields,"title")&&"string"==typeof r.fields.title?`<% ITEM${(0,Bp._)(r.fields.title)} %>`:void 0,description:(0,kt.has)(null==r?void 0:r.fields,"description")&&"string"==typeof r.fields.description?`<% ITEM${(0,Bp._)(r.fields.description)} %>`:void 0}}]}}}]}}};const c=`<%= ${null!=r&&r.pagination?o:`{ list: ${o} }`} %>`,d=new Map;for(const t of e)if(t.config){const e="table"===n?(0,Td.m)(t.config,".cellData"):(0,Td.w)(t.config,t.id);e&&d.set(t.id,e)}const p=Object.fromEntries(e.map((e=>{const t=d.get(e.id);return t?[`[${e.id}]`,{type:"bricks",bricks:[t]}]:null})).filter(Boolean));switch(n){case"table":return{brick:"eo-next-table",properties:{rowKey:"instanceId",columns:e.map((e=>{const t={title:e.name,dataIndex:e.id,key:e.id};return d.has(e.id)&&(t.useChildren=`[${e.id}]`),t})),dataSource:c,...null!=r&&r.pagination?null:{pagination:!1}},slots:p};case"descriptions":return{brick:"eo-descriptions",properties:{column:2,list:e.map((e=>{const t={label:e.name};return e.config&&(t.useChildren=`[${e.id}]`),t})),dataSource:c},slots:p}}return null}(g,a);s(e)}}),[g,a,s]);const b=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=l.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?d(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow;if(!c||!t)return;const n=new ResizeObserver((()=>{r.style.height=`${t.document.body.scrollHeight}px`}));return n.observe(t.document.body),()=>n.disconnect()}),[c,r]),(0,p.useEffect)((()=>{var e;if(!c)return;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow,n=e=>{let{data:t}=e;"pre-generated-config"===(null==t?void 0:t.channel)&&"config-change"===t.type&&v(t.payload)};return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}}),[c]),(0,p.useEffect)((()=>{var e;if(!c)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=l.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled([i("visual-builder.pre-generated-container",a,void 0,!0)]).then((()=>{m(!0)}))}),[t,c]),(0,p.useEffect)((()=>{var e,t,a,r,o;if(!u)return;const s=null===(e=l.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const c=null!==(t=null==n?void 0:n.slice(0,5))&&void 0!==t?t:[],d=c.map((e=>e.id)),p=(0,kt.uniqueId)("event-agent-");s("yaml",{yaml:(0,Wl.safeDump)([{brick:"eo-next-table",errorBoundary:!0,properties:{pagination:!1,rowSelection:!0,rowKey:"id",rowDraggable:!0,bordered:!0,dataSource:{list:n},selectedRowKeys:d,columns:[{title:"ID",dataIndex:"id",key:"id",width:"20%"},{title:"Name",dataIndex:"name",key:"name",width:"20%"},{title:"Preview",dataIndex:"preview",key:"preview",colSpan:2,useBrick:{brick:"div",children:null==n?void 0:n.flatMap((e=>{var t,n,a;const r=null===(t=e.candidates)||void 0===t?void 0:t.map((t=>{const n=`<%=\n DATA.rowData.id === ${JSON.stringify(e.id)} &&\n ${JSON.stringify(t.visualWeight)} === CTX.weightMap.get(${JSON.stringify(e.id)})\n %>`,a=(0,Td.w)(t,e.id);var r;if(a)return{if:n,brick:"visual-builder.pre-generated-container",properties:{useBrick:a,dataSource:null!==(r=null==i?void 0:i[0])&&void 0!==r?r:{}}}})).filter(Boolean);return null!=r&&r.length?r:{if:`<% DATA.rowData.id === ${JSON.stringify(e.id)} %>`,brick:"span",properties:{textContent:null!==(n=null==i||null===(a=i[0])||void 0===a?void 0:a[e.id])&&void 0!==n?n:""}}}))}},{dataIndex:"operations",key:"operations",colSpan:0,width:81,useBrick:{if:"<% CTX.availableWeights.get(DATA.rowData.id)?.length %>",brick:"eo-mini-actions",properties:{actions:'<%=\n [\n {\n icon: {\n lib: "antd",\n icon: "minus",\n },\n event: "minus",\n disabled: CTX.weightMap.get(DATA.rowData.id) <= CTX.availableWeights.get(DATA.rowData.id)[0],\n },\n {\n icon: {\n lib: "antd",\n icon: "plus",\n },\n event: "plus",\n disabled: CTX.weightMap.get(DATA.rowData.id) >= CTX.availableWeights.get(DATA.rowData.id).slice(-1)[0],\n },\n ]\n %>'},events:{minus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, -1) %>"]},plus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, 1) %>"]}}}}]},events:{"row.select":{action:"context.replace",args:["selectedAttrs","<%= EVENT.detail.rows %>"]},"row.drag":{action:"context.replace",args:["orderedAttrIds","<%= EVENT.detail.list.map((attr) => attr.id) %>"]}}},{brick:"eo-event-agent",properties:{id:p},events:{trigger:{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"config-change",payload:"<% FN.getConfig(CTX.selectedAttrs, CTX.orderedAttrIds, CTX.weightMap) %>"}]}},lifeCycle:{onPageLoad:{target:`#${p}`,method:"trigger"}},portal:!0,errorBoundary:!0},{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'pre-generated-config' && EVENT.detail.data.type === 'get-config' %>",action:"window.postMessage",args:[{channel:"pre-generated-config",type:"get-config-response",id:"<%= EVENT.detail.data.id %>",payload:"<% FN.getConfig(CTX.selectedAttrs, CTX.orderedAttrIds, CTX.weightMap) %>"}]}},portal:!0,errorBoundary:!0}],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:Fp.A,context:[{name:"orderedAttrIds",value:null!==(a=null==n?void 0:n.map((e=>e.id)))&&void 0!==a?a:[],onChange:{target:`#${p}`,method:"trigger"}},{name:"selectedAttrs",value:c,onChange:{target:`#${p}`,method:"trigger"}},{name:"availableWeights",value:`<% new Map(${JSON.stringify(null!==(r=null==n?void 0:n.map((e=>{var t,n;return[e.id,null!==(t=null===(n=e.candidates)||void 0===n?void 0:n.map((e=>e.visualWeight)).sort(((e,t)=>e-t)))&&void 0!==t?t:[]]})))&&void 0!==r?r:[])}) %>`},{name:"weightMap",value:`<% new Map(${JSON.stringify(null!==(o=null==n?void 0:n.map((e=>{var t,n;return[e.id,null===(n=e.candidates,0,t=null==n?void 0:n.reduce(((e,t)=>!e||Math.abs(t.visualWeight-0)<Math.abs(e.visualWeight-0)?t:e)))||void 0===t?void 0:t.visualWeight]})))&&void 0!==o?o:[])}) %>`,onChange:{target:`#${p}`,method:"trigger"}}],functions:[{name:"updateWeightMap",source:"/**\n * @param {Map<string, number>} weightMap\n * @param {Map<string, number[]>} availableWeights\n * @param {string} key\n * @param {1 | -1} direction\n * @returns {Map<string, number>}\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction updateWeightMap(weightMap, availableWeights, key, direction) {\n return new Map([...weightMap].map(_ref => {\n let [k, v] = _ref;\n if (k === key) {\n const weights = availableWeights.get(k);\n const index = weights.indexOf(v);\n const nextIndex = Math.max(0, Math.min(index + direction, weights.length - 1));\n return [k, weights[nextIndex]];\n }\n return [k, v];\n }));\n}"},{name:"getConfig",source:"\n function getConfig(selectedAttrs, orderedAttrIds, weightMap) {\n return selectedAttrs.map((attr) => ({\n id: attr.id,\n name: attr.name,\n config: attr.candidates?.find((can) => can.visualWeight === weightMap.get(attr.id)),\n })).sort((a, b) => orderedAttrIds.indexOf(a.id) - orderedAttrIds.indexOf(b.id));\n }\n "}]})}),[n,u,i]),h().createElement("div",{className:"container"},h().createElement("iframe",{ref:l,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:b}))}let wh,kh,Eh,xh,Nh,Ch,Mh,Th,Lh;$p=fh,({e:[jp,zp,Xp,Kp,Jp,Hp,qp,Yp,Gp,Zp,Qp,eh,th,nh,ih,ah],c:[lh,Vp]}=(0,d.A)($p,[rh("visual-builder.pre-generated-config",{styleTexts:[Up.A]})],[[oh(),1,"previewUrl"],[oh({attribute:!1}),1,"attrList"],[oh({attribute:!1}),1,"mockList"],[oh({attribute:!1}),1,"containerConfig"],[sh({type:"change"}),1,"changeEvent",e=>(0,c.A)(mh,e),(e,t)=>(0,l.A)(mh,e,t)],[sh({type:"brick.change"}),1,"brickChangeEvent",e=>(0,c.A)(vh,e),(e,t)=>(0,l.A)(vh,e,t)]],0,(e=>Ah.has((0,o.A)(e))),m.ReactNextElement)),Vp();const{defineElement:Ih,property:Sh}=(0,u.createDecorators)();let Oh;var _h=new WeakMap,Rh=new WeakMap,Wh=new WeakMap,Dh=new WeakMap;class Ph extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,_h,kh(this)),(0,r.A)(this,Rh,(Eh(this),xh(this))),(0,r.A)(this,Wh,(Nh(this),Ch(this))),(0,r.A)(this,Dh,(Mh(this),Th(this))),Lh(this)}get previewUrl(){return(0,c.A)(_h,this)}set previewUrl(e){(0,l.A)(_h,this,e)}get container(){return(0,c.A)(Rh,this)}set container(e){(0,l.A)(Rh,this,e)}get attrList(){return(0,c.A)(Wh,this)}set attrList(e){(0,l.A)(Wh,this,e)}get mockList(){return(0,c.A)(Dh,this)}set mockList(e){(0,l.A)(Dh,this,e)}render(){return h().createElement($h,{root:this,previewUrl:this.previewUrl,container:this.container,attrList:this.attrList,mockList:this.mockList})}}function $h(e){let{root:t,previewUrl:n,container:i,attrList:a,mockList:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),c=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const n=null===(e=o.current)||void 0===e?void 0:e.contentWindow;if(!s||!n)return;const i=new ResizeObserver((()=>{t.style.height=`${n.document.body.scrollHeight}px`}));return i.observe(n.document.body),()=>i.disconnect()}),[s,t]),(0,p.useEffect)((()=>{var e,t;const n=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s||!n||!a)return;let l;l="descriptions"===i?{brick:"eo-descriptions",errorBoundary:!0,properties:{column:2,list:a.map((e=>{const t={label:e.name};return e.config&&(t.useBrick=(0,Td.w)(e.config,e.id)),t})),dataSource:null==r?void 0:r[0]}}:{brick:"eo-next-table",errorBoundary:!0,properties:{rowKey:null===(t=a[0])||void 0===t?void 0:t.id,columns:a.map((e=>{const t={title:e.name,dataIndex:e.id,key:e.id};return e.config&&(t.useBrick=(0,Td.m)(e.config,".cellData")),t})),dataSource:{list:r,page:1,pageSize:20}}},n("yaml",{yaml:(0,Wl.safeDump)([l],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:Fp.A})}),[s,a,r,i]),h().createElement("div",{className:"container"},h().createElement("iframe",{ref:o,src:null!=n?n:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:c}))}ch=Ph,({e:[kh,Eh,xh,Nh,Ch,Mh,Th,Lh],c:[Oh,wh]}=(0,d.A)(ch,[Ih("visual-builder.pre-generated-config-preview",{styleTexts:[Up.A]})],[[Sh(),1,"previewUrl"],[Sh(),1,"container"],[Sh({attribute:!1}),1,"attrList"],[Sh({attribute:!1}),1,"mockList"]],0,void 0,m.ReactNextElement)),wh();var Bh=n(8406);function Uh(e){switch(e){case"list":return[{label:"表格",value:"table"},{label:"卡片列表",value:"cards"}];case"list-with-pagination":return[{label:"表格",value:"table",settings:{pagination:!0}},{label:"卡片列表",value:"cards",settings:{pagination:!0}}];case"object":return[{label:"属性详情",value:"descriptions"}];default:return[]}}customElements.define("visual-builder.get-config-by-data-for-ai",(0,ms.createProviderClass)((async function(e){if(null==(null==e?void 0:e.value))return null;const{value:t}=e;let n,i="unknown",a=[];if(Array.isArray(t))t.length>0&&(i="list",n=t[0],a=t);else if((0,kt.isObject)(t)){const e=t;(0,ms.hasOwnProperty)(e,"list")&&Array.isArray(e.list)&&(0,ms.hasOwnProperty)(e,"page")&&"number"==typeof e.page&&(0,ms.hasOwnProperty)(e,"total")&&"number"==typeof e.total?e.list.length>0&&(i="list-with-pagination",n=e.list[0],a=e.list):(i="object",n=t,a=[n])}const r=new Set;for(const e of a){if(!(0,kt.isObject)(e)){i="unknown";break}for(const t of Object.keys(e))r.add(t)}let o=[];if("unknown"!==i&&(0,kt.isObject)(n)&&(0,ms.hasOwnProperty)(n,"_object_id")&&"string"==typeof n._object_id){const e=n._object_id,{list:t}=await(0,Bh.y)("MODEL_OBJECT",{fields:["name","objectId","attrList.id","attrList.name","attrList.generatedView.list"],query:{objectId:e,ignore:{$ne:!0}},page:1});0===t.length?console.warn("Can not find object by objectId:",e):o=t[0].attrList.map((e=>{var t;return r.has(e.id)?{id:e.id,name:e.name,candidates:null===(t=e.generatedView)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.list}:null})).filter(Boolean)}else console.warn("Can not detect objectId with data:",e),o=[...r].map((e=>({id:e,name:e})));return{type:i,attrList:o,dataList:a,containerOptions:Uh(i)}})))},2080:(e,t,n)=>{n.d(t,{ADVANCED_CHANGE_KEY:()=>Te,SchemaField:()=>Le});var i,a=n(4635),r=n(918),o=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),p=n(8769),h=n.n(p),u=n(1123),m=n(9006),g=(n(6477),n(5908)),v=n(7091),b=n(7428),A=n(6768),f=n(5694),y=n(9708),w=n(3848),k=n(3768),E=n(2803),x=n(3824),N=n(2513),C=n(5067),M=n(1477),T=n(4287),L=n(966),I=n(5768),S=n(6110),O=n(5944),_=n(8409),R=n(2716),W=n(3995),D=(n(74),n(1030)),P=n.n(D);let $,B,U,F,V,j,z,X,K,J,H,q,Y,G,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,he,ue,me,ge,ve,be,Ae,fe,ye,we;const{defineElement:ke,property:Ee,method:xe,event:Ne}=(0,u.createDecorators)(),Ce=h().forwardRef(et),Me="before_submit",Te="on_advanced_change",Le=(0,v.Uy)({components:{FormLayout:y.Hb,Input:y.pd,FormItem:E.M,FormItemWithoutAdvanced:y.eI,FormCollapse:y.w9,NumberPicker:y.Y_,Radio:y.sx,Select:y.l6,Switch:y.dO,CategoryTitle:k.H,CodeEditor:x.S,IconSelect:N.r,ColorPicker:C.h,UseChildrenSelect:I._,InputWithUrl:M.r,InputWithUnit:L.U,TextAlignRadio:T.p,CustomOptions:O.F,BoxSize:S.i,CustomTab:_.v}});let Ie,Se;var Oe=new WeakMap,_e=new WeakMap,Re=new WeakMap,We=new WeakMap,De=new WeakMap,Pe=new WeakMap,$e=new WeakMap,Be=new WeakMap,Ue=new WeakMap,Fe=new WeakMap,Ve=new WeakSet,je=new WeakMap,ze=new WeakMap,Xe=new WeakMap,Ke=new WeakMap,Je=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ge=new WeakMap,Ze=new WeakMap;class Qe extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ve),(0,r.A)(this,Oe,($(this),(0,p.createRef)())),(0,r.A)(this,_e,U(this)),(0,r.A)(this,Re,(F(this),V(this))),(0,r.A)(this,We,(j(this),z(this))),(0,r.A)(this,De,(X(this),K(this))),(0,r.A)(this,Pe,(J(this),H(this))),(0,r.A)(this,$e,(q(this),Y(this))),(0,r.A)(this,Be,(G(this),Z(this))),(0,r.A)(this,Ue,(Q(this),ee(this))),(0,r.A)(this,Fe,(te(this),ne(this))),(0,r.A)(this,je,(re(this),oe(this))),(0,r.A)(this,ze,(ce(this),de(this))),(0,r.A)(this,Xe,(ue(this),e=>{(0,s.A)(Ve,this,pe).emit(e)})),(0,r.A)(this,Ke,me(this)),(0,r.A)(this,Je,(be(this),e=>{(0,s.A)(Ve,this,ge).emit(e)})),(0,r.A)(this,He,void 0),(0,r.A)(this,qe,(0,g.fA)(Me,((e,t)=>n=>{(0,l.A)(He,this,n(e,t))}))),(0,r.A)(this,Ye,Ae(this)),(0,r.A)(this,Ge,(we(this),e=>{(0,s.A)(Ve,this,fe).emit(e)})),(0,r.A)(this,Ze,(e=>{const t="string"==typeof e&&"undefined"===e?void 0:(0,D.omit)(e,["dataset.testid"]),n=[];(0,D.isEmpty)(null==t?void 0:t.dataset)&&n.push("dataset"),(0,D.isEmpty)(null==t?void 0:t.style)&&n.push("style");const i=(0,D.omit)(t,n);if(!(0,D.isEmpty)(i))return i}))}get editorName(){return(0,c.A)(_e,this)}set editorName(e){(0,l.A)(_e,this,e)}get values(){return(0,c.A)(Re,this)}set values(e){(0,l.A)(Re,this,e)}get advancedMode(){return(0,c.A)(We,this)}set advancedMode(e){(0,l.A)(We,this,e)}get dataList(){return(0,c.A)(De,this)}set dataList(e){(0,l.A)(De,this,e)}get editorPackages(){return(0,c.A)(Pe,this)}set editorPackages(e){(0,l.A)(Pe,this,e)}get links(){return(0,c.A)($e,this)}set links(e){(0,l.A)($e,this,e)}get extraLibs(){return(0,c.A)(Be,this)}set extraLibs(e){(0,l.A)(Be,this,e)}get childSlots(){return(0,c.A)(Ue,this)}set childSlots(e){(0,l.A)(Ue,this,e)}validate(){var e;const t=null===(e=(0,c.A)(Oe,this).current)||void 0===e?void 0:e.getFormInstance();(0,l.A)(He,this,null),t.validate().then((()=>{if(this.advancedMode)(0,s.A)(Ve,this,ie).emit(t.values[W.qZ]);else{var e;const n=P().omit(t.values,[W.qZ]);t.notify(Me,n),(0,s.A)(Ve,this,ie).emit(null!==(e=(0,c.A)(He,this))&&void 0!==e?e:n)}})).catch((e=>{(0,s.A)(Ve,this,se).emit(e)}))}render(){return h().createElement(Ce,{ref:(0,c.A)(Oe,this),editorName:this.editorName,values:(0,c.A)(Ze,this).call(this,this.values),advancedMode:this.advancedMode,dataList:this.dataList,extraLibs:this.extraLibs,links:this.links,childSlots:this.childSlots,editorPackages:this.editorPackages,handleValuesChange:(0,c.A)(Xe,this),handleTokenClick:(0,c.A)(Je,this),handleTriggerAction:(0,c.A)(Ge,this),onSubmitEffect:(0,c.A)(qe,this)})}}function et(e,t){let{advancedMode:n,values:i,editorName:a,dataList:r,editorPackages:o,extraLibs:s,childSlots:l,links:c,handleValuesChange:d,handleTokenClick:u,handleTriggerAction:m,onSubmitEffect:y}=e;const[k,E]=(0,p.useState)(Ie),x=(0,w.useCurrentTheme)(),N=(0,p.useMemo)((()=>(0,f.VC)()),[]),C=(0,p.useMemo)((()=>(0,g.DG)()),[k]),M=(0,p.useRef)(null),T=(0,p.useRef)(!1),L=(0,p.useMemo)((()=>(0,g.fA)(Te,((e,t)=>n=>{const i=!e&&t.values[W.qZ]?t.values[W.qZ]:t.values;M.current=n(e,t,i)}))),[]);(0,p.useImperativeHandle)(t,(()=>({getFormInstance:()=>C})));const I=(0,p.useCallback)((async()=>{R.customEditors.get(a)?E((()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(h())})):(await R.__secret_internals.loadEditors([a],o),Ie=()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(h())},E(Ie))}),[a,o]),S=(0,p.useCallback)(((e,t)=>{var n;if(t){const t=P().omit(e,[W.qZ]);return{[W.qZ]:P().isEmpty(t)?"":t}}return null!==(n=e[W.qZ])&&void 0!==n?n:e}),[]);return(0,p.useEffect)((()=>{I()}),[I]),(0,p.useEffect)((()=>{k&&C.setInitialValues(i,"overwrite")}),[k,C]),(0,p.useEffect)((()=>{var e;T.current=!0,M.current=null,C.notify(Te,n),C.query(W.N4).take((e=>{e.display=n?"hidden":"visible"})),C.query(W.qZ).take((e=>{e.display=n?"visible":"hidden"}));const t=C.getState().values,i=S(null!==(e=M.current)&&void 0!==e?e:t,n);C.setValues(i,"overwrite"),T.current=!1}),[n,C,S,k]),(0,p.useEffect)((()=>{C.addEffects("onValueChange",(()=>{(0,g.A$)((e=>{T.current||d(e.values)}))}))}),[C,d]),k?h().createElement("div",{className:"property-form-wrapper"},h().createElement(b.Ay,{prefixCls:"antdV5",theme:{algorithm:"dark-v2"===x?A.A.darkAlgorithm:A.A.defaultAlgorithm,components:{InputNumber:{handleVisible:!0}}},getPopupContainer:e=>e},h().createElement(f.N7,{cache:N},h().createElement(v.Op,{form:C},h().createElement(k,{advancedMode:n,SchemaFieldComponent:Le,form:C,scope:{dataList:r,advancedMode:n,childSlots:l,extraLibs:s,links:c,tokenClick:e=>u(e.detail),triggerAction:m},effects:{onFieldInit:g.yd,onFieldValueChange:g.$l,onFieldInitialValueChange:g.J4,onFormInitialValuesChange:g.oJ,onFormValidateSuccess:g.zu,onFormValuesChange:g.A$,onSubmit:y,onAdvancedChange:L},formilySchemaFormatter:W.cV}))))):null}i=Qe,({e:[U,F,V,j,z,X,K,J,H,q,Y,G,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,he,ue,me,ge,ve,be,Ae,fe,ye,we,$],c:[Se,B]}=(0,d.A)(i,[ke("visual-builder.property-editor",{shadowOptions:!1,dependencies:["eo-icon-select","vs.code-editor","eo-tooltip"]})],[[Ee(),1,"editorName"],[Ee({attribute:!1}),1,"values"],[Ee({type:Boolean}),1,"advancedMode"],[Ee({attribute:!1}),1,"dataList"],[Ee({attribute:!1}),1,"editorPackages"],[Ee({attribute:!1}),1,"links"],[Ee({attribute:!1}),1,"extraLibs"],[Ee({attribute:!1}),1,"childSlots"],[Ne({type:"validate.success"}),1,"successEvent",e=>(0,c.A)(Fe,e),(e,t)=>(0,l.A)(Fe,e,t)],[Ne({type:"validate.error"}),1,"errorEvent",e=>(0,c.A)(je,e),(e,t)=>(0,l.A)(je,e,t)],[xe(),2,"validate"],[Ne({type:"values.change"}),1,"valuesChangeEvent",e=>(0,c.A)(ze,e),(e,t)=>(0,l.A)(ze,e,t)],[Ne({type:"token.click"}),1,"tokenClick",e=>(0,c.A)(Ke,e),(e,t)=>(0,l.A)(Ke,e,t)],[Ne({type:"trigger.action"}),1,"triggerActionEvent",e=>(0,c.A)(Ye,e),(e,t)=>(0,l.A)(Ye,e,t)]],0,(e=>Ze.has((0,o.A)(e))),m.ReactNextElement)),B()},607:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-list-background:#f8f8f8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-list-background:#323237}',""]);const s=o},2984:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-color:#616161;--vb-workbench-action-active-color:#1f1f1f;--vb-workbench-action-active-border-color:#005fb8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-color:rgba(255,255,255,0.4);--vb-workbench-action-active-color:#fff;--vb-workbench-action-active-border-color:#fff}',""]);const s=o},7236:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r),s=n(6131),l=o()(a());l.i(s.A),l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.message{display:flex;gap:8px}.main{flex:1;min-width:0}.label{font-weight:bold;line-height:28px}.message:not(:last-child){margin-bottom:2em}.invisible-dots{opacity:0}.failed .content{color:var(--color-error)}.command:not(:first-child){margin-top:1em}.command:not(:last-child){margin-bottom:1em}pre{white-space:pre-wrap;background-color:var(--palette-gray-3);border-radius:6px;padding:1em}.markdown > :first-child{margin-top:0}.markdown > :last-child{margin-bottom:0}.avatar{align-self:flex-start;display:flex;align-items:center;justify-content:center}.texting::after{content:" ";animation:texting 2s infinite;white-space:pre}@keyframes texting{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}pre[class*="language-"]{overflow:visible}pre[class*="language-"],\ncode[class*="language-"]{white-space:pre-wrap}eo-avatar.role-assistant::part(avatar-icon){background-color:var(--palette-blue-5)}.content{word-wrap:break-word}.plain{white-space:pre-wrap}',""]);const c=l.toString()},1563:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=o.toString()},6213:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.contract-wrapper{display:flex;gap:4px}.contract-selector{flex:1}.version-selector{width:100px}.options-tips{padding:0px 10px;font-weight:400;color:#999;white-space:nowrap;font-style:italic}",""]);const s=o.toString()},7540:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.mask,\n.container{display:none;position:fixed;z-index:1}.mask{top:0;bottom:0;left:0;right:0;z-index:1}:host([active]) .mask,\n:host([active]) .container{display:block}.container{background:var(--antd-dropdown-menu-bg);border-radius:var(--medius-border-radius);padding:5px}.container .title{padding:5px 12px;cursor:default;color:var(--color-secondary-text);border-bottom:1px solid var(--color-text-divider-line)}.container eo-menu{border:none;padding:5px 0}.container eo-menu eo-menu-item:not([disabled]):hover::part(menu-item){background-color:var(--left-sidebar-item-hover-bg)}.container eo-menu eo-menu-item[disabled]::part(menu-item){cursor:not-allowed}.container eo-menu eo-menu-item::part(menu-item){cursor:grab;padding:5px 12px;border-radius:var(--medius-border-radius);min-width:max-content}.container eo-menu eo-menu-item.dragging{opacity:0.5}.container eo-menu eo-tooltip{display:block}",""]);const s=o.toString()},2381:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{--local-node-outline-style:solid;display:block}:host([hidden]){display:none}:host([not-synced]){--local-node-outline-style:dashed}*{box-sizing:border-box}.node{width:168px;max-width:none;height:130px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-moz-fit-content;width:fit-content;padding-bottom:4px}.label,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:18px;font-size:var(--sub-title-font-size-small);color:var(--color-header-text);font-weight:var(--font-weight-500);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.node.editing-label .label{height:0}.node:not(.editing-label) .label-input{display:none}.add-button,\n.icon-container,\n.thumbnail-container,\n.thumbnail-placeholder{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px var(--local-node-outline-style) var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;width:100%;position:relative;flex-direction:column}.thumbnail-placeholder{color:var(--palette-gray-5);font-size:36px;flex:1}.icon-container{font-size:20px;background-color:var(--palette-teal-6);color:var(--palette-gray-4);width:36px;height:36px;border-radius:50%;outline-offset:4px}:host([active]) .thumbnail-container,\n:host([active]) .icon-container{outline:2px var(--local-node-outline-style) var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px var(--local-node-outline-style) var(--palette-blue-3)}.add-button{position:absolute;bottom:-26px;left:calc(50% - 12px);width:24px;height:24px;background:var(--palette-gray-3);color:var(--palette-gray-6);border-radius:50%;cursor:pointer}:host([not-synced]) .add-button,\n:host([disable-child-append]) .add-button,\n:host(:not([active])) .add-button{display:none}.add-button:hover{background:var(--palette-blue-5);color:var(--palette-gray-2)}.external{position:absolute;top:4px;left:4px;padding:0 10px;display:flex;align-items:center;gap:6px;background:var(--palette-purple-4);font-size:12px;line-height:20px;height:22px;cursor:pointer;color:var(--palette-gray-1);border-radius:9999px;right:4px;max-width:-moz-fit-content;max-width:fit-content}.external-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.external:hover{background:var(--palette-purple-5)}.sub-nodes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;width:100%}.sub-node{background-color:var(--palette-gray-2);border-radius:4px;padding:6px;display:flex;flex-direction:column;justify-content:space-between;height:32px}.sub-node-skeleton-title{width:18px;height:4px;border-radius:2px;align-self:flex-start;background-color:var(--palette-gray-4)}.sub-node-skeleton-content{width:100%;height:4px;border-radius:2px;background-color:var(--palette-gray-4)}.sub-node-skeleton-button{width:18px;height:4px;border-radius:2px;align-self:flex-end;background-color:var(--palette-blue-3)}.sub-node:hover{background-color:var(--palette-gray-3)}.sub-node:hover .sub-node-skeleton-title,\n.sub-node:hover .sub-node-skeleton-content{background-color:var(--palette-gray-5)}.sub-node:hover .sub-node-skeleton-button{background-color:var(--palette-blue-4)}",""]);const s=o.toString()},2120:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"#preview-root{padding:0}",""]);const s=o.toString()},8488:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},4967:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}",""]);const s=o.toString()},8918:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold}.head-cell,\n.body-cell{background:var(--body-background)}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}",""]);const s=o.toString()},4014:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},9216:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:grid;width:100%}:host([hidden]){display:none}::slotted(*){padding:4px 8px;border:1px solid var(--theme-gray-border-color);border-left-color:transparent;border-top-color:transparent;min-width:0;word-break:break-word}",""]);const s=o.toString()},4162:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold}.head-cell,\n.body-cell{background:var(--body-background)}.body-cell{display:flex;align-items:center;justify-content:space-between}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}.list{display:flex;flex-direction:column;gap:8px;overflow:hidden}.raw-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-color-secondary)}.raw-content.expand{white-space:pre-wrap}.tips{color:var(--text-color-secondary);font-weight:normal}.body-cell:not(:hover) .btn-toggle{visibility:hidden}",""]);const s=o.toString()},9034:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},9765:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,".custom-scrollbar-container{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.15) rgba(255,255,255,0.03)}.custom-scrollbar-container::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;position:absolute}.custom-scrollbar-container::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0);border-radius:4px}.custom-scrollbar-container:hover::-webkit-scrollbar-track{background-color:rgba(255,255,255,0.03)}.custom-scrollbar-container:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.15)}",""]);const s=o.toString()},3430:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:none;background-color:var(--vb-workbench-action-list-background)}:host([hidden]){display:none}",""]);const s=o.toString()},5292:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:var(--vb-workbench-action-color);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:var(--vb-workbench-action-active-border-color)}.action.active::part(link),\n.action::part(link):hover{color:var(--vb-workbench-active-color)}',""]);const s=o.toString()},1361:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}eo-popover::part(popup){width:800px;max-width:60vw;padding:10px;background:var(--color-fill-bg-container-4);border-radius:var(--medius-border-radius);box-shadow:var(--feedback-container-shadow);z-index:1000}.history-title{font-size:var(--title-font-size);font-weight:var(--font-weight-500);color:var(--color-strong-text);margin-bottom:5px}.history-list{max-height:500px;overflow-y:auto}.item-container{padding:10px 0;display:flex;flex-direction:column;gap:5px}.empty{padding:5px 0 10px 0;font-size:14px;color:var(--text-color-secondary);text-align:center}.item-container:not(:last-of-type){border-bottom:1px solid var(--color-border-divider-line)}.item-title{display:flex;align-items:center;justify-content:space-between;gap:5px}.title-left,\n.title-right{display:flex;align-items:center}.title-left{cursor:pointer;overflow:hidden;gap:5px}.topic{font-size:14px;color:var(--text-color-title);font-weight:var(--font-weight-500);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.branch{font-size:14px;color:var(--text-color-secondary)}.rollback{margin-right:5px;font-size:14px;color:var(--text-color-secondary);cursor:pointer}.rollback:hover{color:var(--color-brand)}.item-info{display:flex;align-items:center;gap:5px}.time,\n.operator{font-size:14px;color:var(--text-color-secondary)}.load-more-container{display:block;text-align:center}.end-container{display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;color:var(--color-brand)}.rollback-all{cursor:pointer}",""]);const s=o.toString()},7180:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':host{display:block;--pane-color:#595959}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--pane-color:#ccc}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.pane{display:flex;flex-direction:column;color:var(--pane-color);height:100%}.pane-header{display:flex;align-items:center;cursor:pointer;border-top:1px solid transparent;position:relative}.pane-header:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#007fd4}:host(:not(:first-child)) .pane-header{border-top-color:rgba(204,204,204,0.2)}.pane-scroll-shadow{display:none;position:absolute;bottom:-3px;left:0;right:0;height:3px;box-shadow:#000000 0 6px 6px -6px inset;z-index:1}.scrolled .pane-scroll-shadow{display:block}.pane-title{display:flex;align-items:center;font-size:13px;line-height:24px;height:25px;min-width:0;flex:1}.title-icon{display:flex;justify-content:center;align-items:center;width:24px;padding-right:2px;line-height:1;flex-shrink:0}.title-label{text-transform:uppercase;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-body{flex-grow:1;min-height:0;display:none;overflow:hidden;overflow-y:auto;overflow-y:overlay}:host([active]) .pane-body{display:initial}:host(:not(:hover)) ::slotted([slot="actions"]){display:none}.badge{background-color:rgb(77,77,77);color:rgb(255,255,255);border-radius:11px;height:18px;padding:3px 6px;line-height:13px;margin:0 3px;font-size:12px}',""]);const s=o.toString()},2150:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':host{--sidebar-background:#fff;--title-container-background:#fff;--title-container-color:#595959;display:block;outline-color:rgba(83,89,93,0.5);background-color:var(--sidebar-background);height:100%}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--sidebar-background:#181818;--title-container-background:#181818;--title-container-color:rgb(187,187,187);background-color:var(--sidebar-background)}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.sidebar{display:flex;flex-direction:column;height:100%}.title-container{display:flex;padding:0 8px 8px 8px;color:var(--title-container-color);background:var(--title-container-background)}.title-label{font-weight:300;line-height:44px;padding-left:12px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-container{flex-grow:1;min-height:0;display:flex;flex-direction:column}::slotted([slot="panes"]){transition:flex 0.2s;min-height:25px}',""]);const s=o.toString()},6131:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r),s=n(7745),l=o()(a());l.i(s.A),l.push([e.id,"",""]);const c=l.toString()}}]);
|
|
2
|
-
//# sourceMappingURL=2464.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[2464,5238],{2464:(e,t,n)=>{var i,a=n(4635),r=n(918),o=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),p=n(8769),h=n.n(p),u=n(1123),m=n(9006),g=n(7180),v=n(9765),b=n(8013),A=n(3373),f=n.n(A);let y,w,k,E,x,N,C,M,T,L,I,S,O,_,R;const W=(0,m.wrapBrick)("eo-icon"),{defineElement:D,property:P,event:$}=(0,u.createDecorators)();let B;var U=new WeakMap,F=new WeakMap,V=new WeakMap,j=new WeakMap,z=new WeakSet,X=new WeakMap,K=new WeakMap,J=new WeakMap;class H extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,z),(0,r.A)(this,U,w(this)),(0,r.A)(this,F,(k(this),E(this))),(0,r.A)(this,V,(x(this),N(this))),(0,r.A)(this,j,(C(this),M(this))),(0,r.A)(this,X,(I(this),e=>{e!==this.active&&(this.active=e,(0,s.A)(z,this,T).emit(e))})),(0,r.A)(this,K,S(this)),(0,r.A)(this,J,(R(this),()=>{(0,s.A)(z,this,O).emit()}))}get titleLabel(){return(0,c.A)(U,this)}set titleLabel(e){(0,l.A)(U,this,e)}get active(){return(0,c.A)(F,this)}set active(e){(0,l.A)(F,this,e)}get badge(){return(0,c.A)(V,this)}set badge(e){(0,l.A)(V,this,e)}render(){return h().createElement(q,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,c.A)(X,this),onFirstActivated:(0,c.A)(J,this)})}}function q(e){let{titleLabel:t,active:n,badge:i,onActiveChange:a,onFirstActivated:r}=e;const[o,s]=(0,p.useState)(n),[l,c]=(0,p.useState)(!1);(0,p.useEffect)((()=>{s(n)}),[n]),(0,p.useEffect)((()=>{null==a||a(o)}),[o,a]);const d=(0,p.useCallback)((()=>{s((e=>!e)),l||o||(c(!0),null==r||r())}),[l,o,r]),u=(0,p.useRef)(),[m,g]=(0,p.useState)(!1),v=(0,p.useMemo)((()=>(0,b.G)((()=>{g(u.current.scrollTop>0)}))),[]);return h().createElement("div",{className:f()("pane",{scrolled:m})},h().createElement("div",{className:"pane-header",tabIndex:0,onClick:d},h().createElement("div",{className:"pane-title"},h().createElement("span",{className:"title-icon"},o?h().createElement(W,{lib:"antd",theme:"outlined",icon:"down"}):h().createElement(W,{lib:"antd",theme:"outlined",icon:"right"})),h().createElement("div",{className:"title-label"},t),h().createElement("slot",{name:"title"})),h().createElement("slot",{name:"actions"}),i&&h().createElement("div",{className:"badge"},i),h().createElement("div",{className:"pane-scroll-shadow"})),h().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:v,ref:u},h().createElement("slot",null,h().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}i=H,({e:[w,k,E,x,N,C,M,T,L,I,S,O,_,R],c:[B,y]}=(0,d.A)(i,[D("visual-builder.workbench-pane",{styleTexts:[g.A,v.A]})],[[P(),1,"titleLabel"],[P({type:Boolean}),1,"active"],[P({type:Number}),1,"badge"],[$({type:"active.change"}),1,"activeChangeEvent",e=>(0,c.A)(j,e),(e,t)=>(0,l.A)(j,e,t)],[$({type:"active.firstActivated"}),1,"activeFirstActivatedEvent",e=>(0,c.A)(K,e),(e,t)=>(0,l.A)(K,e,t)]],0,(e=>J.has((0,o.A)(e))),m.ReactNextElement)),y();var Y,G=n(4586),Z=n(2150);let Q,ee,te;const{defineElement:ne,property:ie}=(0,u.createDecorators)();let ae;var re=new WeakMap,oe=new WeakMap,se=new WeakMap,le=new WeakMap;class ce extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,re,ee(this)),(0,r.A)(this,oe,(te(this),()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")})),(0,r.A)(this,se,(()=>{const e=(0,c.A)(oe,this).call(this).assignedNodes();for(const n of e){var t;n.active?n.style.flex=String(null!==(t=n.activeFlex)&&void 0!==t?t:"1"):n.style.flex="initial"}})),(0,r.A)(this,le,(e=>{const t=e.target.assignedNodes();for(const e of t)e.addEventListener("active.change",(0,c.A)(se,this))})),(0,G.A)(this,"refCallback",(()=>{(0,c.A)(se,this).call(this);const e=(0,c.A)(oe,this).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,c.A)(le,this).call(this,e)}))}))}get titleLabel(){return(0,c.A)(re,this)}set titleLabel(e){(0,l.A)(re,this,e)}render(){return h().createElement(de,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function de(e){let{titleLabel:t,refCallback:n}=e;return h().createElement("div",{className:"sidebar",ref:n},h().createElement("div",{className:"title-container"},h().createElement("div",{className:"title-label"},t),h().createElement("slot",{name:"titleToolbar"})),h().createElement("div",{className:"pane-container"},h().createElement("slot",null)))}Y=ce,({e:[ee,te],c:[ae,Q]}=(0,d.A)(Y,[ne("visual-builder.workbench-sidebar",{styleTexts:[Z.A]})],[[ie(),1,"titleLabel"]],0,void 0,m.ReactNextElement)),Q();var pe=n(2591),he=n.n(pe),ue=n(1740),me=n.n(ue),ge=n(8128),ve=n.n(ge),be=n(855),Ae=n.n(be),fe=n(3051),ye=n.n(fe),we=n(3656),ke=n.n(we),Ee=n(2984),xe={};xe.styleTagTransform=ke(),xe.setAttributes=Ae(),xe.insert=ve().bind(null,"head"),xe.domAPI=me(),xe.insertStyleElement=ye(),he()(Ee.A,xe),Ee.A&&Ee.A.locals&&Ee.A.locals;var Ne,Ce=n(5292);let Me,Te,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be;const{defineElement:Ue,property:Fe}=(0,u.createDecorators)(),Ve=(0,m.wrapBrick)("eo-link"),je=(0,m.wrapBrick)("eo-icon"),ze=(0,m.wrapBrick)("eo-tooltip");let Xe;var Ke=new WeakMap,Je=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ge=new WeakMap;class Ze extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Ke,Te(this)),(0,r.A)(this,Je,(Le(this),Ie(this))),(0,r.A)(this,He,(Se(this),Oe(this))),(0,r.A)(this,qe,(_e(this),Re(this))),(0,r.A)(this,Ye,(We(this),De(this))),(0,r.A)(this,Ge,(Pe(this),$e(this))),Be(this)}get icon(){return(0,c.A)(Ke,this)}set icon(e){(0,l.A)(Ke,this,e)}get to(){return(0,c.A)(Je,this)}set to(e){(0,l.A)(Je,this,e)}get active(){return(0,c.A)(He,this)}set active(e){(0,l.A)(He,this,e)}get href(){return(0,c.A)(qe,this)}set href(e){(0,l.A)(qe,this,e)}get target(){return(0,c.A)(Ye,this)}set target(e){(0,l.A)(Ye,this,e)}get tooltip(){return(0,c.A)(Ge,this)}set tooltip(e){(0,l.A)(Ge,this,e)}render(){return h().createElement(Qe,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target,tooltip:this.tooltip})}}function Qe(e){let{icon:t,to:n,active:i,href:a,target:r,tooltip:o}=e;return h().createElement(ze,{content:o,placement:"right"},h().createElement(Ve,{className:f()("action",{active:i}),url:n,href:a,target:r},h().createElement(je,t)))}Ne=Ze,({e:[Te,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be],c:[Xe,Me]}=(0,d.A)(Ne,[Ue("visual-builder.workbench-action",{styleTexts:[Ce.A]})],[[Fe({attribute:!1}),1,"icon"],[Fe(),1,"to"],[Fe({type:Boolean}),1,"active"],[Fe(),1,"href"],[Fe(),1,"target"],[Fe(),1,"tooltip"]],0,void 0,m.ReactNextElement)),Me();var et=n(2716),tt=n(63),nt=n(607),it={};it.styleTagTransform=ke(),it.setAttributes=Ae(),it.insert=ve().bind(null,"head"),it.domAPI=me(),it.insertStyleElement=ye(),he()(nt.A,it),nt.A&&nt.A.locals&&nt.A.locals;var at,rt=n(3430);let ot,st,lt,ct,dt;const pt=(0,m.wrapBrick)("visual-builder.workbench-action"),{defineElement:ht,property:ut}=(0,u.createDecorators)();let mt;var gt=new WeakMap,vt=new WeakMap;class bt extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,gt,st(this)),(0,r.A)(this,vt,(lt(this),ct(this))),dt(this)}get appId(){return(0,c.A)(gt,this)}set appId(e){(0,l.A)(gt,this,e)}get menu(){return(0,c.A)(vt,this)}set menu(e){(0,l.A)(vt,this,e)}render(){return h().createElement(yt,{appId:this.appId,menu:this.menu})}}let At;at=bt,({e:[st,lt,ct,dt],c:[mt,ot]}=(0,d.A)(at,[ht("visual-builder.workbench-action-list",{styleTexts:[rt.A]})],[[ut(),1,"appId"],[ut({attribute:!1}),1,"menu"]],0,void 0,m.ReactNextElement)),ot();const ft=new Map;function yt(e){var t;let{appId:n,menu:i}=e;const a=(0,et.getHistory)(),[r,o]=(0,p.useState)(),[s,l]=(0,p.useState)(a.location);return(0,p.useEffect)((()=>{const e=a.listen((e=>{l(e)}));return e}),[a]),(0,p.useEffect)((()=>{At||(At=n),At!==n&&(ft.clear(),At=n)}),[n]),(0,p.useEffect)((()=>{var e;const{pathname:t,search:n}=s,{selectedKeys:a}=(0,tt.LP)(null!==(e=null==i?void 0:i.menuItems)&&void 0!==e?e:[],t,n,"");o(Number(a[0]))}),[i,s]),h().createElement(h().Fragment,null,null==i||null===(t=i.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){let n=e.to;return r!==t&&ft.has(t)&&(n=ft.get(t)),h().createElement(pt,{key:t,icon:e.icon,to:n,href:e.href,target:e.target,tooltip:e.text,active:r===t,onClick:()=>(e=>{e.href||ft.set(r,`${s.pathname}${s.search}`)})(e)})}})).filter(Boolean))}var wt,kt=n(1030),Et=n(4940),xt=n(7758),Nt=n(9406),Ct=n(675),Mt=n(7995),Tt=n(6275);let Lt,It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,Vt,jt,zt,Xt,Kt,Jt,Ht,qt,Yt,Gt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,hn,un,mn,gn,vn,bn,An,fn,yn,wn,kn,En,xn,Nn,Cn,Mn,Tn,Ln,In,Sn,On;function _n(e){return e.key}n(6477);const{defineElement:Rn,property:Wn,event:Dn}=(0,u.createDecorators)();let Pn;var $n=new WeakMap,Bn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Vn=new WeakMap,jn=new WeakMap,zn=new WeakMap,Xn=new WeakMap,Kn=new WeakMap,Jn=new WeakMap,Hn=new WeakMap,qn=new WeakMap,Yn=new WeakMap,Gn=new WeakMap,Zn=new WeakMap,Qn=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ii=new WeakSet,ai=new WeakMap,ri=new WeakMap,oi=new WeakMap,si=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,pi=new WeakMap,hi=new WeakMap;class ui extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ii),(0,r.A)(this,$n,It(this)),(0,r.A)(this,Bn,(St(this),Ot(this))),(0,r.A)(this,Un,(_t(this),Rt(this))),(0,r.A)(this,Fn,(Wt(this),Dt(this))),(0,r.A)(this,Vn,(Pt(this),$t(this))),(0,r.A)(this,jn,(Bt(this),Ut(this))),(0,r.A)(this,zn,(Ft(this),Vt(this))),(0,r.A)(this,Xn,(jt(this),zt(this))),(0,r.A)(this,Kn,(Xt(this),Kt(this))),(0,r.A)(this,Jn,(Jt(this),Ht(this))),(0,r.A)(this,Hn,(qt(this),Yt(this))),(0,r.A)(this,qn,(Gt(this),Zt(this))),(0,r.A)(this,Yn,(Qt(this),en(this))),(0,r.A)(this,Gn,(tn(this),nn(this))),(0,r.A)(this,Zn,(an(this),rn(this))),(0,r.A)(this,Qn,(on(this),sn(this))),(0,r.A)(this,ei,(ln(this),cn(this))),(0,r.A)(this,ti,(dn(this),pn(this))),(0,r.A)(this,ni,(hn(this),un(this))),(0,r.A)(this,ai,(vn(this),e=>{(0,s.A)(ii,this,mn).emit(e)})),(0,r.A)(this,ri,bn(this)),(0,r.A)(this,oi,(yn(this),e=>()=>{(0,s.A)(ii,this,An).emit(e.data)})),(0,r.A)(this,si,wn(this)),(0,r.A)(this,li,(xn(this),e=>{(0,s.A)(ii,this,kn).emit(e)})),(0,r.A)(this,ci,Nn(this)),(0,r.A)(this,di,(Tn(this),e=>t=>{t.preventDefault(),(0,s.A)(ii,this,Cn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,r.A)(this,pi,Ln(this)),(0,r.A)(this,hi,(On(this),(e,t)=>{(0,s.A)(ii,this,In).emit({nodeId:e,collapsed:t})}))}get nodes(){return(0,c.A)($n,this)}set nodes(e){(0,l.A)($n,this,e)}get actions(){return(0,c.A)(Bn,this)}set actions(e){(0,l.A)(Bn,this,e)}get actionsHidden(){return(0,c.A)(Un,this)}set actionsHidden(e){(0,l.A)(Un,this,e)}get placeholder(){return(0,c.A)(Fn,this)}set placeholder(e){(0,l.A)(Fn,this,e)}get isTransformName(){return(0,c.A)(Vn,this)}set isTransformName(e){(0,l.A)(Vn,this,e)}get searchPlaceholder(){return(0,c.A)(jn,this)}set searchPlaceholder(e){(0,l.A)(jn,this,e)}get noSearch(){return(0,c.A)(zn,this)}set noSearch(e){(0,l.A)(zn,this,e)}get activeKey(){return(0,c.A)(Xn,this)}set activeKey(e){(0,l.A)(Xn,this,e)}get showMatchedNodeOnly(){return(0,c.A)(Kn,this)}set showMatchedNodeOnly(e){(0,l.A)(Kn,this,e)}get matchNodeDataFields(){return(0,c.A)(Jn,this)}set matchNodeDataFields(e){(0,l.A)(Jn,this,e)}get fixedActionsFor(){return(0,c.A)(Hn,this)}set fixedActionsFor(e){(0,l.A)(Hn,this,e)}get collapsible(){return(0,c.A)(qn,this)}set collapsible(e){(0,l.A)(qn,this,e)}get collapsedNodes(){return(0,c.A)(Yn,this)}set collapsedNodes(e){(0,l.A)(Yn,this,e)}get allowDrag(){return(0,c.A)(Gn,this)}set allowDrag(e){(0,l.A)(Gn,this,e)}get allowDragToRoot(){return(0,c.A)(Zn,this)}set allowDragToRoot(e){(0,l.A)(Zn,this,e)}get allowDragToInside(){return(0,c.A)(Qn,this)}set allowDragToInside(e){(0,l.A)(Qn,this,e)}get nodeKey(){return(0,c.A)(ei,this)}set nodeKey(e){(0,l.A)(ei,this,e)}get skipNotify(){return(0,c.A)(ti,this)}set skipNotify(e){(0,l.A)(ti,this,e)}render(){return h().createElement(Et.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,c.A)(ai,this)}},h().createElement(Nt.N.Provider,{value:{activeKey:this.activeKey,basePaddingLeft:5,showMatchedNodeOnly:this.showMatchedNodeOnly,isTransformName:this.isTransformName,fixedActionsFor:this.fixedActionsFor,nodeKey:this.nodeKey,collapsible:this.collapsible,collapsedNodes:this.collapsedNodes,getCollapsedId:_n,onNodeToggle:(0,c.A)(hi,this),skipNotify:this.skipNotify,clickFactory:(0,c.A)(oi,this),contextMenuFactory:(0,c.A)(di,this),matchNode:(e,t)=>{var n;return(0,Ct.U)(e.name,t)||!(null===(n=this.matchNodeDataFields)||void 0===n||!n.length)&&(0,Ct.U)("*"===this.matchNodeDataFields?e.data:(0,kt.pick)(e.data,this.matchNodeDataFields),t)}}},h().createElement(xt.cU,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,c.A)(li,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}wt=ui,({e:[It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,Vt,jt,zt,Xt,Kt,Jt,Ht,qt,Yt,Gt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,hn,un,mn,gn,vn,bn,An,fn,yn,wn,kn,En,xn,Nn,Cn,Mn,Tn,Ln,In,Sn,On],c:[Pn,Lt]}=(0,d.A)(wt,[Rn("visual-builder.workbench-tree",{styleTexts:[Mt.A,Tt.A]})],[[Wn({attribute:!1}),1,"nodes"],[Wn({attribute:!1}),1,"actions"],[Wn({type:Boolean}),1,"actionsHidden"],[Wn(),1,"placeholder"],[Wn({type:Boolean}),1,"isTransformName"],[Wn(),1,"searchPlaceholder"],[Wn({type:Boolean}),1,"noSearch"],[Wn({attribute:!1}),1,"activeKey"],[Wn({type:Boolean}),1,"showMatchedNodeOnly"],[Wn({attribute:!1}),1,"matchNodeDataFields"],[Wn({attribute:!1}),1,"fixedActionsFor"],[Wn({type:Boolean}),1,"collapsible"],[Wn({attribute:!1}),1,"collapsedNodes"],[Wn({type:Boolean}),1,"allowDrag"],[Wn({type:Boolean}),1,"allowDragToRoot"],[Wn({type:Boolean}),1,"allowDragToInside"],[Wn({type:String}),1,"nodeKey"],[Wn({type:Boolean}),1,"skipNotify"],[Dn({type:"action.click"}),1,"actionClickEvent",e=>(0,c.A)(ni,e),(e,t)=>(0,l.A)(ni,e,t)],[Dn({type:"node.click"}),1,"nodeClickEvent",e=>(0,c.A)(ri,e),(e,t)=>(0,l.A)(ri,e,t)],[Dn({type:"node.drop"}),1,"nodeDropEvent",e=>(0,c.A)(si,e),(e,t)=>(0,l.A)(si,e,t)],[Dn({type:"context.menu"}),1,"nodeContextMenuEvent",e=>(0,c.A)(ci,e),(e,t)=>(0,l.A)(ci,e,t)],[Dn({type:"node.toggle"}),1,"nodeToggleEvent",e=>(0,c.A)(pi,e),(e,t)=>(0,l.A)(pi,e,t)]],0,(e=>hi.has((0,o.A)(e))),m.ReactNextElement)),Lt();var mi=n(155),gi=n.n(mi),vi=n(1361),bi=n(9704);let Ai=function(e){return e.LOAD_MORE="LOAD_MORE",e.LOADING="LOADING",e.NO_DATA="NO_DATA",e.NODE="NODE",e.ADD="ADD",e.EDIT="EDIT",e.DELETE="DELETE",e.IMPORT="IMPORT",e.CLONE="CLONE",e.APPEND_RELATION="APPEND_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REMOVE_RELATION="REMOVE_RELATION",e.ROLLBACK="ROLLBACK",e.ROLLBACK_ALL="ROLLBACK_ALL",e.ADD_FULL="ADD_FULL",e.EDIT_FULL="EDIT_FULL",e.DELETE_FULL="DELETE_FULL",e.IMPORT_FULL="IMPORT_FULL",e.CLONE_FULL="CLONE_FULL",e.APPEND_RELATION_FULL="APPEND_RELATION_FULL",e.UPDATE_RELATION_FULL="UPDATE_RELATION_FULL",e.REMOVE_RELATION_FULL="REMOVE_RELATION_FULL",e.ROLLBACK_FULL="ROLLBACK_FULL",e.ROLLBACK_ALL_FULL="ROLLBACK_ALL_FULL",e.PROJECT="PROJECT",e.USER="USER",e.PERMISSION="PERMISSION",e.BRICK="BRICK",e.ROUTE="ROUTE",e.TEMPLATE="TEMPLATE",e.SNIPPET="SNIPPET",e.I18N="I18N",e.IMAGE="IMAGE",e.FUNCTION="FUNCTION",e.MENU="MENU",e.MENU_ITEM="MENU_ITEM",e.WORKFLOW="WORKFLOW",e}({});const fi="bricks/visual-builder/workbench-history-action";var yi=n(4107),wi=n(9733);const ki={add:`${fi}:${Ai.ADD}`,edit:`${fi}:${Ai.EDIT}`,delete:`${fi}:${Ai.DELETE}`,batch_delete:`${fi}:${Ai.DELETE}`,import:`${fi}:${Ai.IMPORT}`,clone:`${fi}:${Ai.CLONE}`,append_relation:`${fi}:${Ai.APPEND_RELATION}`,update_relation:`${fi}:${Ai.UPDATE_RELATION}`,remove_relation:`${fi}:${Ai.REMOVE_RELATION}`,rollback:`${fi}:${Ai.ROLLBACK}`,rollback_all:`${fi}:${Ai.ROLLBACK_ALL}`},Ei={add:`${fi}:${Ai.ADD_FULL}`,edit:`${fi}:${Ai.EDIT_FULL}`,delete:`${fi}:${Ai.DELETE_FULL}`,batch_delete:`${fi}:${Ai.DELETE_FULL}`,import:`${fi}:${Ai.IMPORT_FULL}`,clone:`${fi}:${Ai.CLONE_FULL}`,append_relation:`${fi}:${Ai.APPEND_RELATION_FULL}`,update_relation:`${fi}:${Ai.UPDATE_RELATION_FULL}`,remove_relation:`${fi}:${Ai.REMOVE_RELATION_FULL}`,rollback:`${fi}:${Ai.ROLLBACK_FULL}`,rollback_all:`${fi}:${Ai.ROLLBACK_ALL_FULL}`},xi={project:`${fi}:${Ai.PROJECT}`,userGroup:`${fi}:${Ai.USER}`,permission:`${fi}:${Ai.PERMISSION}`,brick:`${fi}:${Ai.BRICK}`,route:`${fi}:${Ai.ROUTE}`,template:`${fi}:${Ai.TEMPLATE}`,snippet:`${fi}:${Ai.SNIPPET}`,i18n:`${fi}:${Ai.I18N}`,image:`${fi}:${Ai.IMAGE}`,function:`${fi}:${Ai.FUNCTION}`,menu:`${fi}:${Ai.MENU}`,menuItem:`${fi}:${Ai.MENU_ITEM}`,workflow:`${fi}:${Ai.WORKFLOW}`},Ni={PROJECT_MICRO_APP:`${fi}:${Ai.PROJECT}`,"MICRO_APP_USER_GROUP@EASYOPS":`${fi}:${Ai.USER}`,MICRO_APP_RESOURCE_PERMISSION:`${fi}:${Ai.PERMISSION}`,STORYBOARD_BRICK:`${fi}:${Ai.BRICK}`,STORYBOARD_ROUTE:`${fi}:${Ai.ROUTE}`,STORYBOARD_TEMPLATE:`${fi}:${Ai.TEMPLATE}`,STORYBOARD_SNIPPET:`${fi}:${Ai.SNIPPET}`,STORYBOARD_I18N:`${fi}:${Ai.I18N}`,MICRO_APP_RESOURCE_IMAGE:`${fi}:${Ai.IMAGE}`,STORYBOARD_FUNCTION:`${fi}:${Ai.FUNCTION}`,MICRO_APP_RESOURCE_MENU:`${fi}:${Ai.MENU}`,MICRO_APP_RESOURCE_MENU_ITEM:`${fi}:${Ai.MENU_ITEM}`,"WORKFLOW_DEF@EASYOPS":`${fi}:${Ai.WORKFLOW}`};function Ci(e){var t,n,i,a,r,o,s,l,c,d,p,h,u,m,g,v,b;const A="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",f=wi.i18n.t(null!==(t=xi[e.category])&&void 0!==t?t:e.category),y=wi.i18n.t(null!==(n=ki[A])&&void 0!==n?n:A),w=wi.i18n.t(null!==(i=Ni[null===(a=e.abstract)||void 0===a?void 0:a.leftObjectId])&&void 0!==i?i:null===(r=e.abstract)||void 0===r?void 0:r.leftObjectId),k=wi.i18n.t(null!==(o=Ni[null===(s=e.abstract)||void 0===s?void 0:s.rightObjectId])&&void 0!==o?o:null===(l=e.abstract)||void 0===l?void 0:l.rightObjectId),E=Mi(null===(c=e.abstract)||void 0===c?void 0:c.nodes,null===(d=e.abstract)||void 0===d?void 0:d.nodesCount),x=Mi(null===(p=e.abstract)||void 0===p?void 0:p.leftNodes,null===(h=e.abstract)||void 0===h?void 0:h.leftNodesCount),N=Mi(null===(u=e.abstract)||void 0===u?void 0:u.rightNodes,null===(m=e.abstract)||void 0===m?void 0:m.rightNodesCount),C="rollback"===A?Ci(e.rollBackIdInfo).abstract:null;return{category:f,action:y,leftObjectId:w,rightObjectId:k,nodes:E,leftNodes:x,rightNodes:N,abstract:wi.i18n.t(null!==(g=Ei[A])&&void 0!==g?g:A,{category:f,nodes:E,leftNodes:x,rightNodes:N,nodeChanges:null===(v=e.abstract)||void 0===v||null===(v=v.nodeChanges)||void 0===v?void 0:v.join(", "),relationChanges:null===(b=e.abstract)||void 0===b||null===(b=b.relationChanges)||void 0===b?void 0:b.join(", "),leftObjectId:w,rightObjectId:k,rollbackAbstract:C}),rollbackAbstract:C}}function Mi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return wi.i18n.t(`${fi}:${Ai.NODE}`,{nodes:e.join(n),context:t>e.length?"ellipsis":void 0,count:t})}var Ti;let Li,Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,Vi,ji,zi,Xi;(0,bi.initializeReactI18n)(fi,{en:{LOAD_MORE:"Load more",LOADING:"Loading",NO_DATA:"No data",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }} etc., a total of {{ count }} items",ADD:"Add node",EDIT:"Edit node",DELETE:"Delete node",IMPORT:"Batch import node",CLONE:"Clone node",APPEND_RELATION:"Append Relation",UPDATE_RELATION:"Update Relation",REMOVE_RELATION:"Remove Relation",ROLLBACK:"Rollback",ROLLBACK_ALL:"Rollback all operations",ADD_FULL:"Add {{ category }} ({{ nodes }})",EDIT_FULL:"Edit {{ nodeChanges }} of {{ category }} ({{ nodes }})",DELETE_FULL:"Delete {{ category }} ({{ nodes }})",IMPORT_FULL:"Batch Import {{ category }} ({{ nodes }})",CLONE_FULL:"Clone {{ category }} ({{ nodes }})",APPEND_RELATION_FULL:"Append the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",UPDATE_RELATION_FULL:"Update the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",REMOVE_RELATION_FULL:"Remove the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",ROLLBACK_FULL:"Rollback to [{{ rollbackAbstract }}]",ROLLBACK_ALL_FULL:"Rollback all operations",PROJECT:"Project",USER:"User Group",PERMISSION:"Permission",BRICK:"Brick",ROUTE:"Route",TEMPLATE:"Template",SNIPPET:"Snippet",I18N:"I18N",IMAGE:"Image",FUNCTION:"Function",MENU:"Menu",MENU_ITEM:"Menu item",WORKFLOW:"Workflow"},zh:{LOAD_MORE:"加载更多",LOADING:"加载中",NO_DATA:"没有数据",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }}等共{{ count }}项",ADD:"新增节点",EDIT:"编辑节点",DELETE:"删除节点",IMPORT:"批量导入节点",CLONE:"克隆节点",APPEND_RELATION:"添加关系",UPDATE_RELATION:"更新关系",REMOVE_RELATION:"移除关系",ROLLBACK:"回滚",ROLLBACK_ALL:"回滚全部操作",ADD_FULL:"新增{{ category }}({{ nodes }})",EDIT_FULL:"编辑{{ category }}({{ nodes }})的 {{ nodeChanges }}",DELETE_FULL:"删除{{ category }}({{ nodes }})",IMPORT_FULL:"批量导入{{ category }}({{ nodes }})",CLONE_FULL:"克隆{{ category }}({{ nodes }})",APPEND_RELATION_FULL:"添加{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",UPDATE_RELATION_FULL:"更新{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",REMOVE_RELATION_FULL:"移除{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",ROLLBACK_FULL:"回滚到【{{ rollbackAbstract }}】",ROLLBACK_ALL_FULL:"回滚全部操作",PROJECT:"项目",USER:"用户组",PERMISSION:"权限点",BRICK:"构件",ROUTE:"路由",TEMPLATE:"模版",SNIPPET:"片段",I18N:"国际化",IMAGE:"图片",FUNCTION:"函数",MENU:"菜单",MENU_ITEM:"菜单项",WORKFLOW:"工作流"}});const{defineElement:Ki,property:Ji,event:Hi}=(0,u.createDecorators)(),qi=(0,m.wrapBrick)("eo-button"),Yi=(0,m.wrapBrick)("eo-link"),Gi=(0,m.wrapBrick)("eo-icon"),Zi=(0,m.wrapBrick)("eo-easyops-avatar"),Qi=(0,m.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});let ea;var ta=new WeakMap,na=new WeakMap,ia=new WeakMap,aa=new WeakSet,ra=new WeakMap,oa=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap;class da extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,aa),(0,r.A)(this,ta,Ii(this)),(0,r.A)(this,na,(Si(this),Oi(this))),(0,r.A)(this,ia,(_i(this),Ri(this))),(0,r.A)(this,ra,(Pi(this),e=>{(0,s.A)(aa,this,Wi).emit(e)})),(0,r.A)(this,oa,$i(this)),(0,r.A)(this,sa,(Fi(this),e=>{(0,s.A)(aa,this,Bi).emit(e)})),(0,r.A)(this,la,Vi(this)),(0,r.A)(this,ca,(Xi(this),()=>{(0,s.A)(aa,this,ji).emit()}))}get appId(){return(0,c.A)(ta,this)}set appId(e){(0,l.A)(ta,this,e)}get projectId(){return(0,c.A)(na,this)}set projectId(e){(0,l.A)(na,this,e)}render(){return h().createElement(pa,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,c.A)(ra,this),onRollback:(0,c.A)(sa,this),onRollbackAll:(0,c.A)(ca,this)})}}function pa(e){const{appId:t,onHistoryItemClick:n,onRollback:i,onRollbackAll:a}=e,{t:r}=(0,bi.useTranslation)(fi),[o,s]=(0,p.useState)(!1),[l,c]=(0,p.useState)(!0),[d,u]=(0,p.useState)(!1),[m,g]=(0,p.useState)([]),v=(0,p.useRef)(""),b=e=>{s(!0),(0,yi.R)(t,{ts:v.current,limit:20}).then((t=>{g((n=>{const i=t.list.map((e=>({...e,translation:Ci(e)})));return e?i:n.concat(i)})),v.current=t.ts,u(t.list.length<20),c(t.list.length<20)})).catch((e=>{(0,et.handleHttpError)(e)})).finally((()=>{s(!1)}))};return h().createElement(Qi,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",onBeforeVisibleChange:e=>{e.detail&&(c(!0),u(!1),g([]),v.current="",b(!0))}},h().createElement(qi,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),h().createElement("div",null,h().createElement("div",{className:"history-title"},"History"),h().createElement("div",{className:"history-list"},m.length?h().createElement(h().Fragment,null,m.map(((e,t)=>h().createElement(ha,{key:`${e.uniqueKey}-${e.ts}`,data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:n,onRollback:i}))),!l&&h().createElement("span",{className:"load-more-container"},h().createElement(Yi,{className:"load-more",disabled:o,onClick:()=>b()},r(Ai.LOAD_MORE))),d&&h().createElement("span",{className:"end-container"},"The End",h().createElement(Gi,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>a()}))):h().createElement("div",{className:"empty"},r(o?Ai.LOADING:Ai.NO_DATA))),h().createElement("slot",null)))}function ha(e){const{data:t,enableRollback:n,current:i,onHistoryItemClick:a,onRollback:r}=e,o=gi()(Number(t.ts)/1e6),s=gi().duration(o.diff(gi()())),l=s.days()<=-1?o.format("YYYY-MM-DD HH:mm:ss"):s.humanize(!0,{ss:0,s:60,m:60,h:24});return h().createElement("div",{className:"item-container"},h().createElement("div",{className:"item-title"},h().createElement("div",{className:"title-left",onClick:()=>a({...t,enableRollback:n})},h().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),i&&h().createElement("div",{className:"branch"},"(current)")),h().createElement("div",{className:"title-right"},n&&h().createElement(Gi,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>r(t)}))),h().createElement("div",{className:"item-info"},h().createElement(Zi,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),h().createElement("div",{className:"time"},l),h().createElement("div",{className:"operator"},t.user)))}Ti=da,({e:[Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,Vi,ji,zi,Xi],c:[ea,Li]}=(0,d.A)(Ti,[Ki("visual-builder.workbench-history-action",{styleTexts:[vi.A]})],[[Ji(),1,"appId"],[Ji(),1,"projectId"],[Hi({type:"history.item.click"}),1,"historyItemClickEvent",e=>(0,c.A)(ia,e),(e,t)=>(0,l.A)(ia,e,t)],[Hi({type:"rollback"}),1,"rollbackEvent",e=>(0,c.A)(oa,e),(e,t)=>(0,l.A)(oa,e,t)],[Hi({type:"rollback.all"}),1,"rollbackAllEvent",e=>(0,c.A)(la,e),(e,t)=>(0,l.A)(la,e,t)]],0,(e=>ca.has((0,o.A)(e))),m.ReactNextElement)),Li();var ua,ma=n(2381);let ga,va,ba,Aa,fa,ya,wa,ka,Ea,xa,Na,Ca,Ma,Ta,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,Va,ja,za,Xa,Ka,Ja,Ha,qa,Ya,Ga,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,hr,ur;const{defineElement:mr,property:gr,event:vr}=(0,u.createDecorators)(),br=(0,m.wrapBrick)("eo-icon"),Ar=(0,m.wrapBrick)("eo-tooltip"),fr=new Set;let yr;var wr=new WeakMap,kr=new WeakMap,Er=new WeakMap,xr=new WeakMap,Nr=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,Tr=new WeakMap,Lr=new WeakMap,Ir=new WeakSet,Sr=new WeakMap,Or=new WeakMap,_r=new WeakMap,Rr=new WeakMap,Wr=new WeakMap,Dr=new WeakMap,Pr=new WeakMap,$r=new WeakMap,Br=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,Vr=new WeakMap,jr=new WeakMap,zr=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,Jr=new WeakMap;class Hr extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ir),(0,r.A)(this,wr,va(this)),(0,r.A)(this,kr,(ba(this),Aa(this))),(0,r.A)(this,Er,(fa(this),ya(this))),(0,r.A)(this,xr,(wa(this),ka(this))),(0,r.A)(this,Nr,(Ea(this),xa(this))),(0,r.A)(this,Cr,(Na(this),Ca(this))),(0,r.A)(this,Mr,(Ma(this),Ta(this))),(0,r.A)(this,Tr,(La(this),Ia(this))),(0,r.A)(this,Lr,(Sa(this),Oa(this))),(0,r.A)(this,Sr,(Wa(this),e=>{(0,s.A)(Ir,this,_a).emit(e)})),(0,r.A)(this,Or,Da(this)),(0,r.A)(this,_r,(Ba(this),e=>{(0,s.A)(Ir,this,Pa).emit(e)})),(0,r.A)(this,Rr,Ua(this)),(0,r.A)(this,Wr,(ja(this),()=>{(0,s.A)(Ir,this,Fa).emit()})),(0,r.A)(this,Dr,za(this)),(0,r.A)(this,Pr,(Ja(this),()=>{(0,s.A)(Ir,this,Xa).emit()})),(0,r.A)(this,$r,Ha(this)),(0,r.A)(this,Br,(Ga(this),e=>{(0,s.A)(Ir,this,qa).emit(e)})),(0,r.A)(this,Ur,Za(this)),(0,r.A)(this,Fr,(tr(this),()=>{(0,s.A)(Ir,this,Qa).emit()})),(0,r.A)(this,Vr,nr(this)),(0,r.A)(this,jr,(rr(this),e=>{(0,s.A)(Ir,this,ir).emit(e)})),(0,r.A)(this,zr,or(this)),(0,r.A)(this,Xr,(cr(this),e=>{(0,s.A)(Ir,this,sr).emit(e)})),(0,r.A)(this,Kr,dr(this)),(0,r.A)(this,Jr,(ur(this),e=>{(0,s.A)(Ir,this,pr).emit(e)}))}get label(){return(0,c.A)(wr,this)}set label(e){(0,l.A)(wr,this,e)}get type(){return(0,c.A)(kr,this)}set type(e){(0,l.A)(kr,this,e)}get external(){return(0,c.A)(Er,this)}set external(e){(0,l.A)(Er,this,e)}get subNodes(){return(0,c.A)(xr,this)}set subNodes(e){(0,l.A)(xr,this,e)}get active(){return(0,c.A)(Nr,this)}set active(e){(0,l.A)(Nr,this,e)}get notSynced(){return(0,c.A)(Cr,this)}set notSynced(e){(0,l.A)(Cr,this,e)}get disableChildAppend(){return(0,c.A)(Mr,this)}set disableChildAppend(e){(0,l.A)(Mr,this,e)}get autoFocusOnce(){return(0,c.A)(Tr,this)}set autoFocusOnce(e){(0,l.A)(Tr,this,e)}render(){return h().createElement(qr,{label:this.label,type:this.type,external:this.external,subNodes:this.subNodes,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,c.A)(Sr,this),onLabelChange:(0,c.A)(_r,this),onNodeClick:(0,c.A)(Wr,this),onNodeDoubleClick:(0,c.A)(Pr,this),onNodeContextMenu:(0,c.A)(Br,this),onChildAppend:(0,c.A)(Fr,this),onExternalClick:(0,c.A)(jr,this),onSubNodeDoubleClick:(0,c.A)(Xr,this),onSubNodeContextMenu:(0,c.A)(Jr,this)})}}function qr(e){var t;let{label:n,type:i,external:a,subNodes:r,autoFocusOnce:o,onLabelEditingChange:s,onLabelChange:l,onNodeClick:c,onNodeDoubleClick:d,onNodeContextMenu:u,onChildAppend:m,onExternalClick:g,onSubNodeDoubleClick:v,onSubNodeContextMenu:b}=e;const A="board"===i?"board":"page",[y,w]=(0,p.useState)(n),[k,E]=(0,p.useState)(!1),x=(0,p.useRef)(!1),[N,C]=(0,p.useState)(!1),M=(0,p.useRef)(null);(0,p.useEffect)((()=>{w(n)}),[n]);const T=(0,p.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),E(!0)}),[]);(0,p.useEffect)((()=>{o&&!fr.has(o)&&(fr.add(o),setTimeout((()=>{E(!0)}),1))}),[o]),(0,p.useEffect)((()=>{var e,t;k&&(null===(e=M.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=M.current)||void 0===t||t.select())}),[k]),(0,p.useEffect)((()=>{x.current?null==s||s(k):x.current=!0}),[k,s]);const L=(0,p.useCallback)((e=>{w(e.target.value)}),[]),I=(0,p.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=M.current)||void 0===n||n.blur()}),[]),S=(0,p.useCallback)((()=>{E(!1),C(!0)}),[]);(0,p.useEffect)((()=>{N&&(null==l||l(y),C(!1))}),[y,l,N]);const O=(0,p.useCallback)((e=>{e.stopPropagation(),null==m||m()}),[m]),_=(0,p.useCallback)((e=>{e.stopPropagation(),null==g||g(a)}),[a,g]),R=(0,p.useCallback)((e=>{e.stopPropagation()}),[]),W=38*Math.max(0,Math.floor((null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0)-3));return h().createElement(h().Fragment,null,h().createElement("div",{className:f()("node",A,{"editing-label":k}),style:{height:"board"===A?70:130+W},onClick:c,onDoubleClick:d,onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==u||u({clientX:e.clientX,clientY:e.clientY})}},h().createElement("input",{className:"label-input",value:y,ref:M,onChange:L,onKeyDown:I,onBlur:S,onDoubleClick:R,onContextMenu:R,onMouseDown:R}),h().createElement("div",{className:"label",onDoubleClick:T,onMouseDown:R},y),"board"===A?h().createElement("div",{className:"icon-container"},h().createElement(br,{lib:"antd",icon:"unordered-list"})):h().createElement("div",{className:"thumbnail-container",style:{height:98+W}},h().createElement("div",{className:"thumbnail-placeholder"},h().createElement(br,{lib:"antd",icon:"ellipsis"})),a&&h().createElement("div",{className:"external",onClick:_,onDoubleClick:R,onMouseDown:R},h().createElement(br,{lib:"antd",icon:"desktop"}),h().createElement("span",{className:"external-label"},a.label)),null!=r&&r.length?h().createElement("div",{className:"sub-nodes"},r.map((e=>h().createElement(Yr,{key:e.id,subNode:e,onSubNodeDoubleClick:v,onSubNodeContextMenu:b})))):null)),h().createElement("div",{className:"add-button",role:"button",onClick:O,onMouseDown:R},h().createElement(br,{lib:"fa",icon:"plus"})))}function Yr(e){let{subNode:t,onSubNodeDoubleClick:n,onSubNodeContextMenu:i}=e;return h().createElement(Ar,{key:t.id,content:t.label},h().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==n||n(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==i||i({node:t,clientX:e.clientX,clientY:e.clientY})}},h().createElement("div",{className:"sub-node-skeleton-title"}),h().createElement("div",{className:"sub-node-skeleton-content"}),h().createElement("div",{className:"sub-node-skeleton-button"})))}ua=Hr,({e:[va,ba,Aa,fa,ya,wa,ka,Ea,xa,Na,Ca,Ma,Ta,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,Va,ja,za,Xa,Ka,Ja,Ha,qa,Ya,Ga,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,hr,ur],c:[yr,ga]}=(0,d.A)(ua,[mr("visual-builder.page-arch-node",{styleTexts:[ma.A]})],[[gr(),1,"label"],[gr(),1,"type"],[gr({attribute:!1}),1,"external"],[gr({attribute:!1}),1,"subNodes"],[gr({type:Boolean,render:!1}),1,"active"],[gr({type:Boolean,render:!1}),1,"notSynced"],[gr({type:Boolean,render:!1}),1,"disableChildAppend"],[gr(),1,"autoFocusOnce"],[vr({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,c.A)(Lr,e),(e,t)=>(0,l.A)(Lr,e,t)],[vr({type:"label.change"}),1,"labelChange",e=>(0,c.A)(Or,e),(e,t)=>(0,l.A)(Or,e,t)],[vr({type:"node.click"}),1,"nodeClick",e=>(0,c.A)(Rr,e),(e,t)=>(0,l.A)(Rr,e,t)],[vr({type:"node.dblclick"}),1,"nodeDoubleClick",e=>(0,c.A)(Dr,e),(e,t)=>(0,l.A)(Dr,e,t)],[vr({type:"node.contextmenu"}),1,"nodeContextMenu",e=>(0,c.A)($r,e),(e,t)=>(0,l.A)($r,e,t)],[vr({type:"child.append"}),1,"childAppend",e=>(0,c.A)(Ur,e),(e,t)=>(0,l.A)(Ur,e,t)],[vr({type:"external.click"}),1,"externalClick",e=>(0,c.A)(Vr,e),(e,t)=>(0,l.A)(Vr,e,t)],[vr({type:"subNode.dblclick"}),1,"subNodeDoubleClick",e=>(0,c.A)(zr,e),(e,t)=>(0,l.A)(zr,e,t)],[vr({type:"subNode.contextmenu"}),1,"subNodeContextMenu",e=>(0,c.A)(Kr,e),(e,t)=>(0,l.A)(Kr,e,t)]],0,(e=>Jr.has((0,o.A)(e))),m.ReactNextElement)),ga();var Gr,Zr=n(3848),Qr=n(6213),eo=n(9492);let to,no,io,ao,ro,oo,so,lo,co;const{method:po,property:ho}=(0,u.createDecorators)();var uo=new WeakMap,mo=new WeakSet,go=new WeakMap,vo=new WeakMap,bo=new WeakMap,Ao=new WeakMap,fo=new WeakMap,yo=new WeakMap;class wo extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,mo),(0,r.A)(this,uo,(to(this),!1)),(0,r.A)(this,go,"normal"),(0,r.A)(this,vo,!1),(0,r.A)(this,bo,no(this)),(0,r.A)(this,Ao,(io(this),ao(this))),(0,r.A)(this,fo,(ro(this),oo(this))),(0,r.A)(this,yo,(so(this),lo(this))),co(this)}get isFormItemElement(){return!0}set validateState(e){(0,eo.A)(mo,No,this,e),this._render()}get validateState(){return(0,s.A)(mo,this,xo)}set notRender(e){this.hidden=e,(0,eo.A)(mo,Eo,this,e),this._render()}get notRender(){return(0,s.A)(mo,this,ko)}get $bindFormItem(){return(0,s.A)(mo,this,Co)}set $bindFormItem(e){(0,eo.A)(mo,Mo,this,e),this._render()}get helpBrick(){return(0,c.A)(bo,this)}set helpBrick(e){(0,l.A)(bo,this,e)}get labelBrick(){return(0,c.A)(Ao,this)}set labelBrick(e){(0,l.A)(Ao,this,e)}get labelCol(){return(0,c.A)(fo,this)}set labelCol(e){(0,l.A)(fo,this,e)}get wrapperCol(){return(0,c.A)(yo,this)}set wrapperCol(e){(0,l.A)(yo,this,e)}setNotRender(e){this.notRender=e}getFormElement(){let e=this;for(;(e=e.parentNode)&&e&&!e.isFormElement;);return e}}function ko(e){return(0,c.A)(uo,e)}function Eo(e,t){(0,l.A)(uo,e,t)}function xo(e){return(0,c.A)(go,e)}function No(e,t){(0,l.A)(go,e,t)}function Co(e){return(0,c.A)(vo,e)}function Mo(e,t){(0,l.A)(vo,e,t)}Gr=wo,[no,io,ao,ro,oo,so,lo,co,to]=(0,d.A)(Gr,[],[[ho({attribute:!1}),1,"helpBrick"],[ho({attribute:!1}),1,"labelBrick"],[ho({attribute:!1}),1,"labelCol"],[ho({attribute:!1}),1,"wrapperCol"],[po(),2,"setNotRender"],[po(),2,"getFormElement"]],0,void 0,m.ReactNextElement).e;var To=n(4244);let Lo=function(e){return e.CONTRACT_OPTIONS_TIPS_PREFIX="CONTRACT_OPTIONS_TIPS_PREFIX",e.CONTRACT_OPTIONS_TIPS_SUFFIX="CONTRACT_OPTIONS_TIPS_SUFFIX",e.CONTRACT_VALIDATE_MESSAGE="CONTRACT_VALIDATE_MESSAGE",e}({});const Io="bricks/visual-builder/contract-select",So={en:{CONTRACT_OPTIONS_TIPS_PREFIX:"Only the first",CONTRACT_OPTIONS_TIPS_SUFFIX:"items are displayed, please search for more results",CONTRACT_VALIDATE_MESSAGE:"Please fill in the correct contract name "},zh:{CONTRACT_OPTIONS_TIPS_PREFIX:"仅展示前",CONTRACT_OPTIONS_TIPS_SUFFIX:"项,更多结果请搜索",CONTRACT_VALIDATE_MESSAGE:"请填写正确的契约名称"}};(0,bi.initializeReactI18n)(Io,So);const Oo=(0,m.wrapBrick)("eo-icon"),_o=(0,m.wrapBrick)("eo-input",{onChange:"change"});function Ro(e){const{itemsCount:t=20,onBlur:n}=e,[i,a]=(0,p.useState)(t),{t:r}=(0,bi.useTranslation)(Io),[o,s]=(0,p.useState)(!1);return h().createElement("div",{className:"options-tips",slot:e.slot},r(Lo.CONTRACT_OPTIONS_TIPS_PREFIX)," ",o?h().createElement(_o,{autoFocus:!0,inputStyle:{width:65},value:String(i),onBlur:()=>{s(!1),null==n||n(i)},onChange:e=>{a(Number(e.detail))}}):h().createElement("span",null,i," ",h().createElement(Oo,{icon:"edit",lib:"antd",onClick:()=>{s(!0)}}))," ",r(Lo.CONTRACT_OPTIONS_TIPS_SUFFIX))}var Wo;let Do,Po,$o,Bo,Uo,Fo,Vo,jo,zo,Xo,Ko,Jo,Ho,qo,Yo;(0,bi.initializeReactI18n)(Io,So);const{defineElement:Go,property:Zo,event:Qo}=(0,u.createDecorators)(),es=(0,m.wrapBrick)("eo-form-item"),ts=(0,m.wrapBrick)("eo-auto-complete",{onChange:"change"});let ns;var is=new WeakMap,as=new WeakMap,rs=new WeakMap,os=new WeakMap,ss=new WeakMap,ls=new WeakMap,cs=new WeakSet;function ds(e){if("string"!=typeof e)return{name:"",version:""};const[t,n]=e.split(":");return{name:t,version:n}}function ps(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function hs(e){return(0,kt.isNil)(e)||ps(e)?"":wi.i18n.t(`${Io}:${Lo.CONTRACT_VALIDATE_MESSAGE}`)}function us(e){let{value:t,inputStyle:n,validateState:i,suffix:a,onChange:r}=e;const[o,s]=(0,p.useState)(),[l,c]=(0,p.useState)(20),d=function(e){let{pageSize:t=20,q:n=""}=e;const[i,a]=(0,p.useState)([]),[r,o]=(0,p.useState)(n),[s,l]=(0,p.useState)(t);return(0,p.useEffect)((()=>{o(n)}),[n]),(0,p.useEffect)((()=>{l(t)}),[t]),(0,p.useEffect)((()=>{(async()=>{try{const{list:e}=await(0,To.f)({page:1,pageSize:s,fullContractName:r},{interceptorParams:{ignoreLoadingBar:!0}});a(e)}catch(e){console.error(e),a([])}})()}),[r,s]),i}({q:o,pageSize:l}),[u,m]=(0,p.useState)(ds(t)),[g,v]=(0,p.useState)([]);(0,p.useEffect)((()=>{m(ds(t))}),[t]);const b=(0,p.useMemo)((()=>(0,kt.debounce)((e=>{s(e)}),200)),[]);return h().createElement("div",{className:"contract-wrapper"},h().createElement(ts,{className:"contract-selector",options:null==d?void 0:d.map((e=>({value:e.fullContractName,label:e.fullContractName}))),value:u.name,inputStyle:n,validateState:i,onChange:e=>{const t=e.detail;if(ps(t))m(ds(t)),null==r||r(t);else{var n,i;const e=null===(n=d.find((e=>e.fullContractName===t)))||void 0===n?void 0:n.version,a=null!==(i=null==e?void 0:e[0])&&void 0!==i?i:"";v(e),m({name:t,version:a}),null==r||r(`${t}:${a}`)}b(t)}},h().createElement(Ro,{onBlur:e=>c(e),slot:"options-toolbar"})),h().createElement(ts,{className:"version-selector",value:u.version,validateState:i,options:null==g?void 0:g.map((e=>({value:e,label:e}))),onChange:e=>{const t=e.detail;m({name:u.name,version:t}),null==r||r(`${u.name}:${t}`)}}),null!=a&&a.useBrick?h().createElement(Zr.ReactUseMultipleBricks,a):null)}Wo=class extends wo{constructor(){super(...arguments),(0,a.A)(this,cs),(0,r.A)(this,is,Po(this)),(0,r.A)(this,as,($o(this),Bo(this))),(0,r.A)(this,rs,(Uo(this),Fo(this))),(0,r.A)(this,os,(Vo(this),jo(this))),(0,r.A)(this,ss,(zo(this),Xo(this))),(0,r.A)(this,ls,(Ko(this),Jo(this))),(0,G.A)(this,"handleChange",(Yo(this),e=>{(0,s.A)(cs,this,Ho).emit(e)}))}get name(){return(0,c.A)(is,this)}set name(e){(0,l.A)(is,this,e)}get required(){return(0,c.A)(as,this)}set required(e){(0,l.A)(as,this,e)}get label(){return(0,c.A)(rs,this)}set label(e){(0,l.A)(rs,this,e)}get value(){return(0,c.A)(os,this)}set value(e){(0,l.A)(os,this,e)}get suffix(){return(0,c.A)(ss,this)}set suffix(e){(0,l.A)(ss,this,e)}render(){return h().createElement(es,{exportparts:"message",curElement:this,formElement:this.getFormElement(),name:this.name,label:this.label,required:this.required,labelBrick:this.labelBrick,helpBrick:this.helpBrick,notRender:this.notRender,trigger:"handleChange",validator:hs},h().createElement(us,{value:this.value,suffix:this.suffix,validateState:this.validateState,onChange:this.handleChange}))}},({e:[Po,$o,Bo,Uo,Fo,Vo,jo,zo,Xo,Ko,Jo,Ho,qo,Yo],c:[ns,Do]}=(0,d.A)(Wo,[Go("visual-builder.contract-select",{styleTexts:[Qr.A]})],[[Zo(),1,"name"],[Zo({type:Boolean}),1,"required"],[Zo(),1,"label"],[Zo({attribute:!1}),1,"value"],[Zo({attribute:!1}),1,"suffix"],[Qo({type:"change"}),1,"changeEvent",e=>(0,c.A)(ls,e),(e,t)=>(0,l.A)(ls,e,t)]],0,(e=>cs.has((0,o.A)(e))),wo)),Do();var ms=n(2729);var gs,vs=n(7540);let bs,As,fs,ys,ws,ks,Es,xs,Ns,Cs,Ms,Ts,Ls,Is,Ss,Os;const _s=(0,m.wrapBrick)("eo-menu"),Rs=(0,m.wrapBrick)("eo-menu-item"),Ws=(0,m.wrapBrick)("eo-tooltip"),Ds=(0,ms.unwrapProvider)("basic.lock-body-scroll");(0,bi.initializeReactI18n)("bricks/visual-builder/generate-snippets-context-menu",{en:{},zh:{}});const{defineElement:Ps,property:$s,event:Bs,method:Us}=(0,u.createDecorators)();let Fs;var Vs=new WeakMap,js=new WeakMap,zs=new WeakMap,Xs=new WeakMap,Ks=new WeakSet,Js=new WeakMap,Hs=new WeakMap,qs=new WeakMap;class Ys extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ks),(0,r.A)(this,Vs,(bs(this),fs(this))),(0,r.A)(this,js,(ys(this),ws(this))),(0,r.A)(this,zs,(ks(this),Es(this))),(0,r.A)(this,Xs,(xs(this),Ns(this))),(0,r.A)(this,Js,(Ts(this),Ls(this))),(0,r.A)(this,Hs,(Os(this),e=>{(0,s.A)(Ks,this,Cs).emit(e)})),(0,r.A)(this,qs,(e=>{(0,s.A)(Ks,this,Is).emit(e)}))}get options(){return(0,c.A)(Vs,this)}set options(e){(0,l.A)(Vs,this,e)}get active(){return(0,c.A)(js,this)}set active(e){(0,l.A)(js,this,e)}get position(){return(0,c.A)(zs,this)}set position(e){(0,l.A)(zs,this,e)}open(e){let{position:t}=e;this.active=!0,this.position=t}close(){this.active=!1,this.position=void 0}disconnectedCallback(){super.disconnectedCallback(),Ds(this,!1)}render(){return h().createElement(Gs,{active:this.active,element:this,position:this.position,onItemDragStart:(0,c.A)(Hs,this),onItemDragEnd:(0,c.A)(qs,this),options:this.options})}}function Gs(e){var t,n;let{element:i,active:a,onItemDragEnd:r,onItemDragStart:o,options:s,position:l}=e;const[c,d]=(0,p.useState)(!1),u=(0,p.useRef)(null),[m,g]=(0,p.useState)(null),v=(0,p.useCallback)((e=>{e.preventDefault(),null==i||i.close()}),[i]),b=(0,p.useCallback)(((e,t)=>{var n;d(!0),t.dragConf&&(null===(n=e.dataTransfer)||void 0===n||n.setData(t.dragConf.format,JSON.stringify(t.dragConf.data))),e.target.classList.add("dragging"),null==o||o(t)}),[o]),A=(0,p.useCallback)(((e,t)=>{d(!1),e.target.classList.remove("dragging"),null==i||i.close(),null==r||r(t)}),[i,r]);return(0,p.useEffect)((()=>{Ds(i,a)}),[a,i]),(0,p.useEffect)((()=>{if(a&&u.current&&l){const e=u.current.getBoundingClientRect(),t=e.width+8,n=e.height+8,{clientWidth:i,clientHeight:a}=document.documentElement,r=[...l];i>t&&l[0]+t>i&&(r[0]=l[0]-t),a>n&&l[1]+n>a&&(r[1]=a-n),g(r)}else g(null)}),[a,l]),h().createElement(h().Fragment,null,!c&&h().createElement("div",{className:"mask",onClick:v,onContextMenu:v}),h().createElement("div",{className:"container",ref:u,style:{left:null===(t=null!=m?m:l)||void 0===t?void 0:t[0],top:null===(n=null!=m?m:l)||void 0===n?void 0:n[1],visibility:m?"visible":"hidden"}},null==s?void 0:s.map(((e,t)=>{var n,i;return h().createElement("div",{key:t},h().createElement("div",{className:"title"},e.title),(null===(n=e.children)||void 0===n?void 0:n.length)&&h().createElement(_s,null,null===(i=e.children)||void 0===i?void 0:i.map(((e,t)=>h().createElement(Ws,{content:e.tooltip,hoist:!0,placement:"left",key:t},h().createElement(Rs,{disabled:e.disabled,icon:e.icon,draggable:!e.disabled,onDragStart:t=>b(t,e),onDragEnd:t=>A(t,e)},e.text))))))}))))}gs=Ys,({e:[fs,ys,ws,ks,Es,xs,Ns,Cs,Ms,Ts,Ls,Is,Ss,Os,bs],c:[Fs,As]}=(0,d.A)(gs,[Ps("visual-builder.generate-snippets-context-menu",{styleTexts:[vs.A]})],[[$s({attribute:!1}),1,"options"],[$s({type:Boolean}),1,"active"],[$s({attribute:!1}),1,"position"],[Bs({type:"item.drag.start"}),1,"itemDragStartEvent",e=>(0,c.A)(Xs,e),(e,t)=>(0,l.A)(Xs,e,t)],[Bs({type:"item.drag.end"}),1,"itemDragEndEvent",e=>(0,c.A)(Js,e),(e,t)=>(0,l.A)(Js,e,t)],[Us(),2,"open"],[Us(),2,"close"]],0,(e=>qs.has((0,o.A)(e))),m.ReactNextElement)),As();var Zs=n(1085),Qs=n(3091),el=n(7447),tl=n(3640),nl=n(4360),il=n(3544),al=n(4650),rl=n(9830);function ol(){function e(e,t,n){if(!n||"pre"!==n.tagName||"code"!==e.tagName)return;const i=function(e){const t=e.properties.className||[];for(const e of t)if("language-"===e.slice(0,9))return e.slice(9).toLowerCase();return null}(e);if(null===i)return;let a;try{n.properties.className=(n.properties.className||[]).concat("language-"+i),a=rl.L.highlight((0,al.d)(e),i)}catch{return}e.children=a.children}return t=>{(0,il.YR)(t,"element",e)}}const sl={Fragment:Zs.Fragment,jsx:Zs.jsx,jsxs:Zs.jsxs};function ll(e){let{content:t}=e;const[n,i]=(0,p.useState)(null);return(0,p.useEffect)((()=>{let e=!1;return(0,Qs.l)().use(el.A).use(tl.A).use([ol]).use(nl.A,sl).process(t).then((t=>{e||i(t.result)})).catch((t=>{e||(console.error("Convert markdown failed:",t),i(null))})),()=>{e=!0}}),[t]),n}const cl=(0,m.wrapBrick)("eo-avatar");function dl(e){let{message:t}=e;const n=(0,p.useMemo)((()=>{const e=[];if("assistant"===t.role){const n=/(?:^|\n)```(easy_cmd_\S+)\n([\s\S]*?)\n```(?:$|\n)/gm;let i,a=0;for(;i=n.exec(t.content);){const[r,o,s]=i,l=i.index,c=t.content.slice(a,l).trim();c.length>0&&e.push({type:"markdown",content:c}),e.push({type:"command",command:o,content:s.trim(),raw:r}),a=n.lastIndex}const r=t.content.slice(a).trim();r.length>0&&e.push({type:"markdown",content:r})}else e.push({type:"plain",content:t.content});return e}),[t.content,t.role]),i=(0,p.useRef)(null);return(0,p.useEffect)((()=>{const e=i.current;e&&setTimeout((()=>{const n=e.parentElement.querySelectorAll(".texting");for(const e of n)e.classList.remove("texting");if(!t.partial)return;let i=e;for(;i;){const e=i.lastChild;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE||"DETAILS"===(null==e?void 0:e.tagName)&&!e.open){var a;if((null==e?void 0:e.nodeType)!==Node.TEXT_NODE||0!==e.textContent.trim().length||(null===(a=e.previousSibling)||void 0===a?void 0:a.nodeType)!==Node.ELEMENT_NODE)break;i=e.previousSibling}else i=e}i.classList.add("texting")}),1)}),[t.partial,t.content]),h().createElement("div",{className:f()("message",{failed:t.failed})},h().createElement("div",{className:"avatar"},h().createElement(cl,{icon:{lib:"easyops",icon:"assistant"===t.role?"robot":"account"},size:"small",className:`role-${t.role}`})),h().createElement("div",{className:"main"},h().createElement("div",{className:"label"},"assistant"===t.role?"Assistant":"You"),h().createElement("div",{className:"content",ref:i},n.map(((e,t)=>h().createElement(pl,{key:t,chunk:e}))))))}function pl(e){let{chunk:t}=e;return h().createElement(h().Fragment,null,"markdown"===t.type?h().createElement("div",{className:"markdown"},h().createElement(ll,{content:t.content})):"command"===t.type?h().createElement(h().Fragment,null,h().createElement("details",{className:"command"},h().createElement("summary",null,"```",t.command),h().createElement("pre",null,h().createElement("code",null,t.content)))):h().createElement("div",{className:"plain"},t.content))}var hl,ul=n(7236);let ml,gl,vl,bl,Al,fl,yl,wl,kl;const{defineElement:El,property:xl,event:Nl}=(0,u.createDecorators)();let Cl;var Ml=new WeakMap,Tl=new WeakMap,Ll=new WeakMap,Il=new WeakSet,Sl=new WeakMap;class Ol extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Il),(0,r.A)(this,Ml,gl(this)),(0,r.A)(this,Tl,(vl(this),bl(this))),(0,r.A)(this,Ll,(Al(this),fl(this))),(0,r.A)(this,Sl,(kl(this),e=>{(0,s.A)(Il,this,yl).emit(e)}))}get messages(){return(0,c.A)(Ml,this)}set messages(e){(0,l.A)(Ml,this,e)}get errorBoundary(){return(0,c.A)(Tl,this)}set errorBoundary(e){(0,l.A)(Tl,this,e)}render(){return h().createElement(_l,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(Sl,this)})}}function _l(e){let{messages:t,host:n,errorBoundary:i,onStoryboardUpdate:a}=e;const r=(0,p.useMemo)((()=>/(?:^|\n)```easy_cmd_vb_block_(page|storyboard)\n([\s\S]*?)\n```(?:$|\n)/gm),[]),o=(0,p.useRef)(new Map),[s,l]=(0,p.useState)([]),c=(0,p.useRef)(!1);(0,p.useEffect)((()=>{for(const n of null!=t?t:[]){var e;if("assistant"!==n.role)continue;let t;r.lastIndex=null!==(e=o.current.get(n.key))&&void 0!==e?e:0;const i=[];let a=!1;for(;t=r.exec(n.content);){o.current.set(n.key,r.lastIndex);const[,e,s]=t;try{const t=JSON.parse(s);"page"===e?(a=!0,i.push(...t)):i.push({...t,type:"item"})}catch(e){console.error("parse storyboard failed:",e)}}a?l(i):i.length>0&&l((e=>[...e,...i]))}}),[r,t]);const[d,u]=(0,p.useState)([]);(0,p.useEffect)((()=>{const e=[],t=new Map;for(const n of s)"block"===n.type?e.push(n):n.storyboard&&t.set(n.uuid,n.storyboard);e.sort(((e,t)=>e.seq-t.seq));const n={brick:"eo-content-layout",children:[]},a={brick:"eo-main-view",children:[{brick:"eo-page-title",slot:"pageTitle",properties:{pageTitle:"测试页面"}}]};let r=!1;for(const o of e)if("全局操作区"===o.name)for(const e of o.children){const n=t.get(e);n&&(a.children.push({...n,properties:{...n.properties,slot:void 0},errorBoundary:i,slot:"toolbar",iid:`item:${e}`,meta:{type:"item",uuid:e,block:{uuid:o.uuid,name:o.name}}}),r=!0)}else{const e=t.get(o.uuid);if(e){const a={...e,children:[],errorBoundary:i,iid:`block:${o.uuid}`,meta:{type:"block",uuid:o.uuid,name:o.name}};r=!0,n.children.push(a);for(const e of o.children){const n=t.get(e);n&&a.children.push({...n,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}})}}else if(!o.hasContainer)for(const e of o.children){const a=t.get(e);a&&(n.children.push({...a,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}}),r=!0)}}a.children.push(n),u((e=>r?[a]:0===e.length?e:[]))}),[s,i]),(0,p.useEffect)((()=>{null==a||a(d)}),[a,d]);const m=(0,p.useMemo)((()=>{let e=n;for(;e;){const t=getComputedStyle(e,null).getPropertyValue("overflow-y");if("auto"===t||"scroll"===t)return e;if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else{if(!(e.parentNode instanceof Element))break;e=e.parentNode}}return document.scrollingElement||document.documentElement}),[n]);return(0,p.useEffect)((()=>{c.current||setTimeout((()=>{m.scrollTo(0,m.scrollHeight)}),1)}),[t,m]),(0,p.useEffect)((()=>{const e=()=>{c.current=m.scrollTop+m.clientHeight+6<m.scrollHeight};return m.addEventListener("scroll",e),()=>{m.removeEventListener("scroll",e)}}),[m]),h().createElement(h().Fragment,null,null==t?void 0:t.map(((e,t)=>{var n;return h().createElement(dl,{key:null!==(n=e.key)&&void 0!==n?n:`index-${t}`,message:e})})))}hl=Ol,({e:[gl,vl,bl,Al,fl,yl,wl,kl],c:[Cl,ml]}=(0,d.A)(hl,[El("visual-builder.chat-conversation",{styleTexts:[ul.A]})],[[xl({attribute:!1}),1,"messages"],[xl({type:Boolean}),1,"errorBoundary"],[Nl({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Ll,e),(e,t)=>(0,l.A)(Ll,e,t)]],0,(e=>Sl.has((0,o.A)(e))),m.ReactNextElement)),ml();var Rl=n(9575),Wl=n(5310);function Dl(e){let{variant:t,width:n,height:i,left:a,top:r,label:o}=e;return h().createElement("div",{className:"outline "+t,style:{width:n+8,height:i+8,left:a-4,top:r-4}},h().createElement("div",{className:"label"},o))}var Pl,$l=n(1563);let Bl,Ul,Fl,Vl,jl,zl,Xl,Kl,Jl,Hl,ql,Yl,Gl,Zl,Ql,ec;const{defineElement:tc,property:nc,event:ic,method:ac}=(0,u.createDecorators)();let rc;var oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,cc=new WeakMap,dc=new WeakMap,pc=new WeakMap,hc=new WeakSet,uc=new WeakMap;class mc extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,hc),(0,r.A)(this,oc,(Bl(this),Fl(this))),(0,r.A)(this,sc,(Vl(this),jl(this))),(0,r.A)(this,lc,(zl(this),Xl(this))),(0,r.A)(this,cc,(Kl(this),Jl(this))),(0,r.A)(this,dc,(Hl(this),ql(this))),(0,r.A)(this,pc,(Yl(this),Gl(this))),(0,r.A)(this,uc,(ec(this),e=>{(0,s.A)(hc,this,Zl).emit(e)}))}get storyboard(){return(0,c.A)(oc,this)}set storyboard(e){(0,l.A)(oc,this,e)}get theme(){return(0,c.A)(sc,this)}set theme(e){(0,l.A)(sc,this,e)}get uiVersion(){return(0,c.A)(lc,this)}set uiVersion(e){(0,l.A)(lc,this,e)}get app(){return(0,c.A)(cc,this)}set app(e){(0,l.A)(cc,this,e)}get inspecting(){return(0,c.A)(dc,this)}set inspecting(e){(0,l.A)(dc,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return h().createElement(gc,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(uc,this)})}}function gc(e){let{storyboard:t,theme:n,uiVersion:i,app:a,inspecting:r,onActiveTargetChange:o}=e;const s=(0,p.useRef)(),[l,c]=(0,p.useState)(!1),[d,u]=(0,p.useState)(!1),[m,g]=(0,p.useState)({x:0,y:0}),[v,b]=(0,p.useState)([]),[A,y]=(0,p.useState)([]),[w,k]=(0,p.useState)([]),[E,x]=(0,p.useState)([]),N=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=s.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?c(!0):setTimeout(e,100)};e()}),[]);(0,p.useEffect)((()=>{var e,t;if(!l)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...n,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(t=window.PUBLIC_ROOT)&&void 0!==t?t:""}${n.filePath}`})}),[l]),(0,p.useEffect)((()=>{var e;if(!l)return;const r=null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;r&&r("yaml",{yaml:(0,Wl.safeDump)(t,{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:a,theme:n,uiVersion:i})}),[a,l,t,n,i]);const C=(0,p.useMemo)((()=>{if(d)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[d]);(0,p.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":u(!0);break;case"inspect-hover":b(e.data.payload.outlines);break;case"scroll":g(e.data.payload);break;case"inspect-active":y(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,p.useEffect)((()=>{var e;d&&(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:r}},location.origin))}),[d,r]);const M=(0,p.useCallback)((e=>e.map((e=>{var t,n,i,a;const r=null!==(t=null==s||null===(n=s.current)||void 0===n?void 0:n.offsetLeft)&&void 0!==t?t:0,o=null!==(i=null==s||null===(a=s.current)||void 0===a?void 0:a.offsetTop)&&void 0!==i?i:0,{width:l,height:c,left:d,top:p,...h}=e;return{width:1*l,height:1*c,left:1*(d-m.x)+r,top:1*(p-m.y)+o,...h}}))),[m.x,m.y]);return(0,p.useEffect)((()=>{o(A[0])}),[A,o]),(0,p.useEffect)((()=>{x(M(A))}),[A,M]),(0,p.useEffect)((()=>{k(M(v))}),[v,M]),h().createElement("div",{className:f()("container",{inspecting:r})},h().createElement("iframe",{ref:s,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:N,onMouseOut:C}),w.map(((e,t)=>h().createElement(Dl,(0,Rl.A)({key:t,variant:"hover"},e)))),E.map(((e,t)=>h().createElement(Dl,(0,Rl.A)({key:t,variant:"active"},e)))))}Pl=mc,({e:[Fl,Vl,jl,zl,Xl,Kl,Jl,Hl,ql,Yl,Gl,Zl,Ql,ec,Bl],c:[rc,Ul]}=(0,d.A)(Pl,[tc("visual-builder.chat-preview",{styleTexts:[$l.A]})],[[nc({attribute:!1}),1,"storyboard"],[nc(),1,"theme"],[nc(),1,"uiVersion"],[nc(),1,"app"],[nc({type:Boolean}),1,"inspecting"],[ic({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(pc,e),(e,t)=>(0,l.A)(pc,e,t)],[ac(),2,"select"]],0,(e=>uc.has((0,o.A)(e))),m.ReactNextElement)),Ul();let vc=!1;const bc="item:";let Ac=null;function fc(e){e.preventDefault(),e.stopPropagation(),function(e){const t=xc(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(Nc)}},location.origin)}(e)}function yc(e){e.preventDefault(),e.stopPropagation()}const wc=(0,kt.debounce)(((e,t,n)=>{let i=xc(e);if(0===i.length)for(const a of e)if(a instanceof HTMLElement&&a.shadowRoot){i=xc(a.shadowRoot.elementsFromPoint(t,n));break}const a=i.length>0?i[0].element:null;a!==Ac&&(Ac=a,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:i.map(Nc)}},location.origin))}),20,{leading:!0});function kc(e){wc(e.composedPath(),e.clientX,e.clientY)}function Ec(e){e.preventDefault(),e.stopPropagation(),Ac=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function xc(e){const t=[];return e.forEach((e=>{let n;if(e.nodeType===Node.ELEMENT_NODE&&e instanceof HTMLElement&&(n=e.dataset.iid)&&n.startsWith(bc)){const i=n.substring(bc.length);t.push({type:"item",uuid:i,label:Cc(e),element:e})}})),t}function Nc(e){const{element:t,type:n,uuid:i,label:a}=e,{width:r,height:o,left:s,top:l}=t.getBoundingClientRect();return{width:r,height:o,left:s+window.scrollX,top:l+window.scrollY,type:n,uuid:i,label:a}}function Cc(e){return e.tagName.toLowerCase().split(".").pop()}let Mc=!1;function Tc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,ms.createProviderClass)((async function(){Mc||(Mc=!0,n.e(2201).then(n.bind(n,2201)),Tc({type:"initialized"}),window.addEventListener("message",(e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"toggle-inspecting":!function(e){if(vc===e)return;vc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",fc,!0),window[t]("mousedown",yc,!0),window[t]("mouseover",yc,!0),window[t]("mouseup",yc,!0),window[t]("pointerdown",yc,!0),window[t]("pointerover",yc,!0),window[t]("pointerup",yc,!0),window[t]("pointerleave",Ec,!0),window[t]("pointermove",kc,!0)}(e.data.payload.inspecting);break;case"select":!function(e){const t=function(e,t){const n=[];return function t(i){const a=i.querySelectorAll(`[data-iid="${e}"]`);if(n.push(...a),!(i===document&&a.length>0))for(const e of i.querySelectorAll("*"))e.shadowRoot&&t(e.shadowRoot)}(document),n}(`${e.type}:${e.uuid}`);window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map((t=>Nc({...e,element:t,label:Cc(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{Tc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var Lc,Ic=n(4014),Sc=n(8918);let Oc,_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc;const{defineElement:jc,property:zc}=(0,u.createDecorators)();let Xc;var Kc=new WeakMap,Jc=new WeakMap,Hc=new WeakMap,qc=new WeakMap,Yc=new WeakMap;class Gc extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Kc,_c(this)),(0,r.A)(this,Jc,(Rc(this),Wc(this))),(0,r.A)(this,Hc,(Dc(this),Pc(this))),(0,r.A)(this,qc,($c(this),Bc(this))),(0,r.A)(this,Yc,(Uc(this),Fc(this))),Vc(this)}get generations(){return(0,c.A)(Kc,this)}set generations(e){(0,l.A)(Kc,this,e)}get category(){return(0,c.A)(Jc,this)}set category(e){(0,l.A)(Jc,this,e)}get theme(){return(0,c.A)(Hc,this)}set theme(e){(0,l.A)(Hc,this,e)}get uiVersion(){return(0,c.A)(qc,this)}set uiVersion(e){(0,l.A)(qc,this,e)}get app(){return(0,c.A)(Yc,this)}set app(e){(0,l.A)(Yc,this,e)}render(){return h().createElement(Zc,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Zc(e){let{generations:t,category:n,theme:i,uiVersion:a,app:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),[c,d]=(0,p.useState)(!1),u=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;if(!s)return;const t=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=o.current.contentWindow._preview_only_inject,i={...t,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${t.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>n(e,i,void 0,!0)))).then((()=>{d(!0)}))}),[s]),(0,p.useEffect)((()=>{var e;if(!c)return;const s=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const l=new Map,d=new Map;for(const e of t){var p;let t=l.get(e.propertyId);t||l.set(e.propertyId,t=new Map);let n=t.get(e.rwType);n||t.set(e.rwType,n=new Map),n.set(null!==(p=e.displayLevel)&&void 0!==p?p:0,e),d.set(e.propertyId,e.mockData)}const h=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"类别",className:"head-cell"}},{brick:"div",properties:{textContent:"展示等级",className:"head-cell last-col-cell",style:{gridColumn:"span 5",textAlign:"center"}}}],u={brick:"visual-builder.pre-generated-table-view",properties:{style:{gridTemplateColumns:"120px 80px repeat(5, 1fr)"}},children:h};let m=0;for(const[e,t]of l){let i=0;const a=m===l.size-1;for(const[r,o]of t){if(0===i){let n;for(const t of o.values()){var g;n=null!==(g=t.propertyName)&&void 0!==g?g:e;break}h.push({brick:"div",properties:{textContent:n,className:f()("body-cell",{"last-row-cell":a}),style:{gridRow:`span ${t.size}`}}})}const s=a&&i===t.size-1;h.push({brick:"div",properties:{textContent:r,className:f()("body-cell",{"last-row-cell":s})}});for(let t=-2;t<3;t++){var v,b,A;const i=o.get(t),a=null!==(v=null==i?void 0:i.category)&&void 0!==v?v:n;let r;if(null!=i&&null!==(b=i.mockData)&&void 0!==b&&b.length){const t=i.mockData[Math.floor(Math.random()*i.mockData.length)];switch(a){case"detail-item":case"form-item":case"card-item":r={[e]:t};break;case"table-column":r={cellData:t}}}const l=[].concat(null!==(A=null==i?void 0:i.storyboard)&&void 0!==A?A:[]).filter((e=>!!(0,ms.isObject)(e)||(console.error("Unexpected type of storyboard:",typeof e),!1)));let c;switch(l.forEach(Qc),a){case"form-item":c={brick:"eo-form",properties:{layout:"inline",values:r,className:"form-container"},children:l.map((e=>({...e,errorBoundary:!0})))};break;case"card-item":c={brick:":forEach",dataSource:[r],children:l.map((e=>({...e,errorBoundary:!0})))};break;default:c={brick:"visual-builder.pre-generated-container",properties:{useBrick:l,dataSource:r},errorBoundary:!0}}h.push({brick:"div",properties:{className:f()("body-cell",{"last-col-cell":2===t,"last-row-cell":s})},children:[{...c,errorBoundary:!0}]})}i++}m++}s("yaml",{yaml:(0,Wl.safeDump)(u,{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:r,theme:i,uiVersion:a,styleText:Sc.A})}),[r,c,t,i,a,n]),h().createElement("div",{className:f()("container")},h().createElement("iframe",{ref:o,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:u}))}function Qc(e){var t;null!==(t=e.properties)&&void 0!==t&&t.prefix&&(console.error("Unexpected readonly property of 'prefix' in:",e),delete e.properties.prefix)}Lc=Gc,({e:[_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc],c:[Xc,Oc]}=(0,d.A)(Lc,[jc("visual-builder.pre-generated-preview",{styleTexts:[Ic.A]})],[[zc({attribute:!1}),1,"generations"],[zc(),1,"category"],[zc(),1,"theme"],[zc(),1,"uiVersion"],[zc(),1,"app"]],0,void 0,m.ReactNextElement)),Oc();var ed,td=n(9216);let nd;const{defineElement:id}=(0,u.createDecorators)();let ad;class rd extends m.ReactNextElement{render(){return h().createElement(od,null)}}function od(){return h().createElement("slot",null)}ed=rd,[ad,nd]=(0,d.A)(ed,[id("visual-builder.pre-generated-table-view",{styleTexts:[td.A]})],[],0,void 0,m.ReactNextElement).c,nd();var sd,ld=n(4967);let cd,dd,pd,hd,ud;const{defineElement:md,property:gd}=(0,u.createDecorators)();let vd;var bd=new WeakMap,Ad=new WeakMap;class fd extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,bd,dd(this)),(0,r.A)(this,Ad,(pd(this),hd(this))),ud(this)}get useBrick(){return(0,c.A)(bd,this)}set useBrick(e){(0,l.A)(bd,this,e)}get dataSource(){return(0,c.A)(Ad,this)}set dataSource(e){(0,l.A)(Ad,this,e)}render(){return h().createElement(yd,{useBrick:this.useBrick,dataSource:this.dataSource})}}function yd(e){let{useBrick:t,dataSource:n}=e;return t?h().createElement(Zr.ReactUseMultipleBricks,{useBrick:t,data:n,errorBoundary:!0}):null}sd=fd,({e:[dd,pd,hd,ud],c:[vd,cd]}=(0,d.A)(sd,[md("visual-builder.pre-generated-container",{styleTexts:[ld.A]})],[[gd({attribute:!1}),1,"useBrick"],[gd({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),cd(),n(2080),customElements.define("visual-builder.check-editor-by-name",(0,ms.createProviderClass)((async function(e){try{await et.__secret_internals.loadEditors([e])}catch{return!1}return!!et.customEditors.get(e)})));var wd=n(6376);function kd(e,t){const n=new Map;for(const i of e){const e=(0,wd.collectMemberUsage)([i.if,i.value,i.resolve],t);n.set(i,e)}return n}function Ed(e,t){e.forEach((n=>{!function(e,t){var n;const{dependencyList:i,nodeList:a,parents:r,result:o}=t,s=(0,kt.cloneDeep)(e);o.push(s);const l=i.find((e=>e.node.key===s.key));if(null!==(n=l.deps)&&void 0!==n&&n.length&&!r.some((e=>e.key===s.key))){const e=s.children=[];!function(e,t){const n=[];e.deps.forEach((e=>{const i=t.nodeList.filter((t=>t.name===e));n.push(...i)})),Ed(n,t)}(l,{dependencyList:i,nodeList:a,parents:[...r,s],result:e})}}(n,{...t,nodeList:e})}))}customElements.define("visual-builder.get-data-deps",(0,ms.createProviderClass)(kd)),customElements.define("visual-builder.get-dependency-tree",(0,ms.createProviderClass)((function(e,t){const n=e,i=kd(n.map((e=>e.data)),t.dataType),a=[];for(const[e,t]of i)a.push({deps:Array.from(t.usedProperties),node:n.find((t=>t.data===e))});const r=[];return Ed(n,{result:r,dependencyList:a,parents:[]}),r})));let xd=et.__secret_internals;try{var Nd;const e=window.dll;if(e&&null!==(Nd=window.BRICK_NEXT_VERSIONS)&&void 0!==Nd&&null!==(Nd=Nd["brick-container"])&&void 0!==Nd&&Nd.startsWith("2.")){const{developHelper:t}=e("tYg3");xd={getBrickPackagesById(e){var n;return null===(n=t.getBrickPackages)||void 0===n?void 0:n.call(t).find((t=>t.id===e))}}}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}const Cd=xd;var Md,Td=n(1304),Ld=n(9034),Id=n(4162);let Sd,Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,jd,zd,Xd,Kd,Jd,Hd,qd,Yd,Gd,Zd,Qd,ep,tp,np,ip,ap,rp;const{defineElement:op,property:sp,event:lp}=(0,u.createDecorators)();let cp;var dp=new WeakMap,pp=new WeakMap,hp=new WeakMap,up=new WeakMap,mp=new WeakMap,gp=new WeakMap,vp=new WeakMap,bp=new WeakMap,Ap=new WeakMap,fp=new WeakSet,yp=new WeakMap,wp=new WeakMap,kp=new WeakMap,Ep=new WeakMap,xp=new WeakMap;class Np extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,fp),(0,r.A)(this,dp,Od(this)),(0,r.A)(this,pp,(_d(this),Rd(this))),(0,r.A)(this,hp,(Wd(this),Dd(this))),(0,r.A)(this,up,(Pd(this),$d(this))),(0,r.A)(this,mp,(Bd(this),Ud(this))),(0,r.A)(this,gp,(Fd(this),Vd(this))),(0,r.A)(this,vp,(jd(this),zd(this))),(0,r.A)(this,bp,(Xd(this),Kd(this))),(0,r.A)(this,Ap,(Jd(this),Hd(this))),(0,r.A)(this,yp,(Gd(this),e=>{(0,s.A)(fp,this,qd).emit(e)})),(0,r.A)(this,wp,Zd(this)),(0,r.A)(this,kp,(tp(this),e=>{(0,s.A)(fp,this,Qd).emit(e)})),(0,r.A)(this,Ep,np(this)),(0,r.A)(this,xp,(rp(this),e=>{(0,s.A)(fp,this,ip).emit(e)}))}get previewUrl(){return(0,c.A)(dp,this)}set previewUrl(e){(0,l.A)(dp,this,e)}get generations(){return(0,c.A)(pp,this)}set generations(e){(0,l.A)(pp,this,e)}get mocks(){return(0,c.A)(hp,this)}set mocks(e){(0,l.A)(hp,this,e)}get busy(){return(0,c.A)(up,this)}set busy(e){(0,l.A)(up,this,e)}get category(){return(0,c.A)(mp,this)}set category(e){(0,l.A)(mp,this,e)}get theme(){return(0,c.A)(gp,this)}set theme(e){(0,l.A)(gp,this,e)}get uiVersion(){return(0,c.A)(vp,this)}set uiVersion(e){(0,l.A)(vp,this,e)}get app(){return(0,c.A)(bp,this)}set app(e){(0,l.A)(bp,this,e)}render(){return h().createElement(Cp,{previewUrl:this.previewUrl,generations:this.generations,mocks:this.mocks,busy:this.busy,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app,onComment:(0,c.A)(yp,this),onApprove:(0,c.A)(kp,this),onViewAttrPrompt:(0,c.A)(xp,this)})}}function Cp(e){let{previewUrl:t,generations:n,mocks:i,busy:a,category:r,theme:o,uiVersion:s,app:l,onComment:c,onApprove:d,onViewAttrPrompt:u}=e;const m=(0,p.useRef)(),[g,v]=(0,p.useState)(!1),[b,A]=(0,p.useState)(!1),y=(0,p.useRef)([]),w=(0,p.useRef)([]),k=(0,p.useRef)([]);(0,p.useEffect)((()=>{var e;k.current=null!==(e=null==n?void 0:n.filter((e=>e.approved)).map((e=>e.propertyId)))&&void 0!==e?e:[]}),[n]);const E=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=m.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?v(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{g&&m.current.contentWindow.postMessage({channel:"raw-data-preview",type:"busy",payload:a},location.origin)}),[a,g]),(0,p.useEffect)((()=>{if(g){const e=m.current.contentWindow,t=e=>{let{data:t}=e;if("raw-data-preview"===(null==t?void 0:t.channel))switch(t.type){case"comment":c(t.payload);break;case"approve":d(t.payload);break;case"viewAttrPrompt":u(t.payload);break;case"updatePropertyToggleState":y.current=t.payload;break;case"updatePropertyExpandState":w.current=t.payload;break;case"updatePropertyApproveState":k.current=t.payload}};return e.addEventListener("message",t),()=>{e.removeEventListener("message",t)}}}),[d,c,u,g]),(0,p.useEffect)((()=>{var e;if(!g)return;const n=Cd.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=m.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>i(e,a,void 0,!0)))).then((()=>{A(!0)}))}),[t,g]),(0,p.useEffect)((()=>{var e;if(!b)return;const t=null===(e=m.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!t)return;const a=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"",className:"head-cell"}},{brick:"div",properties:{textContent:"类型",className:"head-cell"}},{brick:"div",properties:{textContent:"原始数据",className:"head-cell"}},{brick:"div",properties:{textContent:"视觉重量 (由低至高)",className:"head-cell",style:{gridColumn:"span 4",textAlign:"center"}}},{brick:"div",properties:{textContent:"确认",className:"head-cell"}},{brick:"div",properties:{className:"head-cell last-col-cell"},children:[{brick:"span",properties:{textContent:"批注"}},{brick:"span",properties:{className:"tips",textContent:"(补充提示词,按住 ⌘ 或 ctrl + 回车提交)"}}]}],r={brick:"visual-builder.pre-generated-table-view",context:[{name:"propertyToggleState",value:y.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyToggleState",payload:"<% CTX.propertyToggleState %>"}]}},{name:"propertyExpandState",value:w.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyExpandState",payload:"<% CTX.propertyExpandState %>"}]}},{name:"propertyApproveState",value:k.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyApproveState",payload:"<% CTX.propertyApproveState %>"}]}},{name:"busy"}],properties:{style:{gridTemplateColumns:"minmax(120px, 0.5fr) 32px auto repeat(5, 1fr) auto 1fr"}},children:a};for(let e=0,t=n.length;e<t;e++){var c,d;const r=n[e],o=e===t-1,s=new Map;for(const e of null!==(p=r.candidates)&&void 0!==p?p:[]){var p,h;s.set(null!==(h=e.visualWeight)&&void 0!==h?h:0,e)}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"span",properties:{textContent:`${null!==(c=r.propertyName)&&void 0!==c?c:r.propertyId}`}},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyToggleState",`<%\n CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyToggleState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyToggleState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]},{brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:null!==(d=r.candidates)&&void 0!==d&&d.length?[{brick:"eo-icon",properties:{lib:"fa",prefix:"fas",icon:"circle",style:{color:r.generationId?"var(--palette-green-6)":"var(--palette-gray-6)",transformOrigin:"center center",transform:"scale(0.5)"}}}]:void 0},{brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"eo-link",properties:{type:"text",textContent:r.propertyType},events:{click:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"viewAttrPrompt",payload:r}]}}}]});let l=r.propertyValues;if(!l){var u,g;const e=(null!==(u=null!==(g=r.mockData)&&void 0!==g?g:i)&&void 0!==u?u:[]).slice();e.sort(((e,t)=>{const n=null==e?void 0:e[r.propertyId],i=null==t?void 0:t[r.propertyId],a=Array.isArray(n),o=Array.isArray(i);if(a||o)return(o?i.length:-1)-(a?n.length:-1);const s=null==n,l=null==i;if(s||l)return(l?0:1)-(s?0:1);const c="string"==typeof n&&0===n.length,d="string"==typeof i&&0===i.length;return c||d?(d?0:1)-(c?0:1):0})),l=e.map((e=>e[r.propertyId]))}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:l.map(((e,t)=>({brick:"div",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{className:`<%= \`raw-content\${ CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? " expand" : "" }\` %>`,textContent:void 0===e?"":"string"==typeof e?e:JSON.stringify(e,null,2)}})))},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyExpandState",`<%\n CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyExpandState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyExpandState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]});for(let e=-1;e<3;e++){const t=s.get(e);let n;t&&(n=(0,Td.w)(t,r.propertyId)),a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:n?l.map(((e,t)=>({brick:"visual-builder.pre-generated-container",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{useBrick:[n],dataSource:{[r.propertyId]:e}},errorBoundary:!0}))):void 0}]})}a.push({brick:"div",properties:{className:f()("body-cell",{"last-row-cell":o})},children:r.candidates?[{brick:"eo-checkbox",properties:{value:`<%= CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) ? ["approved"] : [] %>`,options:[{label:"",value:"approved"}],disabled:`<%= CTX.busy || ${JSON.stringify(!r.generationId)} %>`},events:{change:[{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"approve",payload:{approved:"<% EVENT.detail.length > 0 %>",propertyInstanceId:r.propertyInstanceId}}]},{action:"context.replace",args:["propertyApproveState",`<%\n EVENT.detail.length > 0\n ? CTX.propertyApproveState.concat(${JSON.stringify(r.propertyId)})\n : CTX.propertyApproveState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n %>`]}]}}]:void 0},{brick:"div",properties:{className:f()("body-cell",{"last-col-cell":!0,"last-row-cell":o})},children:r.candidates?[{brick:"eo-textarea",properties:{value:r.comment?`<% ${JSON.stringify(r.comment)} %>`:void 0,autoSize:!0,style:{width:"100%"},disabled:`<%= CTX.busy || CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) %>`},events:{keydown:{if:"<% EVENT.code === 'Enter' && (EVENT.metaKey || EVENT.ctrlKey) %>",action:"window.postMessage",args:[{channel:"raw-data-preview",type:"comment",payload:{comment:"<% EVENT.target.value %>",propertyInstanceId:r.propertyInstanceId}}]}}}]:void 0})}t("yaml",{yaml:(0,Wl.safeDump)([r,{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'raw-data-preview' && EVENT.detail.data.type === 'busy' %>",action:"context.replace",args:["busy","<% EVENT.detail.data.payload %>"]}},portal:!0,errorBoundary:!0}],{schema:Wl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:Id.A})}),[l,b,n,o,s,r,i]),h().createElement("div",{className:f()("container")},h().createElement("iframe",{ref:m,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:E}))}Md=Np,({e:[Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,jd,zd,Xd,Kd,Jd,Hd,qd,Yd,Gd,Zd,Qd,ep,tp,np,ip,ap,rp],c:[cp,Sd]}=(0,d.A)(Md,[op("visual-builder.raw-data-preview",{styleTexts:[Ld.A]})],[[sp(),1,"previewUrl"],[sp({attribute:!1}),1,"generations"],[sp({attribute:!1}),1,"mocks"],[sp({type:Boolean}),1,"busy"],[sp(),1,"category"],[sp(),1,"theme"],[sp(),1,"uiVersion"],[sp(),1,"app"],[lp({type:"comment"}),1,"commentEvent",e=>(0,c.A)(Ap,e),(e,t)=>(0,l.A)(Ap,e,t)],[lp({type:"approve"}),1,"approveEvent",e=>(0,c.A)(wp,e),(e,t)=>(0,l.A)(wp,e,t)],[lp({type:"view.attr.prompt"}),1,"viewAttrPromptEvent",e=>(0,c.A)(Ep,e),(e,t)=>(0,l.A)(Ep,e,t)]],0,(e=>xp.has((0,o.A)(e))),m.ReactNextElement)),Sd();var Mp=n(264);customElements.define("visual-builder.parse-path",(0,ms.createProviderClass)((async function(e,t){const n=[];return{regexp:(0,Mp.MM)(e,n,(0,kt.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:n}})));var Tp=n(780);customElements.define("visual-builder.batch-update-raw-data-generated-view",(0,ms.createProviderClass)((async function(e){return Promise.allSettled(e.map((e=>{let{attrInstanceId:t,...n}=e;return(0,Tp._)("RAW_DATA_GENERATED_VIEW@EASYOPS",{...n,attr:[t]})})))})));var Lp=n(3084),Ip=n(7710),Sp=n(5799),Op=n(4671),_p=n(8397),Rp=n(3404),Wp=n(3287),Dp=n(76);customElements.define("visual-builder.get-raw-data-system-prompts",(0,ms.createProviderClass)((function(){return{boolean:Lp,"date-time":Ip,enum:Sp,number:Op,others:_p,"struct-list":Rp,struct:Wp,json:Dp}})));const Pp="bricks/visual-builder/pre-generated-config";wi.i18n.getFixedT(null,Pp);var $p=n(8027);function Bp(e){const{children:t,slots:n,...i}=e;return{...i,slots:Up(t,n)}}function Up(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...i}of e){const e=null!=t?t:"";(0,ms.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(Bp(i))}}return n}var Fp,Vp=n(8488),jp=n(2120);let zp,Xp,Kp,Jp,Hp,qp,Yp,Gp,Zp,Qp,eh,th,nh,ih,ah,rh,oh;(0,wi.initializeI18n)(Pp,{en:{},zh:{}});const{defineElement:sh,property:lh,event:ch}=(0,u.createDecorators)();let dh;var ph,hh=new WeakMap,uh=new WeakMap,mh=new WeakMap,gh=new WeakMap,vh=new WeakMap,bh=new WeakSet,Ah=new WeakMap,fh=new WeakMap,yh=new WeakMap;class wh extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,bh),(0,r.A)(this,hh,Xp(this)),(0,r.A)(this,uh,(Kp(this),Jp(this))),(0,r.A)(this,mh,(Hp(this),qp(this))),(0,r.A)(this,gh,(Yp(this),Gp(this))),(0,r.A)(this,vh,(Zp(this),Qp(this))),(0,r.A)(this,Ah,(nh(this),ih(this))),(0,r.A)(this,fh,(oh(this),e=>{(0,s.A)(bh,this,eh).emit(e)})),(0,r.A)(this,yh,(e=>{(0,s.A)(bh,this,ah).emit(e)}))}get previewUrl(){return(0,c.A)(hh,this)}set previewUrl(e){(0,l.A)(hh,this,e)}get attrList(){return(0,c.A)(uh,this)}set attrList(e){(0,l.A)(uh,this,e)}get mockList(){return(0,c.A)(mh,this)}set mockList(e){(0,l.A)(mh,this,e)}get containerConfig(){return(0,c.A)(gh,this)}set containerConfig(e){(0,l.A)(gh,this,e)}render(){return h().createElement(kh,{previewUrl:this.previewUrl,attrList:this.attrList,mockList:this.mockList,containerConfig:this.containerConfig,onChange:(0,c.A)(fh,this),onBrickChange:(0,c.A)(yh,this),root:this})}}function kh(e){let{previewUrl:t,attrList:n,mockList:i,containerConfig:a,root:r,onChange:o,onBrickChange:s}=e;const l=(0,p.useRef)(),[c,d]=(0,p.useState)(!1),[u,m]=(0,p.useState)(!1),[g,v]=(0,p.useState)(null);(0,p.useEffect)((()=>{g&&o(g)}),[g,o]),(0,p.useEffect)((()=>{if(g){const e=function(e,t){let{type:n,dataName:i,dataType:a,settings:r}=t;if(!n||!i)return null;const o=`${"state"===a?"STATE":"CTX"}${(0,$p._)(i)}`;if("chart"===n){var s,l;const e=`<%= ${o}${null!=r&&r.pagination?".list":""} %>`;return{brick:"eo-mini-line-chart",properties:{width:600,height:200,xField:null===(s=r.fields)||void 0===s?void 0:s.xField,yField:null===(l=r.fields)||void 0===l?void 0:l.yField,lineColor:"var(--palette-orange-6)",data:e}}}if("cards"===n)return{brick:"eo-grid-layout",properties:{templateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--card-content-gap)"},slots:{"":{type:"bricks",bricks:[{brick:":forEach",dataSource:`<%= ${o}${null!=r&&r.pagination?".list":""} %>`,slots:{"":{type:"bricks",bricks:[{brick:"eo-card-item",properties:{cardTitle:(0,kt.has)(null==r?void 0:r.fields,"title")&&"string"==typeof r.fields.title?`<% ITEM${(0,$p._)(r.fields.title)} %>`:void 0,description:(0,kt.has)(null==r?void 0:r.fields,"description")&&"string"==typeof r.fields.description?`<% ITEM${(0,$p._)(r.fields.description)} %>`:void 0}}]}}}]}}};const c=`<%= ${null!=r&&r.pagination?o:`{ list: ${o} }`} %>`,d=new Map;for(const t of e)if(t.config){const e="table"===n?(0,Td.m)(t.config,".cellData"):(0,Td.w)(t.config,t.id);e&&d.set(t.id,Bp(e))}const p=Object.fromEntries(e.map((e=>{const t=d.get(e.id);return t?[`[${e.id}]`,{type:"bricks",bricks:[t]}]:null})).filter(Boolean));switch(n){case"table":return{brick:"eo-next-table",properties:{rowKey:"instanceId",columns:e.map((e=>{const t={title:e.name,dataIndex:e.id,key:e.id};return d.has(e.id)&&(t.useChildren=`[${e.id}]`),t})),dataSource:c,...null!=r&&r.pagination?null:{pagination:!1}},slots:p};case"descriptions":return{brick:"eo-descriptions",properties:{column:2,list:e.map((e=>{const t={label:e.name};return e.config&&(t.useChildren=`[${e.id}]`),t})),dataSource:c},slots:p}}return null}(g,a);s(e)}}),[g,a,s]);const b=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=l.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?d(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow;if(!c||!t)return;const n=new ResizeObserver((()=>{r.style.height=`${t.document.body.scrollHeight}px`}));return n.observe(t.document.body),()=>n.disconnect()}),[c,r]),(0,p.useEffect)((()=>{var e;if(!c)return;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow,n=e=>{let{data:t}=e;"pre-generated-config"===(null==t?void 0:t.channel)&&"config-change"===t.type&&v(t.payload)};return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}}),[c]),(0,p.useEffect)((()=>{var e;if(!c)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=l.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled([i("visual-builder.pre-generated-container",a,void 0,!0)]).then((()=>{m(!0)}))}),[t,c]),(0,p.useEffect)((()=>{var e,t,a,r,o;if(!u)return;const s=null===(e=l.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const c=null!==(t=null==n?void 0:n.slice(0,5))&&void 0!==t?t:[],d=c.map((e=>e.id)),p=(0,kt.uniqueId)("event-agent-");s("yaml",{yaml:(0,Wl.safeDump)([{brick:"eo-next-table",errorBoundary:!0,properties:{pagination:!1,rowSelection:!0,rowKey:"id",rowDraggable:!0,bordered:!0,dataSource:{list:n},selectedRowKeys:d,columns:[{title:"ID",dataIndex:"id",key:"id",width:"20%"},{title:"Name",dataIndex:"name",key:"name",width:"20%"},{title:"Preview",dataIndex:"preview",key:"preview",colSpan:2,useBrick:{brick:"div",children:null==n?void 0:n.flatMap((e=>{var t,n,a;const r=null===(t=e.candidates)||void 0===t?void 0:t.map((t=>{const n=`<%=\n DATA.rowData.id === ${JSON.stringify(e.id)} &&\n ${JSON.stringify(t.visualWeight)} === CTX.weightMap.get(${JSON.stringify(e.id)})\n %>`,a=(0,Td.w)(t,e.id);var r;if(a)return{if:n,brick:"visual-builder.pre-generated-container",properties:{useBrick:a,dataSource:null!==(r=null==i?void 0:i[0])&&void 0!==r?r:{}}}})).filter(Boolean);return null!=r&&r.length?r:{if:`<% DATA.rowData.id === ${JSON.stringify(e.id)} %>`,brick:"span",properties:{textContent:null!==(n=null==i||null===(a=i[0])||void 0===a?void 0:a[e.id])&&void 0!==n?n:""}}}))}},{dataIndex:"operations",key:"operations",colSpan:0,width:81,useBrick:{if:"<% CTX.availableWeights.get(DATA.rowData.id)?.length %>",brick:"eo-mini-actions",properties:{actions:'<%=\n [\n {\n icon: {\n lib: "antd",\n icon: "minus",\n },\n event: "minus",\n disabled: CTX.weightMap.get(DATA.rowData.id) <= CTX.availableWeights.get(DATA.rowData.id)[0],\n },\n {\n icon: {\n lib: "antd",\n icon: "plus",\n },\n event: "plus",\n disabled: CTX.weightMap.get(DATA.rowData.id) >= CTX.availableWeights.get(DATA.rowData.id).slice(-1)[0],\n },\n ]\n %>'},events:{minus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, -1) %>"]},plus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, 1) %>"]}}}}]},events:{"row.select":{action:"context.replace",args:["selectedAttrs","<%= EVENT.detail.rows %>"]},"row.drag":{action:"context.replace",args:["orderedAttrIds","<%= EVENT.detail.list.map((attr) => attr.id) %>"]}}},{brick:"eo-event-agent",properties:{id:p},events:{trigger:{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"config-change",payload:"<% FN.getConfig(CTX.selectedAttrs, CTX.orderedAttrIds, CTX.weightMap) %>"}]}},lifeCycle:{onPageLoad:{target:`#${p}`,method:"trigger"}},portal:!0,errorBoundary:!0},{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'pre-generated-config' && EVENT.detail.data.type === 'get-config' %>",action:"window.postMessage",args:[{channel:"pre-generated-config",type:"get-config-response",id:"<%= EVENT.detail.data.id %>",payload:"<% FN.getConfig(CTX.selectedAttrs, CTX.orderedAttrIds, CTX.weightMap) %>"}]}},portal:!0,errorBoundary:!0}],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:jp.A,context:[{name:"orderedAttrIds",value:null!==(a=null==n?void 0:n.map((e=>e.id)))&&void 0!==a?a:[],onChange:{target:`#${p}`,method:"trigger"}},{name:"selectedAttrs",value:c,onChange:{target:`#${p}`,method:"trigger"}},{name:"availableWeights",value:`<% new Map(${JSON.stringify(null!==(r=null==n?void 0:n.map((e=>{var t,n;return[e.id,null!==(t=null===(n=e.candidates)||void 0===n?void 0:n.map((e=>e.visualWeight)).sort(((e,t)=>e-t)))&&void 0!==t?t:[]]})))&&void 0!==r?r:[])}) %>`},{name:"weightMap",value:`<% new Map(${JSON.stringify(null!==(o=null==n?void 0:n.map((e=>{var t,n;return[e.id,null===(n=e.candidates,0,t=null==n?void 0:n.reduce(((e,t)=>!e||Math.abs(t.visualWeight-0)<Math.abs(e.visualWeight-0)?t:e)))||void 0===t?void 0:t.visualWeight]})))&&void 0!==o?o:[])}) %>`,onChange:{target:`#${p}`,method:"trigger"}}],functions:[{name:"updateWeightMap",source:"/**\n * @param {Map<string, number>} weightMap\n * @param {Map<string, number[]>} availableWeights\n * @param {string} key\n * @param {1 | -1} direction\n * @returns {Map<string, number>}\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction updateWeightMap(weightMap, availableWeights, key, direction) {\n return new Map([...weightMap].map(_ref => {\n let [k, v] = _ref;\n if (k === key) {\n const weights = availableWeights.get(k);\n const index = weights.indexOf(v);\n const nextIndex = Math.max(0, Math.min(index + direction, weights.length - 1));\n return [k, weights[nextIndex]];\n }\n return [k, v];\n }));\n}"},{name:"getConfig",source:"\n function getConfig(selectedAttrs, orderedAttrIds, weightMap) {\n return selectedAttrs.map((attr) => ({\n id: attr.id,\n name: attr.name,\n config: attr.candidates?.find((can) => can.visualWeight === weightMap.get(attr.id)),\n })).sort((a, b) => orderedAttrIds.indexOf(a.id) - orderedAttrIds.indexOf(b.id));\n }\n "}]})}),[n,u,i]),h().createElement("div",{className:"container"},h().createElement("iframe",{ref:l,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:b}))}let Eh,xh,Nh,Ch,Mh,Th,Lh,Ih,Sh;Fp=wh,({e:[Xp,Kp,Jp,Hp,qp,Yp,Gp,Zp,Qp,eh,th,nh,ih,ah,rh,oh],c:[dh,zp]}=(0,d.A)(Fp,[sh("visual-builder.pre-generated-config",{styleTexts:[Vp.A]})],[[lh(),1,"previewUrl"],[lh({attribute:!1}),1,"attrList"],[lh({attribute:!1}),1,"mockList"],[lh({attribute:!1}),1,"containerConfig"],[ch({type:"change"}),1,"changeEvent",e=>(0,c.A)(vh,e),(e,t)=>(0,l.A)(vh,e,t)],[ch({type:"brick.change"}),1,"brickChangeEvent",e=>(0,c.A)(Ah,e),(e,t)=>(0,l.A)(Ah,e,t)]],0,(e=>yh.has((0,o.A)(e))),m.ReactNextElement)),zp();const{defineElement:Oh,property:_h}=(0,u.createDecorators)();let Rh;var Wh=new WeakMap,Dh=new WeakMap,Ph=new WeakMap,$h=new WeakMap;class Bh extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Wh,xh(this)),(0,r.A)(this,Dh,(Nh(this),Ch(this))),(0,r.A)(this,Ph,(Mh(this),Th(this))),(0,r.A)(this,$h,(Lh(this),Ih(this))),Sh(this)}get previewUrl(){return(0,c.A)(Wh,this)}set previewUrl(e){(0,l.A)(Wh,this,e)}get container(){return(0,c.A)(Dh,this)}set container(e){(0,l.A)(Dh,this,e)}get attrList(){return(0,c.A)(Ph,this)}set attrList(e){(0,l.A)(Ph,this,e)}get mockList(){return(0,c.A)($h,this)}set mockList(e){(0,l.A)($h,this,e)}render(){return h().createElement(Uh,{root:this,previewUrl:this.previewUrl,container:this.container,attrList:this.attrList,mockList:this.mockList})}}function Uh(e){let{root:t,previewUrl:n,container:i,attrList:a,mockList:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),c=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const n=null===(e=o.current)||void 0===e?void 0:e.contentWindow;if(!s||!n)return;const i=new ResizeObserver((()=>{t.style.height=`${n.document.body.scrollHeight}px`}));return i.observe(n.document.body),()=>i.disconnect()}),[s,t]),(0,p.useEffect)((()=>{var e,t;const n=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s||!n||!a)return;let l;l="descriptions"===i?{brick:"eo-descriptions",errorBoundary:!0,properties:{column:2,list:a.map((e=>{const t={label:e.name};return e.config&&(t.useBrick=(0,Td.w)(e.config,e.id)),t})),dataSource:null==r?void 0:r[0]}}:{brick:"eo-next-table",errorBoundary:!0,properties:{rowKey:null===(t=a[0])||void 0===t?void 0:t.id,columns:a.map((e=>{const t={title:e.name,dataIndex:e.id,key:e.id};return e.config&&(t.useBrick=(0,Td.m)(e.config,".cellData")),t})),dataSource:{list:r,page:1,pageSize:20}}},n("yaml",{yaml:(0,Wl.safeDump)([l],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:jp.A})}),[s,a,r,i]),h().createElement("div",{className:"container"},h().createElement("iframe",{ref:o,src:null!=n?n:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:c}))}ph=Bh,({e:[xh,Nh,Ch,Mh,Th,Lh,Ih,Sh],c:[Rh,Eh]}=(0,d.A)(ph,[Oh("visual-builder.pre-generated-config-preview",{styleTexts:[Vp.A]})],[[_h(),1,"previewUrl"],[_h(),1,"container"],[_h({attribute:!1}),1,"attrList"],[_h({attribute:!1}),1,"mockList"]],0,void 0,m.ReactNextElement)),Eh();var Fh=n(8406);function Vh(e){switch(e){case"list":return[{label:"表格",value:"table"},{label:"卡片列表",value:"cards"}];case"list-with-pagination":return[{label:"表格",value:"table",settings:{pagination:!0}},{label:"卡片列表",value:"cards",settings:{pagination:!0}}];case"object":return[{label:"属性详情",value:"descriptions"}];default:return[]}}customElements.define("visual-builder.get-config-by-data-for-ai",(0,ms.createProviderClass)((async function(e){if(null==(null==e?void 0:e.value))return null;const{value:t}=e;let n,i="unknown",a=[];if(Array.isArray(t))t.length>0&&(i="list",n=t[0],a=t);else if((0,kt.isObject)(t)){const e=t;(0,ms.hasOwnProperty)(e,"list")&&Array.isArray(e.list)&&(0,ms.hasOwnProperty)(e,"page")&&"number"==typeof e.page&&(0,ms.hasOwnProperty)(e,"total")&&"number"==typeof e.total?e.list.length>0&&(i="list-with-pagination",n=e.list[0],a=e.list):(i="object",n=t,a=[n])}const r=new Set;for(const e of a){if(!(0,kt.isObject)(e)){i="unknown";break}for(const t of Object.keys(e))r.add(t)}let o=[];if("unknown"!==i&&(0,kt.isObject)(n)&&(0,ms.hasOwnProperty)(n,"_object_id")&&"string"==typeof n._object_id){const e=n._object_id,{list:t}=await(0,Fh.y)("MODEL_OBJECT",{fields:["name","objectId","attrList.id","attrList.name","attrList.generatedView.list"],query:{objectId:e,ignore:{$ne:!0}},page:1});0===t.length?console.warn("Can not find object by objectId:",e):o=t[0].attrList.map((e=>{var t;return r.has(e.id)?{id:e.id,name:e.name,candidates:null===(t=e.generatedView)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.list}:null})).filter(Boolean)}else console.warn("Can not detect objectId with data:",e),o=[...r].map((e=>({id:e,name:e})));return{type:i,attrList:o,dataList:a,containerOptions:Vh(i)}})))},2080:(e,t,n)=>{n.d(t,{ADVANCED_CHANGE_KEY:()=>Te,SchemaField:()=>Le});var i,a=n(4635),r=n(918),o=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),p=n(8769),h=n.n(p),u=n(1123),m=n(9006),g=(n(6477),n(5908)),v=n(7091),b=n(7428),A=n(6768),f=n(5694),y=n(9708),w=n(3848),k=n(3768),E=n(2803),x=n(3824),N=n(2513),C=n(5067),M=n(1477),T=n(4287),L=n(966),I=n(5768),S=n(6110),O=n(5944),_=n(8409),R=n(2716),W=n(3995),D=(n(74),n(1030)),P=n.n(D);let $,B,U,F,V,j,z,X,K,J,H,q,Y,G,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,he,ue,me,ge,ve,be,Ae,fe,ye,we;const{defineElement:ke,property:Ee,method:xe,event:Ne}=(0,u.createDecorators)(),Ce=h().forwardRef(et),Me="before_submit",Te="on_advanced_change",Le=(0,v.Uy)({components:{FormLayout:y.Hb,Input:y.pd,FormItem:E.M,FormItemWithoutAdvanced:y.eI,FormCollapse:y.w9,NumberPicker:y.Y_,Radio:y.sx,Select:y.l6,Switch:y.dO,CategoryTitle:k.H,CodeEditor:x.S,IconSelect:N.r,ColorPicker:C.h,UseChildrenSelect:I._,InputWithUrl:M.r,InputWithUnit:L.U,TextAlignRadio:T.p,CustomOptions:O.F,BoxSize:S.i,CustomTab:_.v}});let Ie,Se;var Oe=new WeakMap,_e=new WeakMap,Re=new WeakMap,We=new WeakMap,De=new WeakMap,Pe=new WeakMap,$e=new WeakMap,Be=new WeakMap,Ue=new WeakMap,Fe=new WeakMap,Ve=new WeakSet,je=new WeakMap,ze=new WeakMap,Xe=new WeakMap,Ke=new WeakMap,Je=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ge=new WeakMap,Ze=new WeakMap;class Qe extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ve),(0,r.A)(this,Oe,($(this),(0,p.createRef)())),(0,r.A)(this,_e,U(this)),(0,r.A)(this,Re,(F(this),V(this))),(0,r.A)(this,We,(j(this),z(this))),(0,r.A)(this,De,(X(this),K(this))),(0,r.A)(this,Pe,(J(this),H(this))),(0,r.A)(this,$e,(q(this),Y(this))),(0,r.A)(this,Be,(G(this),Z(this))),(0,r.A)(this,Ue,(Q(this),ee(this))),(0,r.A)(this,Fe,(te(this),ne(this))),(0,r.A)(this,je,(re(this),oe(this))),(0,r.A)(this,ze,(ce(this),de(this))),(0,r.A)(this,Xe,(ue(this),e=>{(0,s.A)(Ve,this,pe).emit(e)})),(0,r.A)(this,Ke,me(this)),(0,r.A)(this,Je,(be(this),e=>{(0,s.A)(Ve,this,ge).emit(e)})),(0,r.A)(this,He,void 0),(0,r.A)(this,qe,(0,g.fA)(Me,((e,t)=>n=>{(0,l.A)(He,this,n(e,t))}))),(0,r.A)(this,Ye,Ae(this)),(0,r.A)(this,Ge,(we(this),e=>{(0,s.A)(Ve,this,fe).emit(e)})),(0,r.A)(this,Ze,(e=>{const t="string"==typeof e&&"undefined"===e?void 0:(0,D.omit)(e,["dataset.testid"]),n=[];(0,D.isEmpty)(null==t?void 0:t.dataset)&&n.push("dataset"),(0,D.isEmpty)(null==t?void 0:t.style)&&n.push("style");const i=(0,D.omit)(t,n);if(!(0,D.isEmpty)(i))return i}))}get editorName(){return(0,c.A)(_e,this)}set editorName(e){(0,l.A)(_e,this,e)}get values(){return(0,c.A)(Re,this)}set values(e){(0,l.A)(Re,this,e)}get advancedMode(){return(0,c.A)(We,this)}set advancedMode(e){(0,l.A)(We,this,e)}get dataList(){return(0,c.A)(De,this)}set dataList(e){(0,l.A)(De,this,e)}get editorPackages(){return(0,c.A)(Pe,this)}set editorPackages(e){(0,l.A)(Pe,this,e)}get links(){return(0,c.A)($e,this)}set links(e){(0,l.A)($e,this,e)}get extraLibs(){return(0,c.A)(Be,this)}set extraLibs(e){(0,l.A)(Be,this,e)}get childSlots(){return(0,c.A)(Ue,this)}set childSlots(e){(0,l.A)(Ue,this,e)}validate(){var e;const t=null===(e=(0,c.A)(Oe,this).current)||void 0===e?void 0:e.getFormInstance();(0,l.A)(He,this,null),t.validate().then((()=>{if(this.advancedMode)(0,s.A)(Ve,this,ie).emit(t.values[W.qZ]);else{var e;const n=P().omit(t.values,[W.qZ]);t.notify(Me,n),(0,s.A)(Ve,this,ie).emit(null!==(e=(0,c.A)(He,this))&&void 0!==e?e:n)}})).catch((e=>{(0,s.A)(Ve,this,se).emit(e)}))}render(){return h().createElement(Ce,{ref:(0,c.A)(Oe,this),editorName:this.editorName,values:(0,c.A)(Ze,this).call(this,this.values),advancedMode:this.advancedMode,dataList:this.dataList,extraLibs:this.extraLibs,links:this.links,childSlots:this.childSlots,editorPackages:this.editorPackages,handleValuesChange:(0,c.A)(Xe,this),handleTokenClick:(0,c.A)(Je,this),handleTriggerAction:(0,c.A)(Ge,this),onSubmitEffect:(0,c.A)(qe,this)})}}function et(e,t){let{advancedMode:n,values:i,editorName:a,dataList:r,editorPackages:o,extraLibs:s,childSlots:l,links:c,handleValuesChange:d,handleTokenClick:u,handleTriggerAction:m,onSubmitEffect:y}=e;const[k,E]=(0,p.useState)(Ie),x=(0,w.useCurrentTheme)(),N=(0,p.useMemo)((()=>(0,f.VC)()),[]),C=(0,p.useMemo)((()=>(0,g.DG)()),[k]),M=(0,p.useRef)(null),T=(0,p.useRef)(!1),L=(0,p.useMemo)((()=>(0,g.fA)(Te,((e,t)=>n=>{const i=!e&&t.values[W.qZ]?t.values[W.qZ]:t.values;M.current=n(e,t,i)}))),[]);(0,p.useImperativeHandle)(t,(()=>({getFormInstance:()=>C})));const I=(0,p.useCallback)((async()=>{R.customEditors.get(a)?E((()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(h())})):(await R.__secret_internals.loadEditors([a],o),Ie=()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(h())},E(Ie))}),[a,o]),S=(0,p.useCallback)(((e,t)=>{var n;if(t){const t=P().omit(e,[W.qZ]);return{[W.qZ]:P().isEmpty(t)?"":t}}return null!==(n=e[W.qZ])&&void 0!==n?n:e}),[]);return(0,p.useEffect)((()=>{I()}),[I]),(0,p.useEffect)((()=>{k&&C.setInitialValues(i,"overwrite")}),[k,C]),(0,p.useEffect)((()=>{var e;T.current=!0,M.current=null,C.notify(Te,n),C.query(W.N4).take((e=>{e.display=n?"hidden":"visible"})),C.query(W.qZ).take((e=>{e.display=n?"visible":"hidden"}));const t=C.getState().values,i=S(null!==(e=M.current)&&void 0!==e?e:t,n);C.setValues(i,"overwrite"),T.current=!1}),[n,C,S,k]),(0,p.useEffect)((()=>{C.addEffects("onValueChange",(()=>{(0,g.A$)((e=>{T.current||d(e.values)}))}))}),[C,d]),k?h().createElement("div",{className:"property-form-wrapper"},h().createElement(b.Ay,{prefixCls:"antdV5",theme:{algorithm:"dark-v2"===x?A.A.darkAlgorithm:A.A.defaultAlgorithm,components:{InputNumber:{handleVisible:!0}}},getPopupContainer:e=>e},h().createElement(f.N7,{cache:N},h().createElement(v.Op,{form:C},h().createElement(k,{advancedMode:n,SchemaFieldComponent:Le,form:C,scope:{dataList:r,advancedMode:n,childSlots:l,extraLibs:s,links:c,tokenClick:e=>u(e.detail),triggerAction:m},effects:{onFieldInit:g.yd,onFieldValueChange:g.$l,onFieldInitialValueChange:g.J4,onFormInitialValuesChange:g.oJ,onFormValidateSuccess:g.zu,onFormValuesChange:g.A$,onSubmit:y,onAdvancedChange:L},formilySchemaFormatter:W.cV}))))):null}i=Qe,({e:[U,F,V,j,z,X,K,J,H,q,Y,G,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,he,ue,me,ge,ve,be,Ae,fe,ye,we,$],c:[Se,B]}=(0,d.A)(i,[ke("visual-builder.property-editor",{shadowOptions:!1,dependencies:["eo-icon-select","vs.code-editor","eo-tooltip"]})],[[Ee(),1,"editorName"],[Ee({attribute:!1}),1,"values"],[Ee({type:Boolean}),1,"advancedMode"],[Ee({attribute:!1}),1,"dataList"],[Ee({attribute:!1}),1,"editorPackages"],[Ee({attribute:!1}),1,"links"],[Ee({attribute:!1}),1,"extraLibs"],[Ee({attribute:!1}),1,"childSlots"],[Ne({type:"validate.success"}),1,"successEvent",e=>(0,c.A)(Fe,e),(e,t)=>(0,l.A)(Fe,e,t)],[Ne({type:"validate.error"}),1,"errorEvent",e=>(0,c.A)(je,e),(e,t)=>(0,l.A)(je,e,t)],[xe(),2,"validate"],[Ne({type:"values.change"}),1,"valuesChangeEvent",e=>(0,c.A)(ze,e),(e,t)=>(0,l.A)(ze,e,t)],[Ne({type:"token.click"}),1,"tokenClick",e=>(0,c.A)(Ke,e),(e,t)=>(0,l.A)(Ke,e,t)],[Ne({type:"trigger.action"}),1,"triggerActionEvent",e=>(0,c.A)(Ye,e),(e,t)=>(0,l.A)(Ye,e,t)]],0,(e=>Ze.has((0,o.A)(e))),m.ReactNextElement)),B()},607:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-list-background:#f8f8f8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-list-background:#323237}',""]);const s=o},2984:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-color:#616161;--vb-workbench-action-active-color:#1f1f1f;--vb-workbench-action-active-border-color:#005fb8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-color:rgba(255,255,255,0.4);--vb-workbench-action-active-color:#fff;--vb-workbench-action-active-border-color:#fff}',""]);const s=o},7236:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r),s=n(6131),l=o()(a());l.i(s.A),l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.message{display:flex;gap:8px}.main{flex:1;min-width:0}.label{font-weight:bold;line-height:28px}.message:not(:last-child){margin-bottom:2em}.invisible-dots{opacity:0}.failed .content{color:var(--color-error)}.command:not(:first-child){margin-top:1em}.command:not(:last-child){margin-bottom:1em}pre{white-space:pre-wrap;background-color:var(--palette-gray-3);border-radius:6px;padding:1em}.markdown > :first-child{margin-top:0}.markdown > :last-child{margin-bottom:0}.avatar{align-self:flex-start;display:flex;align-items:center;justify-content:center}.texting::after{content:" ";animation:texting 2s infinite;white-space:pre}@keyframes texting{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}pre[class*="language-"]{overflow:visible}pre[class*="language-"],\ncode[class*="language-"]{white-space:pre-wrap}eo-avatar.role-assistant::part(avatar-icon){background-color:var(--palette-blue-5)}.content{word-wrap:break-word}.plain{white-space:pre-wrap}',""]);const c=l.toString()},1563:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=o.toString()},6213:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.contract-wrapper{display:flex;gap:4px}.contract-selector{flex:1}.version-selector{width:100px}.options-tips{padding:0px 10px;font-weight:400;color:#999;white-space:nowrap;font-style:italic}",""]);const s=o.toString()},7540:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.mask,\n.container{display:none;position:fixed;z-index:1}.mask{top:0;bottom:0;left:0;right:0;z-index:1}:host([active]) .mask,\n:host([active]) .container{display:block}.container{background:var(--antd-dropdown-menu-bg);border-radius:var(--medius-border-radius);padding:5px}.container .title{padding:5px 12px;cursor:default;color:var(--color-secondary-text);border-bottom:1px solid var(--color-text-divider-line)}.container eo-menu{border:none;padding:5px 0}.container eo-menu eo-menu-item:not([disabled]):hover::part(menu-item){background-color:var(--left-sidebar-item-hover-bg)}.container eo-menu eo-menu-item[disabled]::part(menu-item){cursor:not-allowed}.container eo-menu eo-menu-item::part(menu-item){cursor:grab;padding:5px 12px;border-radius:var(--medius-border-radius);min-width:max-content}.container eo-menu eo-menu-item.dragging{opacity:0.5}.container eo-menu eo-tooltip{display:block}",""]);const s=o.toString()},2381:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{--local-node-outline-style:solid;display:block}:host([hidden]){display:none}:host([not-synced]){--local-node-outline-style:dashed}*{box-sizing:border-box}.node{width:168px;max-width:none;height:130px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-moz-fit-content;width:fit-content;padding-bottom:4px}.label,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:18px;font-size:var(--sub-title-font-size-small);color:var(--color-header-text);font-weight:var(--font-weight-500);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.node.editing-label .label{height:0}.node:not(.editing-label) .label-input{display:none}.add-button,\n.icon-container,\n.thumbnail-container,\n.thumbnail-placeholder{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px var(--local-node-outline-style) var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;width:100%;position:relative;flex-direction:column}.thumbnail-placeholder{color:var(--palette-gray-5);font-size:36px;flex:1}.icon-container{font-size:20px;background-color:var(--palette-teal-6);color:var(--palette-gray-4);width:36px;height:36px;border-radius:50%;outline-offset:4px}:host([active]) .thumbnail-container,\n:host([active]) .icon-container{outline:2px var(--local-node-outline-style) var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px var(--local-node-outline-style) var(--palette-blue-3)}.add-button{position:absolute;bottom:-26px;left:calc(50% - 12px);width:24px;height:24px;background:var(--palette-gray-3);color:var(--palette-gray-6);border-radius:50%;cursor:pointer}:host([not-synced]) .add-button,\n:host([disable-child-append]) .add-button,\n:host(:not([active])) .add-button{display:none}.add-button:hover{background:var(--palette-blue-5);color:var(--palette-gray-2)}.external{position:absolute;top:4px;left:4px;padding:0 10px;display:flex;align-items:center;gap:6px;background:var(--palette-purple-4);font-size:12px;line-height:20px;height:22px;cursor:pointer;color:var(--palette-gray-1);border-radius:9999px;right:4px;max-width:-moz-fit-content;max-width:fit-content}.external-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.external:hover{background:var(--palette-purple-5)}.sub-nodes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;width:100%}.sub-node{background-color:var(--palette-gray-2);border-radius:4px;padding:6px;display:flex;flex-direction:column;justify-content:space-between;height:32px}.sub-node-skeleton-title{width:18px;height:4px;border-radius:2px;align-self:flex-start;background-color:var(--palette-gray-4)}.sub-node-skeleton-content{width:100%;height:4px;border-radius:2px;background-color:var(--palette-gray-4)}.sub-node-skeleton-button{width:18px;height:4px;border-radius:2px;align-self:flex-end;background-color:var(--palette-blue-3)}.sub-node:hover{background-color:var(--palette-gray-3)}.sub-node:hover .sub-node-skeleton-title,\n.sub-node:hover .sub-node-skeleton-content{background-color:var(--palette-gray-5)}.sub-node:hover .sub-node-skeleton-button{background-color:var(--palette-blue-4)}",""]);const s=o.toString()},2120:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"#preview-root{padding:0}",""]);const s=o.toString()},8488:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},4967:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}",""]);const s=o.toString()},8918:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold}.head-cell,\n.body-cell{background:var(--body-background)}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}",""]);const s=o.toString()},4014:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},9216:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:grid;width:100%}:host([hidden]){display:none}::slotted(*){padding:4px 8px;border:1px solid var(--theme-gray-border-color);border-left-color:transparent;border-top-color:transparent;min-width:0;word-break:break-word}",""]);const s=o.toString()},4162:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold}.head-cell,\n.body-cell{background:var(--body-background)}.body-cell{display:flex;align-items:center;justify-content:space-between}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}.list{display:flex;flex-direction:column;gap:8px;overflow:hidden}.raw-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-color-secondary)}.raw-content.expand{white-space:pre-wrap}.tips{color:var(--text-color-secondary);font-weight:normal}.body-cell:not(:hover) .btn-toggle{visibility:hidden}",""]);const s=o.toString()},9034:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},9765:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,".custom-scrollbar-container{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.15) rgba(255,255,255,0.03)}.custom-scrollbar-container::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;position:absolute}.custom-scrollbar-container::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0);border-radius:4px}.custom-scrollbar-container:hover::-webkit-scrollbar-track{background-color:rgba(255,255,255,0.03)}.custom-scrollbar-container:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.15)}",""]);const s=o.toString()},3430:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:none;background-color:var(--vb-workbench-action-list-background)}:host([hidden]){display:none}",""]);const s=o.toString()},5292:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:var(--vb-workbench-action-color);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:var(--vb-workbench-action-active-border-color)}.action.active::part(link),\n.action::part(link):hover{color:var(--vb-workbench-active-color)}',""]);const s=o.toString()},1361:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}eo-popover::part(popup){width:800px;max-width:60vw;padding:10px;background:var(--color-fill-bg-container-4);border-radius:var(--medius-border-radius);box-shadow:var(--feedback-container-shadow);z-index:1000}.history-title{font-size:var(--title-font-size);font-weight:var(--font-weight-500);color:var(--color-strong-text);margin-bottom:5px}.history-list{max-height:500px;overflow-y:auto}.item-container{padding:10px 0;display:flex;flex-direction:column;gap:5px}.empty{padding:5px 0 10px 0;font-size:14px;color:var(--text-color-secondary);text-align:center}.item-container:not(:last-of-type){border-bottom:1px solid var(--color-border-divider-line)}.item-title{display:flex;align-items:center;justify-content:space-between;gap:5px}.title-left,\n.title-right{display:flex;align-items:center}.title-left{cursor:pointer;overflow:hidden;gap:5px}.topic{font-size:14px;color:var(--text-color-title);font-weight:var(--font-weight-500);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.branch{font-size:14px;color:var(--text-color-secondary)}.rollback{margin-right:5px;font-size:14px;color:var(--text-color-secondary);cursor:pointer}.rollback:hover{color:var(--color-brand)}.item-info{display:flex;align-items:center;gap:5px}.time,\n.operator{font-size:14px;color:var(--text-color-secondary)}.load-more-container{display:block;text-align:center}.end-container{display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;color:var(--color-brand)}.rollback-all{cursor:pointer}",""]);const s=o.toString()},7180:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':host{display:block;--pane-color:#595959}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--pane-color:#ccc}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.pane{display:flex;flex-direction:column;color:var(--pane-color);height:100%}.pane-header{display:flex;align-items:center;cursor:pointer;border-top:1px solid transparent;position:relative}.pane-header:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#007fd4}:host(:not(:first-child)) .pane-header{border-top-color:rgba(204,204,204,0.2)}.pane-scroll-shadow{display:none;position:absolute;bottom:-3px;left:0;right:0;height:3px;box-shadow:#000000 0 6px 6px -6px inset;z-index:1}.scrolled .pane-scroll-shadow{display:block}.pane-title{display:flex;align-items:center;font-size:13px;line-height:24px;height:25px;min-width:0;flex:1}.title-icon{display:flex;justify-content:center;align-items:center;width:24px;padding-right:2px;line-height:1;flex-shrink:0}.title-label{text-transform:uppercase;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-body{flex-grow:1;min-height:0;display:none;overflow:hidden;overflow-y:auto;overflow-y:overlay}:host([active]) .pane-body{display:initial}:host(:not(:hover)) ::slotted([slot="actions"]){display:none}.badge{background-color:rgb(77,77,77);color:rgb(255,255,255);border-radius:11px;height:18px;padding:3px 6px;line-height:13px;margin:0 3px;font-size:12px}',""]);const s=o.toString()},2150:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r)()(a());o.push([e.id,':host{--sidebar-background:#fff;--title-container-background:#fff;--title-container-color:#595959;display:block;outline-color:rgba(83,89,93,0.5);background-color:var(--sidebar-background);height:100%}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--sidebar-background:#181818;--title-container-background:#181818;--title-container-color:rgb(187,187,187);background-color:var(--sidebar-background)}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.sidebar{display:flex;flex-direction:column;height:100%}.title-container{display:flex;padding:0 8px 8px 8px;color:var(--title-container-color);background:var(--title-container-background)}.title-label{font-weight:300;line-height:44px;padding-left:12px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-container{flex-grow:1;min-height:0;display:flex;flex-direction:column}::slotted([slot="panes"]){transition:flex 0.2s;min-height:25px}',""]);const s=o.toString()},6131:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(6758),a=n.n(i),r=n(935),o=n.n(r),s=n(7745),l=o()(a());l.i(s.A),l.push([e.id,"",""]);const c=l.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=2464.676686cc.js.map
|