@next-bricks/visual-builder 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bricks.json CHANGED
@@ -41,5 +41,5 @@
41
41
  "eo-icon"
42
42
  ]
43
43
  },
44
- "filePath": "bricks/visual-builder/dist/index.30523516.js"
44
+ "filePath": "bricks/visual-builder/dist/index.d48c68fb.js"
45
45
  }
@@ -1,3 +1,3 @@
1
- /*! For license information please see 7757.04433444.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[7757],{7757:(e,t,a)=>{a.r(t);var n,i,o,r,l,c,s,h,d,p,u,b,v,E,g,m,f,w,L,k=a(3395),Z=a(1815),x=a(381),N=a(687),y=a(5066),O=a(8657),R=a.n(O),I=a(5727),A=a(305),M=a(8249),T=a(8453),_=a(2779),D=a.n(_),C=(0,A.wrapBrick)("icons.general-icon"),{defineElement:P,property:U,event:W}=(0,I.createDecorators)();i=P("visual-builder.workbench-pane",{styleTexts:[M.Z,T.Z]}),o=U(),l=U({type:Boolean}),s=U({type:Number}),d=W({type:"active.change"}),v=W({type:"active.firstActivated"});var F=new WeakMap,S=new WeakMap,B=new WeakMap,K=new WeakMap,j=new WeakMap,z=new WeakMap,G=new WeakMap,H=new WeakMap,V=new WeakMap;class Y extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,H,{get:X,set:q}),(0,k.Z)(this,j,{get:$,set:J}),(0,k.Z)(this,F,{writable:!0,value:(f(this),r(this))}),(0,k.Z)(this,S,{writable:!0,value:c(this)}),(0,k.Z)(this,B,{writable:!0,value:h(this)}),(0,k.Z)(this,K,{writable:!0,value:p(this)}),(0,k.Z)(this,z,{writable:!0,value:e=>{e!==this.active&&(this.active=e,(0,N.Z)(this,j).emit(e))}}),(0,k.Z)(this,G,{writable:!0,value:E(this)}),(0,k.Z)(this,V,{writable:!0,value:()=>{(0,N.Z)(this,H).emit()}})}get titleLabel(){return(0,N.Z)(this,F)}set titleLabel(e){(0,x.Z)(this,F,e)}get active(){return(0,N.Z)(this,S)}set active(e){(0,x.Z)(this,S,e)}get badge(){return(0,N.Z)(this,B)}set badge(e){(0,x.Z)(this,B,e)}render(){return R().createElement(Q,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,N.Z)(this,z),onFirstActivated:(0,N.Z)(this,V)})}}function J(e){b(this,e)}function $(){return u(this)}function q(e){m(this,e)}function X(){return g(this)}function Q(e){var{titleLabel:t,active:a,badge:n,onActiveChange:i,onFirstActivated:o}=e,[r,l]=(0,O.useState)(a),[c,s]=(0,O.useState)(!1);(0,O.useEffect)((()=>{l(a)}),[a]),(0,O.useEffect)((()=>{null==i||i(r)}),[r,i]);var h=(0,O.useCallback)((()=>{l((e=>!e)),c||r||(s(!0),null==o||o())}),[c,r,o]),d=(0,O.useRef)(),[p,u]=(0,O.useState)(!1),b=(0,O.useMemo)((()=>{return e=()=>{u(d.current.scrollTop>0)},n=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];t&&a(),t=requestAnimationFrame((()=>{e(...i)}))},n.cancel=a=()=>cancelAnimationFrame(t),n;var e,t,a,n}),[]);return R().createElement("div",{className:D()("pane",{scrolled:p})},R().createElement("div",{className:"pane-header",tabIndex:0,onClick:h},R().createElement("div",{className:"pane-title"},R().createElement("span",{className:"title-icon"},r?R().createElement(C,{lib:"antd",theme:"outlined",icon:"down"}):R().createElement(C,{lib:"antd",theme:"outlined",icon:"right"})),R().createElement("div",{className:"title-label"},t),R().createElement("slot",{name:"title"})),R().createElement("slot",{name:"actions"}),n&&R().createElement("div",{className:"badge"},n),R().createElement("div",{className:"pane-scroll-shadow"})),R().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:b,ref:d},R().createElement("slot",null,R().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}w=Y,({e:[r,c,h,p,u,b,E,g,m,f],c:[L,n]}=(0,y.Z)(w,[[o,1,"titleLabel"],[l,1,"active"],[s,1,"badge"],[d,1,"activeChangeEvent",e=>(0,N.Z)(e,K),(e,t)=>(0,x.Z)(e,K,t)],[v,1,"activeFirstActivatedEvent",e=>(0,N.Z)(e,G),(e,t)=>(0,x.Z)(e,G,t)]],[i],0,(e=>V.has((0,Z.Z)(e))),A.ReactNextElement)),n();var ee,te,ae,ne,ie,oe,re,le=a(6666),ce=a(3571),{defineElement:se,property:he}=(0,I.createDecorators)();te=se("visual-builder.workbench-sidebar",{styleTexts:[ce.Z]}),ae=he();var de=new WeakMap,pe=new WeakMap,ue=new WeakMap,be=new WeakMap;class ve extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,de,{writable:!0,value:(ie(this),ne(this))}),(0,k.Z)(this,pe,{writable:!0,value:()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")}}),(0,k.Z)(this,ue,{writable:!0,value:()=>{var e=(0,N.Z)(this,pe).call(this).assignedNodes();for(var t of e){var a;t.active?t.style.flex=String(null!==(a=t.activeFlex)&&void 0!==a?a:"1"):t.style.flex="initial"}}}),(0,k.Z)(this,be,{writable:!0,value:e=>{var t=e.target.assignedNodes();for(var a of t)a.addEventListener("active.change",(0,N.Z)(this,ue))}}),(0,le.Z)(this,"refCallback",(()=>{(0,N.Z)(this,ue).call(this);var e=(0,N.Z)(this,pe).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,N.Z)(this,be).call(this,e)}))}))}get titleLabel(){return(0,N.Z)(this,de)}set titleLabel(e){(0,x.Z)(this,de,e)}render(){return R().createElement(Ee,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function Ee(e){var{titleLabel:t,refCallback:a}=e;return R().createElement("div",{className:"sidebar",ref:a},R().createElement("div",{className:"title-container"},R().createElement("div",{className:"title-label"},t),R().createElement("slot",{name:"titleToolbar"})),R().createElement("div",{className:"pane-container"},R().createElement("slot",null)))}oe=ve,({e:[ne,ie],c:[re,ee]}=(0,y.Z)(oe,[[ae,1,"titleLabel"]],[te],0,void 0,A.ReactNextElement)),ee();var ge,me,fe,we,Le,ke,Ze,xe,Ne,ye,Oe,Re,Ie,Ae,Me,Te=a(7310),{defineElement:_e,property:De}=(0,I.createDecorators)(),Ce=(0,A.wrapBrick)("basic.general-link"),Pe=(0,A.wrapBrick)("icons.general-icon");me=_e("visual-builder.workbench-action",{styleTexts:[Te.Z]}),fe=De({attribute:!1}),Le=De(),Ze=De({type:Boolean}),Ne=De(),Oe=De();var Ue=new WeakMap,We=new WeakMap,Fe=new WeakMap,Se=new WeakMap,Be=new WeakMap;class Ke extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Ue,{writable:!0,value:(Ie(this),we(this))}),(0,k.Z)(this,We,{writable:!0,value:ke(this)}),(0,k.Z)(this,Fe,{writable:!0,value:xe(this)}),(0,k.Z)(this,Se,{writable:!0,value:ye(this)}),(0,k.Z)(this,Be,{writable:!0,value:Re(this)})}get icon(){return(0,N.Z)(this,Ue)}set icon(e){(0,x.Z)(this,Ue,e)}get to(){return(0,N.Z)(this,We)}set to(e){(0,x.Z)(this,We,e)}get active(){return(0,N.Z)(this,Fe)}set active(e){(0,x.Z)(this,Fe,e)}get href(){return(0,N.Z)(this,Se)}set href(e){(0,x.Z)(this,Se,e)}get target(){return(0,N.Z)(this,Be)}set target(e){(0,x.Z)(this,Be,e)}render(){return R().createElement(je,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target})}}function je(e){var{icon:t,to:a,active:n,href:i,target:o}=e;return R().createElement(Ce,{className:D()("action",{active:n}),url:a,href:i,target:o},R().createElement(Pe,t))}Ae=Ke,({e:[we,ke,xe,ye,Re,Ie],c:[Me,ge]}=(0,y.Z)(Ae,[[fe,1,"icon"],[Le,1,"to"],[Ze,1,"active"],[Ne,1,"href"],[Oe,1,"target"]],[me],0,void 0,A.ReactNextElement)),ge();var ze=a(9464),Ge=a(8353);function He(e,t,a,n){var i=[],o=[],r=[],l=0;return e.forEach((e=>{if(e.key=""===n?"".concat(l):"".concat(n,".").concat(l),function(e){return"group"===e.type}(e)||function(e,t){return Boolean("subMenu"===e.type||void 0)}(e)){var c=He(e.items,t,a,e.key);i.push(...c.selectedKeys),(c.selectedKeys.length||e.defaultExpanded)&&o.push(e.key),o.push(...c.openedKeys),r.push(...c.matchedKeys)}else if(function(e,t,a){if(!e.to)return!1;var n="object"==typeof e.to?e.to:(0,Ge.parsePath)(e.to),i=n.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),o=!!(0,ze.matchPath)(t,{path:i,exact:e.exact});if(o&&e.activeMatchSearch&&(o=Ve(a,n.search)),!o&&Array.isArray(e.activeIncludes))for(var r of e.activeIncludes){var l,c=void 0,s=r.includes("?");if(s&&(c=(0,Ge.parsePath)(r)),(o=!!(0,ze.matchPath)(t,{path:s?c.pathname:r,exact:!0}))&&null!==(l=c)&&void 0!==l&&l.search&&(o=Ve(a,c.search)),o)break}if(o&&Array.isArray(e.activeExcludes))for(var h of e.activeExcludes)if(!(o=!(0,ze.matchPath)(t,{path:h,exact:!0})))break;return o}(e,t,a)){i.push(String(e.key));for(var s=e.key.split("."),h=0;h<s.length;h++)r.push(s.slice(0,h+1).join("."))}l+=1})),i.length&&""!==n&&o.push(n),{selectedKeys:i,openedKeys:o,matchedKeys:r}}function Ve(e,t){var a=new URLSearchParams(e),n=new URLSearchParams(t);for(var[i,o]of n.entries()){var r;if((null!==(r=a.get(i))&&void 0!==r?r:"")!==o)return!1}return!0}var Ye,Je,$e,qe,Xe,Qe,et,tt,at,nt=a(8799),it=(0,A.wrapBrick)("visual-builder.workbench-action"),{defineElement:ot,property:rt}=(0,I.createDecorators)();Je=ot("visual-builder.workbench-action-list",{styleTexts:[nt.Z]}),$e=rt(),Xe=rt({attribute:!1});var lt,ct=new WeakMap,st=new WeakMap;class ht extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,ct,{writable:!0,value:(et(this),qe(this))}),(0,k.Z)(this,st,{writable:!0,value:Qe(this)})}get appId(){return(0,N.Z)(this,ct)}set appId(e){(0,x.Z)(this,ct,e)}get menu(){return(0,N.Z)(this,st)}set menu(e){(0,x.Z)(this,st,e)}render(){return R().createElement(pt,{appId:this.appId,menu:this.menu})}}tt=ht,({e:[qe,Qe,et],c:[at,Ye]}=(0,y.Z)(tt,[[$e,1,"appId"],[Xe,1,"menu"]],[Je],0,void 0,A.ReactNextElement)),Ye();var dt=new Map;function pt(e){var t,{appId:a,menu:n}=e,i=(0,ze.getHistory)(),[o,r]=(0,O.useState)(),[l,c]=(0,O.useState)(i.location);return(0,O.useEffect)((()=>{var e=i.listen((e=>{c(e)}));return e}),[i]),(0,O.useEffect)((()=>{lt||(lt=a),lt!==a&&(dt.clear(),lt=a)}),[a]),(0,O.useEffect)((()=>{var e,{pathname:t,search:a}=l,{selectedKeys:i}=He(null!==(e=null==n?void 0:n.menuItems)&&void 0!==e?e:[],t,a,"");r(Number(i[0]))}),[n,l]),R().createElement("div",{className:"workBenchActionList"},null==n||null===(t=n.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){var a=e.to;return o!==t&&dt.has(t)&&(a=dt.get(t)),R().createElement(it,{key:t,icon:e.icon,to:a,href:e.href,target:e.target,active:o===t,onClick:()=>(e=>{e.href||dt.set(o,"".concat(l.pathname).concat(l.search))})(e)})}})).filter(Boolean))}var ut,bt,vt,Et,gt,mt,ft,wt,Lt,kt,Zt,xt,Nt,yt,Ot,Rt,It,At,Mt,Tt,_t,Dt,Ct,Pt,Ut,Wt,Ft,St,Bt,Kt,jt,zt,Gt,Ht,Vt,Yt,Jt,$t,qt,Xt,Qt,ea,ta,aa,na,ia,oa,ra,la,ca,sa,ha,da,pa,ua,ba,va,Ea,ga,ma,fa=a(5178),wa=a(8486),La=a(1732),ka=a(3321),Za=a(8401),xa=a(89),Na=a(1674);function ya(e){return e.key}a(2006);var Oa,{defineElement:Ra,property:Ia,event:Aa}=(0,I.createDecorators)();bt=Ra("visual-builder.workbench-tree",{styleTexts:[xa.Z,Na.Z]}),vt=Ia({attribute:!1}),gt=Ia({attribute:!1}),ft=Ia({type:Boolean}),Lt=Ia(),Zt=Ia({type:Boolean}),Nt=Ia(),Ot=Ia({type:Boolean}),It=Ia({attribute:!1}),Mt=Ia({type:Boolean}),_t=Ia({attribute:!1}),Ct=Ia({attribute:!1}),Ut=Ia({type:Boolean}),Ft=Ia({attribute:!1}),Bt=Ia({type:Boolean}),jt=Ia({type:Boolean}),Gt=Ia({type:Boolean}),Vt=Ia({type:String}),Jt=Ia({type:Boolean}),qt=Aa({type:"action.click"}),ta=Aa({type:"node.click"}),oa=Aa({type:"node.drop"}),sa=Aa({type:"context.menu"}),ua=Aa({type:"node.toggle"});var Ma=new WeakMap,Ta=new WeakMap,_a=new WeakMap,Da=new WeakMap,Ca=new WeakMap,Pa=new WeakMap,Ua=new WeakMap,Wa=new WeakMap,Fa=new WeakMap,Sa=new WeakMap,Ba=new WeakMap,Ka=new WeakMap,ja=new WeakMap,za=new WeakMap,Ga=new WeakMap,Ha=new WeakMap,Va=new WeakMap,Ya=new WeakMap,Ja=new WeakMap,$a=new WeakMap,qa=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,en=new WeakMap,tn=new WeakMap,an=new WeakMap,nn=new WeakMap,on=new WeakMap,rn=new WeakMap,ln=new WeakMap,cn=new WeakMap,sn=new WeakMap,hn=new WeakMap;class dn extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,sn,{get:Ln,set:wn}),(0,k.Z)(this,rn,{get:fn,set:mn}),(0,k.Z)(this,an,{get:gn,set:En}),(0,k.Z)(this,Qa,{get:vn,set:bn}),(0,k.Z)(this,$a,{get:un,set:pn}),(0,k.Z)(this,Ma,{writable:!0,value:(ga(this),Et(this))}),(0,k.Z)(this,Ta,{writable:!0,value:mt(this)}),(0,k.Z)(this,_a,{writable:!0,value:wt(this)}),(0,k.Z)(this,Da,{writable:!0,value:kt(this)}),(0,k.Z)(this,Ca,{writable:!0,value:xt(this)}),(0,k.Z)(this,Pa,{writable:!0,value:yt(this)}),(0,k.Z)(this,Ua,{writable:!0,value:Rt(this)}),(0,k.Z)(this,Wa,{writable:!0,value:At(this)}),(0,k.Z)(this,Fa,{writable:!0,value:Tt(this)}),(0,k.Z)(this,Sa,{writable:!0,value:Dt(this)}),(0,k.Z)(this,Ba,{writable:!0,value:Pt(this)}),(0,k.Z)(this,Ka,{writable:!0,value:Wt(this)}),(0,k.Z)(this,ja,{writable:!0,value:St(this)}),(0,k.Z)(this,za,{writable:!0,value:Kt(this)}),(0,k.Z)(this,Ga,{writable:!0,value:zt(this)}),(0,k.Z)(this,Ha,{writable:!0,value:Ht(this)}),(0,k.Z)(this,Va,{writable:!0,value:Yt(this)}),(0,k.Z)(this,Ya,{writable:!0,value:$t(this)}),(0,k.Z)(this,Ja,{writable:!0,value:Xt(this)}),(0,k.Z)(this,qa,{writable:!0,value:e=>{(0,N.Z)(this,$a).emit(e)}}),(0,k.Z)(this,Xa,{writable:!0,value:aa(this)}),(0,k.Z)(this,en,{writable:!0,value:e=>()=>{(0,N.Z)(this,Qa).emit(e.data)}}),(0,k.Z)(this,tn,{writable:!0,value:ra(this)}),(0,k.Z)(this,nn,{writable:!0,value:e=>{(0,N.Z)(this,an).emit(e)}}),(0,k.Z)(this,on,{writable:!0,value:ha(this)}),(0,k.Z)(this,ln,{writable:!0,value:e=>t=>{t.preventDefault(),(0,N.Z)(this,rn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})}}),(0,k.Z)(this,cn,{writable:!0,value:ba(this)}),(0,k.Z)(this,hn,{writable:!0,value:(e,t)=>{(0,N.Z)(this,sn).emit({nodeId:e,collapsed:t})}})}get nodes(){return(0,N.Z)(this,Ma)}set nodes(e){(0,x.Z)(this,Ma,e)}get actions(){return(0,N.Z)(this,Ta)}set actions(e){(0,x.Z)(this,Ta,e)}get actionsHidden(){return(0,N.Z)(this,_a)}set actionsHidden(e){(0,x.Z)(this,_a,e)}get placeholder(){return(0,N.Z)(this,Da)}set placeholder(e){(0,x.Z)(this,Da,e)}get isTransformName(){return(0,N.Z)(this,Ca)}set isTransformName(e){(0,x.Z)(this,Ca,e)}get searchPlaceholder(){return(0,N.Z)(this,Pa)}set searchPlaceholder(e){(0,x.Z)(this,Pa,e)}get noSearch(){return(0,N.Z)(this,Ua)}set noSearch(e){(0,x.Z)(this,Ua,e)}get activeKey(){return(0,N.Z)(this,Wa)}set activeKey(e){(0,x.Z)(this,Wa,e)}get showMatchedNodeOnly(){return(0,N.Z)(this,Fa)}set showMatchedNodeOnly(e){(0,x.Z)(this,Fa,e)}get matchNodeDataFields(){return(0,N.Z)(this,Sa)}set matchNodeDataFields(e){(0,x.Z)(this,Sa,e)}get fixedActionsFor(){return(0,N.Z)(this,Ba)}set fixedActionsFor(e){(0,x.Z)(this,Ba,e)}get collapsible(){return(0,N.Z)(this,Ka)}set collapsible(e){(0,x.Z)(this,Ka,e)}get collapsedNodes(){return(0,N.Z)(this,ja)}set collapsedNodes(e){(0,x.Z)(this,ja,e)}get allowDrag(){return(0,N.Z)(this,za)}set allowDrag(e){(0,x.Z)(this,za,e)}get allowDragToRoot(){return(0,N.Z)(this,Ga)}set allowDragToRoot(e){(0,x.Z)(this,Ga,e)}get allowDragToInside(){return(0,N.Z)(this,Ha)}set allowDragToInside(e){(0,x.Z)(this,Ha,e)}get nodeKey(){return(0,N.Z)(this,Va)}set nodeKey(e){(0,x.Z)(this,Va,e)}get skipNotify(){return(0,N.Z)(this,Ya)}set skipNotify(e){(0,x.Z)(this,Ya,e)}render(){return R().createElement(wa.L.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,N.Z)(this,qa)}},R().createElement(ka.f.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:ya,onNodeToggle:(0,N.Z)(this,hn),skipNotify:this.skipNotify,clickFactory:(0,N.Z)(this,en),contextMenuFactory:(0,N.Z)(this,ln),matchNode:(e,t)=>{var a;return(0,Za.$)(e.name,t)||!(null===(a=this.matchNodeDataFields)||void 0===a||!a.length)&&(0,Za.$)("*"===this.matchNodeDataFields?e.data:(0,fa.pick)(e.data,this.matchNodeDataFields),t)}}},R().createElement(La.ME,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,N.Z)(this,nn),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}function pn(e){ea(this,e)}function un(){return Qt(this)}function bn(e){ia(this,e)}function vn(){return na(this)}function En(e){ca(this,e)}function gn(){return la(this)}function mn(e){pa(this,e)}function fn(){return da(this)}function wn(e){Ea(this,e)}function Ln(){return va(this)}ma=dn,({e:[Et,mt,wt,kt,xt,yt,Rt,At,Tt,Dt,Pt,Wt,St,Kt,zt,Ht,Yt,$t,Xt,Qt,ea,aa,na,ia,ra,la,ca,ha,da,pa,ba,va,Ea,ga],c:[Oa,ut]}=(0,y.Z)(ma,[[vt,1,"nodes"],[gt,1,"actions"],[ft,1,"actionsHidden"],[Lt,1,"placeholder"],[Zt,1,"isTransformName"],[Nt,1,"searchPlaceholder"],[Ot,1,"noSearch"],[It,1,"activeKey"],[Mt,1,"showMatchedNodeOnly"],[_t,1,"matchNodeDataFields"],[Ct,1,"fixedActionsFor"],[Ut,1,"collapsible"],[Ft,1,"collapsedNodes"],[Bt,1,"allowDrag"],[jt,1,"allowDragToRoot"],[Gt,1,"allowDragToInside"],[Vt,1,"nodeKey"],[Jt,1,"skipNotify"],[qt,1,"actionClickEvent",e=>(0,N.Z)(e,Ja),(e,t)=>(0,x.Z)(e,Ja,t)],[ta,1,"nodeClickEvent",e=>(0,N.Z)(e,Xa),(e,t)=>(0,x.Z)(e,Xa,t)],[oa,1,"nodeDropEvent",e=>(0,N.Z)(e,tn),(e,t)=>(0,x.Z)(e,tn,t)],[sa,1,"nodeContextMenuEvent",e=>(0,N.Z)(e,on),(e,t)=>(0,x.Z)(e,on,t)],[ua,1,"nodeToggleEvent",e=>(0,N.Z)(e,cn),(e,t)=>(0,x.Z)(e,cn,t)]],[bt],0,(e=>hn.has((0,Z.Z)(e))),A.ReactNextElement)),ut();var kn=a(1935),Zn=a(2907);a(894),customElements.define("visual-builder.inject-preview-agent",(0,kn.createProviderClass)((function(e,t){return(0,Zn.Z)(e,t)})));var xn,Nn,yn,On,Rn,In,An,Mn,Tn,_n,Dn,Cn,Pn,Un,Wn,Fn,Sn,Bn,Kn,jn,zn=a(3028),Gn=a(8874),Hn=a.n(Gn),Vn=a(6094),Yn=a(7088),Jn=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}({}),$n="bricks/visual-builder/workbench-history-action",qn=a(4795),Xn=a(5932),Qn=function(){var e=(0,qn.Z)((function*(e,t,a){return(yield Xn.http.get("api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/".concat(e,"/changes"),(0,zn.Z)((0,zn.Z)({},a),{},{params:t}))).data}));return function(t,a,n){return e.apply(this,arguments)}}(),ei=a(860),ti={add:"".concat($n,":").concat(Jn.ADD),edit:"".concat($n,":").concat(Jn.EDIT),delete:"".concat($n,":").concat(Jn.DELETE),batch_delete:"".concat($n,":").concat(Jn.DELETE),import:"".concat($n,":").concat(Jn.IMPORT),clone:"".concat($n,":").concat(Jn.CLONE),append_relation:"".concat($n,":").concat(Jn.APPEND_RELATION),update_relation:"".concat($n,":").concat(Jn.UPDATE_RELATION),remove_relation:"".concat($n,":").concat(Jn.REMOVE_RELATION),rollback:"".concat($n,":").concat(Jn.ROLLBACK),rollback_all:"".concat($n,":").concat(Jn.ROLLBACK_ALL)},ai={add:"".concat($n,":").concat(Jn.ADD_FULL),edit:"".concat($n,":").concat(Jn.EDIT_FULL),delete:"".concat($n,":").concat(Jn.DELETE_FULL),batch_delete:"".concat($n,":").concat(Jn.DELETE_FULL),import:"".concat($n,":").concat(Jn.IMPORT_FULL),clone:"".concat($n,":").concat(Jn.CLONE_FULL),append_relation:"".concat($n,":").concat(Jn.APPEND_RELATION_FULL),update_relation:"".concat($n,":").concat(Jn.UPDATE_RELATION_FULL),remove_relation:"".concat($n,":").concat(Jn.REMOVE_RELATION_FULL),rollback:"".concat($n,":").concat(Jn.ROLLBACK_FULL),rollback_all:"".concat($n,":").concat(Jn.ROLLBACK_ALL_FULL)},ni={project:"".concat($n,":").concat(Jn.PROJECT),userGroup:"".concat($n,":").concat(Jn.USER),permission:"".concat($n,":").concat(Jn.PERMISSION),brick:"".concat($n,":").concat(Jn.BRICK),route:"".concat($n,":").concat(Jn.ROUTE),template:"".concat($n,":").concat(Jn.TEMPLATE),snippet:"".concat($n,":").concat(Jn.SNIPPET),i18n:"".concat($n,":").concat(Jn.I18N),image:"".concat($n,":").concat(Jn.IMAGE),function:"".concat($n,":").concat(Jn.FUNCTION),menu:"".concat($n,":").concat(Jn.MENU),menuItem:"".concat($n,":").concat(Jn.MENU_ITEM),workflow:"".concat($n,":").concat(Jn.WORKFLOW)},ii={PROJECT_MICRO_APP:"".concat($n,":").concat(Jn.PROJECT),"MICRO_APP_USER_GROUP@EASYOPS":"".concat($n,":").concat(Jn.USER),MICRO_APP_RESOURCE_PERMISSION:"".concat($n,":").concat(Jn.PERMISSION),STORYBOARD_BRICK:"".concat($n,":").concat(Jn.BRICK),STORYBOARD_ROUTE:"".concat($n,":").concat(Jn.ROUTE),STORYBOARD_TEMPLATE:"".concat($n,":").concat(Jn.TEMPLATE),STORYBOARD_SNIPPET:"".concat($n,":").concat(Jn.SNIPPET),STORYBOARD_I18N:"".concat($n,":").concat(Jn.I18N),MICRO_APP_RESOURCE_IMAGE:"".concat($n,":").concat(Jn.IMAGE),STORYBOARD_FUNCTION:"".concat($n,":").concat(Jn.FUNCTION),MICRO_APP_RESOURCE_MENU:"".concat($n,":").concat(Jn.MENU),MICRO_APP_RESOURCE_MENU_ITEM:"".concat($n,":").concat(Jn.MENU_ITEM),"WORKFLOW_DEF@EASYOPS":"".concat($n,":").concat(Jn.WORKFLOW)};function oi(e){var t,a,n,i,o,r,l,c,s,h,d,p,u,b,v,E,g,m="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",f=ei.i18n.t(null!==(t=ni[e.category])&&void 0!==t?t:e.category),w=ei.i18n.t(null!==(a=ti[m])&&void 0!==a?a:m),L=ei.i18n.t(null!==(n=ii[null===(i=e.abstract)||void 0===i?void 0:i.leftObjectId])&&void 0!==n?n:null===(o=e.abstract)||void 0===o?void 0:o.leftObjectId),k=ei.i18n.t(null!==(r=ii[null===(l=e.abstract)||void 0===l?void 0:l.rightObjectId])&&void 0!==r?r:null===(c=e.abstract)||void 0===c?void 0:c.rightObjectId),Z=ri(null===(s=e.abstract)||void 0===s?void 0:s.nodes,null===(h=e.abstract)||void 0===h?void 0:h.nodesCount),x=ri(null===(d=e.abstract)||void 0===d?void 0:d.leftNodes,null===(p=e.abstract)||void 0===p?void 0:p.leftNodesCount),N=ri(null===(u=e.abstract)||void 0===u?void 0:u.rightNodes,null===(b=e.abstract)||void 0===b?void 0:b.rightNodesCount),y="rollback"===m?oi(e.rollBackIdInfo).abstract:null;return{category:f,action:w,leftObjectId:L,rightObjectId:k,nodes:Z,leftNodes:x,rightNodes:N,abstract:ei.i18n.t(null!==(v=ai[m])&&void 0!==v?v:m,{category:f,nodes:Z,leftNodes:x,rightNodes:N,nodeChanges:null===(E=e.abstract)||void 0===E||null===(E=E.nodeChanges)||void 0===E?void 0:E.join(", "),relationChanges:null===(g=e.abstract)||void 0===g||null===(g=g.relationChanges)||void 0===g?void 0:g.join(", "),leftObjectId:L,rightObjectId:k,rollbackAbstract:y}),rollbackAbstract:y}}function ri(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return ei.i18n.t("".concat($n,":").concat(Jn.NODE),{nodes:e.join(a),context:t>e.length?"ellipsis":void 0,count:t})}(0,Yn.initializeReactI18n)($n,{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:"工作流"}});var li,{defineElement:ci,property:si,event:hi}=(0,I.createDecorators)(),di=(0,A.wrapBrick)("eo-button"),pi=(0,A.wrapBrick)("eo-link"),ui=(0,A.wrapBrick)("eo-icon"),bi=(0,A.wrapBrick)("eo-easyops-avatar"),vi=(0,A.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",beforeVisibleChange:"before.visible.change"});Nn=ci("visual-builder.workbench-history-action",{styleTexts:[Vn.Z]}),yn=si(),Rn=si(),An=hi({type:"history.item.click"}),Dn=hi({type:"rollback"}),Wn=hi({type:"rollback.all"});var Ei=new WeakMap,gi=new WeakMap,mi=new WeakMap,fi=new WeakMap,wi=new WeakMap,Li=new WeakMap,ki=new WeakMap,Zi=new WeakMap,xi=new WeakMap,Ni=new WeakMap,yi=new WeakMap;class Oi extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Ni,{get:_i,set:Ti}),(0,k.Z)(this,ki,{get:Mi,set:Ai}),(0,k.Z)(this,fi,{get:Ii,set:Ri}),(0,k.Z)(this,Ei,{writable:!0,value:(Kn(this),On(this))}),(0,k.Z)(this,gi,{writable:!0,value:In(this)}),(0,k.Z)(this,mi,{writable:!0,value:Mn(this)}),(0,k.Z)(this,wi,{writable:!0,value:e=>{(0,N.Z)(this,fi).emit(e)}}),(0,k.Z)(this,Li,{writable:!0,value:Cn(this)}),(0,k.Z)(this,Zi,{writable:!0,value:e=>{(0,N.Z)(this,ki).emit(e)}}),(0,k.Z)(this,xi,{writable:!0,value:Fn(this)}),(0,k.Z)(this,yi,{writable:!0,value:()=>{(0,N.Z)(this,Ni).emit()}})}get appId(){return(0,N.Z)(this,Ei)}set appId(e){(0,x.Z)(this,Ei,e)}get projectId(){return(0,N.Z)(this,gi)}set projectId(e){(0,x.Z)(this,gi,e)}render(){return R().createElement(Di,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,N.Z)(this,wi),onRollback:(0,N.Z)(this,Zi),onRollbackAll:(0,N.Z)(this,yi)})}}function Ri(e){_n(this,e)}function Ii(){return Tn(this)}function Ai(e){Un(this,e)}function Mi(){return Pn(this)}function Ti(e){Bn(this,e)}function _i(){return Sn(this)}function Di(e){var{appId:t,onHistoryItemClick:a,onRollback:n,onRollbackAll:i}=e,{t:o}=(0,Yn.useTranslation)($n),[r,l]=(0,O.useState)(!1),[c,s]=(0,O.useState)(!0),[h,d]=(0,O.useState)(!1),[p,u]=(0,O.useState)([]),b=(0,O.useRef)(""),v=e=>{l(!0),Qn(t,{ts:b.current,limit:20}).then((t=>{u((a=>{var n=t.list.map((e=>(0,zn.Z)((0,zn.Z)({},e),{},{translation:oi(e)})));return e?n:a.concat(n)})),b.current=t.ts,d(t.list.length<20),s(t.list.length<20)})).catch((e=>{(0,ze.handleHttpError)(e)})).finally((()=>{l(!1)}))};return R().createElement(vi,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",beforeVisibleChange:e=>{e.detail&&(s(!0),d(!1),u([]),b.current="",v(!0))}},R().createElement(di,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),R().createElement("div",null,R().createElement("div",{className:"history-title"},"History"),R().createElement("div",{className:"history-list"},p.length?R().createElement(R().Fragment,null,p.map(((e,t)=>R().createElement(Ci,{key:"".concat(e.uniqueKey,"-").concat(e.ts),data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:a,onRollback:n}))),!c&&R().createElement("span",{className:"load-more-container"},R().createElement(pi,{className:"load-more",disabled:r,onClick:()=>v()},o(Jn.LOAD_MORE))),h&&R().createElement("span",{className:"end-container"},"The End",R().createElement(ui,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>i()}))):R().createElement("div",{className:"empty"},o(r?Jn.LOADING:Jn.NO_DATA))),R().createElement("slot",null)))}function Ci(e){var{data:t,enableRollback:a,current:n,onHistoryItemClick:i,onRollback:o}=e,r=Hn()(Number(t.ts)/1e6),l=Hn().duration(r.diff(Hn()())),c=l.days()<=-1?r.format("YYYY-MM-DD HH:mm:ss"):l.humanize(!0,{ss:0,s:60,m:60,h:24});return R().createElement("div",{className:"item-container"},R().createElement("div",{className:"item-title"},R().createElement("div",{className:"title-left",onClick:()=>i((0,zn.Z)((0,zn.Z)({},t),{},{enableRollback:a}))},R().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),n&&R().createElement("div",{className:"branch"},"(current)")),R().createElement("div",{className:"title-right"},a&&R().createElement(ui,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>o(t)}))),R().createElement("div",{className:"item-info"},R().createElement(bi,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),R().createElement("div",{className:"time"},c),R().createElement("div",{className:"operator"},t.user)))}jn=Oi,({e:[On,In,Mn,Tn,_n,Cn,Pn,Un,Fn,Sn,Bn,Kn],c:[li,xn]}=(0,y.Z)(jn,[[yn,1,"appId"],[Rn,1,"projectId"],[An,1,"historyItemClickEvent",e=>(0,N.Z)(e,mi),(e,t)=>(0,x.Z)(e,mi,t)],[Dn,1,"rollbackEvent",e=>(0,N.Z)(e,Li),(e,t)=>(0,x.Z)(e,Li,t)],[Wn,1,"rollbackAllEvent",e=>(0,N.Z)(e,xi),(e,t)=>(0,x.Z)(e,xi,t)]],[Nn],0,(e=>yi.has((0,Z.Z)(e))),A.ReactNextElement)),xn();var Pi,Ui,Wi,Fi,Si,Bi,Ki,ji,zi,Gi,Hi,Vi,Yi,Ji,$i,qi,Xi,Qi,eo,to,ao,no,io,oo,ro,lo,co,so,ho,po,uo,bo,vo=a(1385),{defineElement:Eo,property:go,event:mo}=(0,I.createDecorators)(),fo=(0,A.wrapBrick)("eo-icon"),wo=new Set;Ui=Eo("visual-builder.page-arch-node",{styleTexts:[vo.Z]}),Wi=go(),Si=go(),Ki=go({attribute:!1}),zi=go({type:Boolean}),Gi=go({type:Boolean,render:!1}),Vi=go(),Ji=mo({type:"label.editing.change"}),Qi=mo({type:"label.change"}),no=mo({type:"child.append"}),lo=mo({type:"external.click"});var Lo=new WeakMap,ko=new WeakMap,Zo=new WeakMap,xo=new WeakMap,No=new WeakMap,yo=new WeakMap,Oo=new WeakMap,Ro=new WeakMap,Io=new WeakMap,Ao=new WeakMap,Mo=new WeakMap,To=new WeakMap,_o=new WeakMap,Do=new WeakMap,Co=new WeakMap,Po=new WeakMap,Uo=new WeakMap;class Wo extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Po,{get:Ho,set:Go}),(0,k.Z)(this,_o,{get:zo,set:jo}),(0,k.Z)(this,Ao,{get:Ko,set:Bo}),(0,k.Z)(this,Oo,{get:So,set:Fo}),(0,k.Z)(this,Lo,{writable:!0,value:(po(this),Fi(this))}),(0,k.Z)(this,ko,{writable:!0,value:Bi(this)}),(0,k.Z)(this,Zo,{writable:!0,value:ji(this)}),(0,k.Z)(this,xo,{writable:!0,value:Hi(this)}),(0,k.Z)(this,No,{writable:!0,value:Yi(this)}),(0,k.Z)(this,yo,{writable:!0,value:$i(this)}),(0,k.Z)(this,Ro,{writable:!0,value:e=>{(0,N.Z)(this,Oo).emit(e)}}),(0,k.Z)(this,Io,{writable:!0,value:eo(this)}),(0,k.Z)(this,Mo,{writable:!0,value:e=>{(0,N.Z)(this,Ao).emit(e)}}),(0,k.Z)(this,To,{writable:!0,value:io(this)}),(0,k.Z)(this,Do,{writable:!0,value:()=>{(0,N.Z)(this,_o).emit()}}),(0,k.Z)(this,Co,{writable:!0,value:co(this)}),(0,k.Z)(this,Uo,{writable:!0,value:e=>{(0,N.Z)(this,Po).emit(e)}})}get label(){return(0,N.Z)(this,Lo)}set label(e){(0,x.Z)(this,Lo,e)}get type(){return(0,N.Z)(this,ko)}set type(e){(0,x.Z)(this,ko,e)}get external(){return(0,N.Z)(this,Zo)}set external(e){(0,x.Z)(this,Zo,e)}get active(){return(0,N.Z)(this,xo)}set active(e){(0,x.Z)(this,xo,e)}get autoFocusOnce(){return(0,N.Z)(this,No)}set autoFocusOnce(e){(0,x.Z)(this,No,e)}render(){return R().createElement(Vo,{label:this.label,type:this.type,external:this.external,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,N.Z)(this,Ro),onLabelChange:(0,N.Z)(this,Mo),onChildAppend:(0,N.Z)(this,Do),onExternalClick:(0,N.Z)(this,Uo)})}}function Fo(e){Xi(this,e)}function So(){return qi(this)}function Bo(e){ao(this,e)}function Ko(){return to(this)}function jo(e){ro(this,e)}function zo(){return oo(this)}function Go(e){ho(this,e)}function Ho(){return so(this)}function Vo(e){var{label:t,type:a,external:n,autoFocusOnce:i,onLabelEditingChange:o,onLabelChange:r,onChildAppend:l,onExternalClick:c}=e,s="board"===a?"board":"page",[h,d]=(0,O.useState)(t),[p,u]=(0,O.useState)(!1),b=(0,O.useRef)(!1),[v,E]=(0,O.useState)(!1),g=(0,O.useRef)(null);(0,O.useEffect)((()=>{d(t)}),[t]);var m=(0,O.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),u(!0)}),[]);(0,O.useEffect)((()=>{i&&!wo.has(i)&&(wo.add(i),setTimeout((()=>{u(!0)}),1))}),[i]),(0,O.useEffect)((()=>{var e,t;p&&(null===(e=g.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=g.current)||void 0===t||t.select())}),[p]),(0,O.useEffect)((()=>{b.current?null==o||o(p):b.current=!0}),[p,o]);var f=(0,O.useCallback)((e=>{d(e.target.value)}),[]),w=(0,O.useCallback)((e=>{var t,a=e.key||e.keyCode||e.which;"Enter"!==a&&13!==a||null===(t=g.current)||void 0===t||t.blur()}),[]),L=(0,O.useCallback)((()=>{u(!1),E(!0)}),[]);(0,O.useEffect)((()=>{v&&(null==r||r(h),E(!1))}),[h,r,v]);var k=(0,O.useCallback)((e=>{e.stopPropagation(),null==l||l()}),[l]),Z=(0,O.useCallback)((e=>{e.stopPropagation(),null==c||c(n)}),[n,c]);return R().createElement(R().Fragment,null,R().createElement("div",{className:D()("node",s,{"editing-label":p})},R().createElement("input",{className:"label-input",value:h,ref:g,onChange:f,onKeyDown:w,onBlur:L,onContextMenu:e=>e.stopPropagation()}),R().createElement("div",{className:"label",onDoubleClick:m},h),"board"===s?R().createElement("div",{className:"icon-container"},R().createElement(fo,{lib:"antd",icon:"unordered-list"})):R().createElement("div",{className:"thumbnail-container"},R().createElement(fo,{lib:"antd",icon:"ellipsis"}),n&&R().createElement("div",{className:"external",onClick:Z,onDoubleClick:e=>e.stopPropagation()},R().createElement(fo,{lib:"antd",icon:"desktop"}),R().createElement("span",{className:"external-label"},n.label)))),R().createElement("div",{className:"add-button",role:"button",onClick:k},R().createElement(fo,{lib:"fa",icon:"plus"})))}uo=Wo,({e:[Fi,Bi,ji,Hi,Yi,$i,qi,Xi,eo,to,ao,io,oo,ro,co,so,ho,po],c:[bo,Pi]}=(0,y.Z)(uo,[[Wi,1,"label"],[Si,1,"type"],[Ki,1,"external"],[[zi,Gi],1,"active"],[Vi,1,"autoFocusOnce"],[Ji,1,"labelEditingChange",e=>(0,N.Z)(e,yo),(e,t)=>(0,x.Z)(e,yo,t)],[Qi,1,"labelChange",e=>(0,N.Z)(e,Io),(e,t)=>(0,x.Z)(e,Io,t)],[no,1,"childAppend",e=>(0,N.Z)(e,To),(e,t)=>(0,x.Z)(e,To,t)],[lo,1,"externalClick",e=>(0,N.Z)(e,Co),(e,t)=>(0,x.Z)(e,Co,t)]],[Ui],0,(e=>Uo.has((0,Z.Z)(e))),A.ReactNextElement)),Pi()},1385:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{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;-moz-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-webkit-fit-content;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;display:inline;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-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{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px solid var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;overflow:hidden;color:var(--palette-gray-5);font-size:36px;width:100%;position:relative}.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 solid var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px solid 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([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:-webkit-fit-content;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)}",""]);const l=r.toString()},8453:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},8799:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,'.workBenchActionList{display:flex;flex-direction:column;width:-webkit-min-content;width:-moz-min-content;width:min-content;height:100%;background-color:#4297ff}:host-context(html[data-theme="dark-v2"]) .workBenchActionList,\n:host-context([data-override-theme="dark-v2"]) .workBenchActionList{background-color:#323237}',""]);const l=r.toString()},7310:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:rgba(255,255,255,0.4);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:white}.action.active::part(link),\n.action::part(link):hover{color:white}',""]);const l=r.toString()},6094:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},8249:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},3571:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()}}]);
3
- //# sourceMappingURL=7757.04433444.js.map
1
+ /*! For license information please see 7757.462657fe.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[7757],{7757:(e,t,a)=>{a.r(t);var n,i,o,r,l,c,s,h,d,p,u,b,v,E,g,m,f,w,L,k=a(3395),Z=a(1815),x=a(381),N=a(687),y=a(5066),O=a(8657),R=a.n(O),I=a(5727),A=a(305),M=a(8249),T=a(8453),_=a(2779),D=a.n(_),C=(0,A.wrapBrick)("icons.general-icon"),{defineElement:P,property:U,event:W}=(0,I.createDecorators)();i=P("visual-builder.workbench-pane",{styleTexts:[M.Z,T.Z]}),o=U(),l=U({type:Boolean}),s=U({type:Number}),d=W({type:"active.change"}),v=W({type:"active.firstActivated"});var F=new WeakMap,S=new WeakMap,B=new WeakMap,K=new WeakMap,j=new WeakMap,z=new WeakMap,G=new WeakMap,H=new WeakMap,V=new WeakMap;class Y extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,H,{get:X,set:q}),(0,k.Z)(this,j,{get:$,set:J}),(0,k.Z)(this,F,{writable:!0,value:(f(this),r(this))}),(0,k.Z)(this,S,{writable:!0,value:c(this)}),(0,k.Z)(this,B,{writable:!0,value:h(this)}),(0,k.Z)(this,K,{writable:!0,value:p(this)}),(0,k.Z)(this,z,{writable:!0,value:e=>{e!==this.active&&(this.active=e,(0,N.Z)(this,j).emit(e))}}),(0,k.Z)(this,G,{writable:!0,value:E(this)}),(0,k.Z)(this,V,{writable:!0,value:()=>{(0,N.Z)(this,H).emit()}})}get titleLabel(){return(0,N.Z)(this,F)}set titleLabel(e){(0,x.Z)(this,F,e)}get active(){return(0,N.Z)(this,S)}set active(e){(0,x.Z)(this,S,e)}get badge(){return(0,N.Z)(this,B)}set badge(e){(0,x.Z)(this,B,e)}render(){return R().createElement(Q,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,N.Z)(this,z),onFirstActivated:(0,N.Z)(this,V)})}}function J(e){b(this,e)}function $(){return u(this)}function q(e){m(this,e)}function X(){return g(this)}function Q(e){var{titleLabel:t,active:a,badge:n,onActiveChange:i,onFirstActivated:o}=e,[r,l]=(0,O.useState)(a),[c,s]=(0,O.useState)(!1);(0,O.useEffect)((()=>{l(a)}),[a]),(0,O.useEffect)((()=>{null==i||i(r)}),[r,i]);var h=(0,O.useCallback)((()=>{l((e=>!e)),c||r||(s(!0),null==o||o())}),[c,r,o]),d=(0,O.useRef)(),[p,u]=(0,O.useState)(!1),b=(0,O.useMemo)((()=>{return e=()=>{u(d.current.scrollTop>0)},n=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];t&&a(),t=requestAnimationFrame((()=>{e(...i)}))},n.cancel=a=()=>cancelAnimationFrame(t),n;var e,t,a,n}),[]);return R().createElement("div",{className:D()("pane",{scrolled:p})},R().createElement("div",{className:"pane-header",tabIndex:0,onClick:h},R().createElement("div",{className:"pane-title"},R().createElement("span",{className:"title-icon"},r?R().createElement(C,{lib:"antd",theme:"outlined",icon:"down"}):R().createElement(C,{lib:"antd",theme:"outlined",icon:"right"})),R().createElement("div",{className:"title-label"},t),R().createElement("slot",{name:"title"})),R().createElement("slot",{name:"actions"}),n&&R().createElement("div",{className:"badge"},n),R().createElement("div",{className:"pane-scroll-shadow"})),R().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:b,ref:d},R().createElement("slot",null,R().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}w=Y,({e:[r,c,h,p,u,b,E,g,m,f],c:[L,n]}=(0,y.Z)(w,[[o,1,"titleLabel"],[l,1,"active"],[s,1,"badge"],[d,1,"activeChangeEvent",e=>(0,N.Z)(e,K),(e,t)=>(0,x.Z)(e,K,t)],[v,1,"activeFirstActivatedEvent",e=>(0,N.Z)(e,G),(e,t)=>(0,x.Z)(e,G,t)]],[i],0,(e=>V.has((0,Z.Z)(e))),A.ReactNextElement)),n();var ee,te,ae,ne,ie,oe,re,le=a(6666),ce=a(3571),{defineElement:se,property:he}=(0,I.createDecorators)();te=se("visual-builder.workbench-sidebar",{styleTexts:[ce.Z]}),ae=he();var de=new WeakMap,pe=new WeakMap,ue=new WeakMap,be=new WeakMap;class ve extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,de,{writable:!0,value:(ie(this),ne(this))}),(0,k.Z)(this,pe,{writable:!0,value:()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")}}),(0,k.Z)(this,ue,{writable:!0,value:()=>{var e=(0,N.Z)(this,pe).call(this).assignedNodes();for(var t of e){var a;t.active?t.style.flex=String(null!==(a=t.activeFlex)&&void 0!==a?a:"1"):t.style.flex="initial"}}}),(0,k.Z)(this,be,{writable:!0,value:e=>{var t=e.target.assignedNodes();for(var a of t)a.addEventListener("active.change",(0,N.Z)(this,ue))}}),(0,le.Z)(this,"refCallback",(()=>{(0,N.Z)(this,ue).call(this);var e=(0,N.Z)(this,pe).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,N.Z)(this,be).call(this,e)}))}))}get titleLabel(){return(0,N.Z)(this,de)}set titleLabel(e){(0,x.Z)(this,de,e)}render(){return R().createElement(Ee,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function Ee(e){var{titleLabel:t,refCallback:a}=e;return R().createElement("div",{className:"sidebar",ref:a},R().createElement("div",{className:"title-container"},R().createElement("div",{className:"title-label"},t),R().createElement("slot",{name:"titleToolbar"})),R().createElement("div",{className:"pane-container"},R().createElement("slot",null)))}oe=ve,({e:[ne,ie],c:[re,ee]}=(0,y.Z)(oe,[[ae,1,"titleLabel"]],[te],0,void 0,A.ReactNextElement)),ee();var ge,me,fe,we,Le,ke,Ze,xe,Ne,ye,Oe,Re,Ie,Ae,Me,Te=a(7310),{defineElement:_e,property:De}=(0,I.createDecorators)(),Ce=(0,A.wrapBrick)("basic.general-link"),Pe=(0,A.wrapBrick)("icons.general-icon");me=_e("visual-builder.workbench-action",{styleTexts:[Te.Z]}),fe=De({attribute:!1}),Le=De(),Ze=De({type:Boolean}),Ne=De(),Oe=De();var Ue=new WeakMap,We=new WeakMap,Fe=new WeakMap,Se=new WeakMap,Be=new WeakMap;class Ke extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Ue,{writable:!0,value:(Ie(this),we(this))}),(0,k.Z)(this,We,{writable:!0,value:ke(this)}),(0,k.Z)(this,Fe,{writable:!0,value:xe(this)}),(0,k.Z)(this,Se,{writable:!0,value:ye(this)}),(0,k.Z)(this,Be,{writable:!0,value:Re(this)})}get icon(){return(0,N.Z)(this,Ue)}set icon(e){(0,x.Z)(this,Ue,e)}get to(){return(0,N.Z)(this,We)}set to(e){(0,x.Z)(this,We,e)}get active(){return(0,N.Z)(this,Fe)}set active(e){(0,x.Z)(this,Fe,e)}get href(){return(0,N.Z)(this,Se)}set href(e){(0,x.Z)(this,Se,e)}get target(){return(0,N.Z)(this,Be)}set target(e){(0,x.Z)(this,Be,e)}render(){return R().createElement(je,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target})}}function je(e){var{icon:t,to:a,active:n,href:i,target:o}=e;return R().createElement(Ce,{className:D()("action",{active:n}),url:a,href:i,target:o},R().createElement(Pe,t))}Ae=Ke,({e:[we,ke,xe,ye,Re,Ie],c:[Me,ge]}=(0,y.Z)(Ae,[[fe,1,"icon"],[Le,1,"to"],[Ze,1,"active"],[Ne,1,"href"],[Oe,1,"target"]],[me],0,void 0,A.ReactNextElement)),ge();var ze=a(9464),Ge=a(8353);function He(e,t,a,n){var i=[],o=[],r=[],l=0;return e.forEach((e=>{if(e.key=""===n?"".concat(l):"".concat(n,".").concat(l),function(e){return"group"===e.type}(e)||function(e,t){return Boolean("subMenu"===e.type||void 0)}(e)){var c=He(e.items,t,a,e.key);i.push(...c.selectedKeys),(c.selectedKeys.length||e.defaultExpanded)&&o.push(e.key),o.push(...c.openedKeys),r.push(...c.matchedKeys)}else if(function(e,t,a){if(!e.to)return!1;var n="object"==typeof e.to?e.to:(0,Ge.parsePath)(e.to),i=n.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),o=!!(0,ze.matchPath)(t,{path:i,exact:e.exact});if(o&&e.activeMatchSearch&&(o=Ve(a,n.search)),!o&&Array.isArray(e.activeIncludes))for(var r of e.activeIncludes){var l,c=void 0,s=r.includes("?");if(s&&(c=(0,Ge.parsePath)(r)),(o=!!(0,ze.matchPath)(t,{path:s?c.pathname:r,exact:!0}))&&null!==(l=c)&&void 0!==l&&l.search&&(o=Ve(a,c.search)),o)break}if(o&&Array.isArray(e.activeExcludes))for(var h of e.activeExcludes)if(!(o=!(0,ze.matchPath)(t,{path:h,exact:!0})))break;return o}(e,t,a)){i.push(String(e.key));for(var s=e.key.split("."),h=0;h<s.length;h++)r.push(s.slice(0,h+1).join("."))}l+=1})),i.length&&""!==n&&o.push(n),{selectedKeys:i,openedKeys:o,matchedKeys:r}}function Ve(e,t){var a=new URLSearchParams(e),n=new URLSearchParams(t);for(var[i,o]of n.entries()){var r;if((null!==(r=a.get(i))&&void 0!==r?r:"")!==o)return!1}return!0}var Ye,Je,$e,qe,Xe,Qe,et,tt,at,nt=a(8799),it=(0,A.wrapBrick)("visual-builder.workbench-action"),{defineElement:ot,property:rt}=(0,I.createDecorators)();Je=ot("visual-builder.workbench-action-list",{styleTexts:[nt.Z]}),$e=rt(),Xe=rt({attribute:!1});var lt,ct=new WeakMap,st=new WeakMap;class ht extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,ct,{writable:!0,value:(et(this),qe(this))}),(0,k.Z)(this,st,{writable:!0,value:Qe(this)})}get appId(){return(0,N.Z)(this,ct)}set appId(e){(0,x.Z)(this,ct,e)}get menu(){return(0,N.Z)(this,st)}set menu(e){(0,x.Z)(this,st,e)}render(){return R().createElement(pt,{appId:this.appId,menu:this.menu})}}tt=ht,({e:[qe,Qe,et],c:[at,Ye]}=(0,y.Z)(tt,[[$e,1,"appId"],[Xe,1,"menu"]],[Je],0,void 0,A.ReactNextElement)),Ye();var dt=new Map;function pt(e){var t,{appId:a,menu:n}=e,i=(0,ze.getHistory)(),[o,r]=(0,O.useState)(),[l,c]=(0,O.useState)(i.location);return(0,O.useEffect)((()=>{var e=i.listen((e=>{c(e)}));return e}),[i]),(0,O.useEffect)((()=>{lt||(lt=a),lt!==a&&(dt.clear(),lt=a)}),[a]),(0,O.useEffect)((()=>{var e,{pathname:t,search:a}=l,{selectedKeys:i}=He(null!==(e=null==n?void 0:n.menuItems)&&void 0!==e?e:[],t,a,"");r(Number(i[0]))}),[n,l]),R().createElement("div",{className:"workBenchActionList"},null==n||null===(t=n.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){var a=e.to;return o!==t&&dt.has(t)&&(a=dt.get(t)),R().createElement(it,{key:t,icon:e.icon,to:a,href:e.href,target:e.target,active:o===t,onClick:()=>(e=>{e.href||dt.set(o,"".concat(l.pathname).concat(l.search))})(e)})}})).filter(Boolean))}var ut,bt,vt,Et,gt,mt,ft,wt,Lt,kt,Zt,xt,Nt,yt,Ot,Rt,It,At,Mt,Tt,_t,Dt,Ct,Pt,Ut,Wt,Ft,St,Bt,Kt,jt,zt,Gt,Ht,Vt,Yt,Jt,$t,qt,Xt,Qt,ea,ta,aa,na,ia,oa,ra,la,ca,sa,ha,da,pa,ua,ba,va,Ea,ga,ma,fa=a(5178),wa=a(8486),La=a(1732),ka=a(3321),Za=a(8401),xa=a(89),Na=a(1674);function ya(e){return e.key}a(2006);var Oa,{defineElement:Ra,property:Ia,event:Aa}=(0,I.createDecorators)();bt=Ra("visual-builder.workbench-tree",{styleTexts:[xa.Z,Na.Z]}),vt=Ia({attribute:!1}),gt=Ia({attribute:!1}),ft=Ia({type:Boolean}),Lt=Ia(),Zt=Ia({type:Boolean}),Nt=Ia(),Ot=Ia({type:Boolean}),It=Ia({attribute:!1}),Mt=Ia({type:Boolean}),_t=Ia({attribute:!1}),Ct=Ia({attribute:!1}),Ut=Ia({type:Boolean}),Ft=Ia({attribute:!1}),Bt=Ia({type:Boolean}),jt=Ia({type:Boolean}),Gt=Ia({type:Boolean}),Vt=Ia({type:String}),Jt=Ia({type:Boolean}),qt=Aa({type:"action.click"}),ta=Aa({type:"node.click"}),oa=Aa({type:"node.drop"}),sa=Aa({type:"context.menu"}),ua=Aa({type:"node.toggle"});var Ma=new WeakMap,Ta=new WeakMap,_a=new WeakMap,Da=new WeakMap,Ca=new WeakMap,Pa=new WeakMap,Ua=new WeakMap,Wa=new WeakMap,Fa=new WeakMap,Sa=new WeakMap,Ba=new WeakMap,Ka=new WeakMap,ja=new WeakMap,za=new WeakMap,Ga=new WeakMap,Ha=new WeakMap,Va=new WeakMap,Ya=new WeakMap,Ja=new WeakMap,$a=new WeakMap,qa=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,en=new WeakMap,tn=new WeakMap,an=new WeakMap,nn=new WeakMap,on=new WeakMap,rn=new WeakMap,ln=new WeakMap,cn=new WeakMap,sn=new WeakMap,hn=new WeakMap;class dn extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,sn,{get:Ln,set:wn}),(0,k.Z)(this,rn,{get:fn,set:mn}),(0,k.Z)(this,an,{get:gn,set:En}),(0,k.Z)(this,Qa,{get:vn,set:bn}),(0,k.Z)(this,$a,{get:un,set:pn}),(0,k.Z)(this,Ma,{writable:!0,value:(ga(this),Et(this))}),(0,k.Z)(this,Ta,{writable:!0,value:mt(this)}),(0,k.Z)(this,_a,{writable:!0,value:wt(this)}),(0,k.Z)(this,Da,{writable:!0,value:kt(this)}),(0,k.Z)(this,Ca,{writable:!0,value:xt(this)}),(0,k.Z)(this,Pa,{writable:!0,value:yt(this)}),(0,k.Z)(this,Ua,{writable:!0,value:Rt(this)}),(0,k.Z)(this,Wa,{writable:!0,value:At(this)}),(0,k.Z)(this,Fa,{writable:!0,value:Tt(this)}),(0,k.Z)(this,Sa,{writable:!0,value:Dt(this)}),(0,k.Z)(this,Ba,{writable:!0,value:Pt(this)}),(0,k.Z)(this,Ka,{writable:!0,value:Wt(this)}),(0,k.Z)(this,ja,{writable:!0,value:St(this)}),(0,k.Z)(this,za,{writable:!0,value:Kt(this)}),(0,k.Z)(this,Ga,{writable:!0,value:zt(this)}),(0,k.Z)(this,Ha,{writable:!0,value:Ht(this)}),(0,k.Z)(this,Va,{writable:!0,value:Yt(this)}),(0,k.Z)(this,Ya,{writable:!0,value:$t(this)}),(0,k.Z)(this,Ja,{writable:!0,value:Xt(this)}),(0,k.Z)(this,qa,{writable:!0,value:e=>{(0,N.Z)(this,$a).emit(e)}}),(0,k.Z)(this,Xa,{writable:!0,value:aa(this)}),(0,k.Z)(this,en,{writable:!0,value:e=>()=>{(0,N.Z)(this,Qa).emit(e.data)}}),(0,k.Z)(this,tn,{writable:!0,value:ra(this)}),(0,k.Z)(this,nn,{writable:!0,value:e=>{(0,N.Z)(this,an).emit(e)}}),(0,k.Z)(this,on,{writable:!0,value:ha(this)}),(0,k.Z)(this,ln,{writable:!0,value:e=>t=>{t.preventDefault(),(0,N.Z)(this,rn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})}}),(0,k.Z)(this,cn,{writable:!0,value:ba(this)}),(0,k.Z)(this,hn,{writable:!0,value:(e,t)=>{(0,N.Z)(this,sn).emit({nodeId:e,collapsed:t})}})}get nodes(){return(0,N.Z)(this,Ma)}set nodes(e){(0,x.Z)(this,Ma,e)}get actions(){return(0,N.Z)(this,Ta)}set actions(e){(0,x.Z)(this,Ta,e)}get actionsHidden(){return(0,N.Z)(this,_a)}set actionsHidden(e){(0,x.Z)(this,_a,e)}get placeholder(){return(0,N.Z)(this,Da)}set placeholder(e){(0,x.Z)(this,Da,e)}get isTransformName(){return(0,N.Z)(this,Ca)}set isTransformName(e){(0,x.Z)(this,Ca,e)}get searchPlaceholder(){return(0,N.Z)(this,Pa)}set searchPlaceholder(e){(0,x.Z)(this,Pa,e)}get noSearch(){return(0,N.Z)(this,Ua)}set noSearch(e){(0,x.Z)(this,Ua,e)}get activeKey(){return(0,N.Z)(this,Wa)}set activeKey(e){(0,x.Z)(this,Wa,e)}get showMatchedNodeOnly(){return(0,N.Z)(this,Fa)}set showMatchedNodeOnly(e){(0,x.Z)(this,Fa,e)}get matchNodeDataFields(){return(0,N.Z)(this,Sa)}set matchNodeDataFields(e){(0,x.Z)(this,Sa,e)}get fixedActionsFor(){return(0,N.Z)(this,Ba)}set fixedActionsFor(e){(0,x.Z)(this,Ba,e)}get collapsible(){return(0,N.Z)(this,Ka)}set collapsible(e){(0,x.Z)(this,Ka,e)}get collapsedNodes(){return(0,N.Z)(this,ja)}set collapsedNodes(e){(0,x.Z)(this,ja,e)}get allowDrag(){return(0,N.Z)(this,za)}set allowDrag(e){(0,x.Z)(this,za,e)}get allowDragToRoot(){return(0,N.Z)(this,Ga)}set allowDragToRoot(e){(0,x.Z)(this,Ga,e)}get allowDragToInside(){return(0,N.Z)(this,Ha)}set allowDragToInside(e){(0,x.Z)(this,Ha,e)}get nodeKey(){return(0,N.Z)(this,Va)}set nodeKey(e){(0,x.Z)(this,Va,e)}get skipNotify(){return(0,N.Z)(this,Ya)}set skipNotify(e){(0,x.Z)(this,Ya,e)}render(){return R().createElement(wa.L.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,N.Z)(this,qa)}},R().createElement(ka.f.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:ya,onNodeToggle:(0,N.Z)(this,hn),skipNotify:this.skipNotify,clickFactory:(0,N.Z)(this,en),contextMenuFactory:(0,N.Z)(this,ln),matchNode:(e,t)=>{var a;return(0,Za.$)(e.name,t)||!(null===(a=this.matchNodeDataFields)||void 0===a||!a.length)&&(0,Za.$)("*"===this.matchNodeDataFields?e.data:(0,fa.pick)(e.data,this.matchNodeDataFields),t)}}},R().createElement(La.ME,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,N.Z)(this,nn),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}function pn(e){ea(this,e)}function un(){return Qt(this)}function bn(e){ia(this,e)}function vn(){return na(this)}function En(e){ca(this,e)}function gn(){return la(this)}function mn(e){pa(this,e)}function fn(){return da(this)}function wn(e){Ea(this,e)}function Ln(){return va(this)}ma=dn,({e:[Et,mt,wt,kt,xt,yt,Rt,At,Tt,Dt,Pt,Wt,St,Kt,zt,Ht,Yt,$t,Xt,Qt,ea,aa,na,ia,ra,la,ca,ha,da,pa,ba,va,Ea,ga],c:[Oa,ut]}=(0,y.Z)(ma,[[vt,1,"nodes"],[gt,1,"actions"],[ft,1,"actionsHidden"],[Lt,1,"placeholder"],[Zt,1,"isTransformName"],[Nt,1,"searchPlaceholder"],[Ot,1,"noSearch"],[It,1,"activeKey"],[Mt,1,"showMatchedNodeOnly"],[_t,1,"matchNodeDataFields"],[Ct,1,"fixedActionsFor"],[Ut,1,"collapsible"],[Ft,1,"collapsedNodes"],[Bt,1,"allowDrag"],[jt,1,"allowDragToRoot"],[Gt,1,"allowDragToInside"],[Vt,1,"nodeKey"],[Jt,1,"skipNotify"],[qt,1,"actionClickEvent",e=>(0,N.Z)(e,Ja),(e,t)=>(0,x.Z)(e,Ja,t)],[ta,1,"nodeClickEvent",e=>(0,N.Z)(e,Xa),(e,t)=>(0,x.Z)(e,Xa,t)],[oa,1,"nodeDropEvent",e=>(0,N.Z)(e,tn),(e,t)=>(0,x.Z)(e,tn,t)],[sa,1,"nodeContextMenuEvent",e=>(0,N.Z)(e,on),(e,t)=>(0,x.Z)(e,on,t)],[ua,1,"nodeToggleEvent",e=>(0,N.Z)(e,cn),(e,t)=>(0,x.Z)(e,cn,t)]],[bt],0,(e=>hn.has((0,Z.Z)(e))),A.ReactNextElement)),ut();var kn=a(1935),Zn=a(2907);a(894),customElements.define("visual-builder.inject-preview-agent",(0,kn.createProviderClass)((function(e,t){return(0,Zn.Z)(e,t)})));var xn,Nn,yn,On,Rn,In,An,Mn,Tn,_n,Dn,Cn,Pn,Un,Wn,Fn,Sn,Bn,Kn,jn,zn=a(3028),Gn=a(8874),Hn=a.n(Gn),Vn=a(6094),Yn=a(7088),Jn=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}({}),$n="bricks/visual-builder/workbench-history-action",qn=a(4795),Xn=a(5932),Qn=function(){var e=(0,qn.Z)((function*(e,t,a){return(yield Xn.http.get("api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/".concat(e,"/changes"),(0,zn.Z)((0,zn.Z)({},a),{},{params:t}))).data}));return function(t,a,n){return e.apply(this,arguments)}}(),ei=a(860),ti={add:"".concat($n,":").concat(Jn.ADD),edit:"".concat($n,":").concat(Jn.EDIT),delete:"".concat($n,":").concat(Jn.DELETE),batch_delete:"".concat($n,":").concat(Jn.DELETE),import:"".concat($n,":").concat(Jn.IMPORT),clone:"".concat($n,":").concat(Jn.CLONE),append_relation:"".concat($n,":").concat(Jn.APPEND_RELATION),update_relation:"".concat($n,":").concat(Jn.UPDATE_RELATION),remove_relation:"".concat($n,":").concat(Jn.REMOVE_RELATION),rollback:"".concat($n,":").concat(Jn.ROLLBACK),rollback_all:"".concat($n,":").concat(Jn.ROLLBACK_ALL)},ai={add:"".concat($n,":").concat(Jn.ADD_FULL),edit:"".concat($n,":").concat(Jn.EDIT_FULL),delete:"".concat($n,":").concat(Jn.DELETE_FULL),batch_delete:"".concat($n,":").concat(Jn.DELETE_FULL),import:"".concat($n,":").concat(Jn.IMPORT_FULL),clone:"".concat($n,":").concat(Jn.CLONE_FULL),append_relation:"".concat($n,":").concat(Jn.APPEND_RELATION_FULL),update_relation:"".concat($n,":").concat(Jn.UPDATE_RELATION_FULL),remove_relation:"".concat($n,":").concat(Jn.REMOVE_RELATION_FULL),rollback:"".concat($n,":").concat(Jn.ROLLBACK_FULL),rollback_all:"".concat($n,":").concat(Jn.ROLLBACK_ALL_FULL)},ni={project:"".concat($n,":").concat(Jn.PROJECT),userGroup:"".concat($n,":").concat(Jn.USER),permission:"".concat($n,":").concat(Jn.PERMISSION),brick:"".concat($n,":").concat(Jn.BRICK),route:"".concat($n,":").concat(Jn.ROUTE),template:"".concat($n,":").concat(Jn.TEMPLATE),snippet:"".concat($n,":").concat(Jn.SNIPPET),i18n:"".concat($n,":").concat(Jn.I18N),image:"".concat($n,":").concat(Jn.IMAGE),function:"".concat($n,":").concat(Jn.FUNCTION),menu:"".concat($n,":").concat(Jn.MENU),menuItem:"".concat($n,":").concat(Jn.MENU_ITEM),workflow:"".concat($n,":").concat(Jn.WORKFLOW)},ii={PROJECT_MICRO_APP:"".concat($n,":").concat(Jn.PROJECT),"MICRO_APP_USER_GROUP@EASYOPS":"".concat($n,":").concat(Jn.USER),MICRO_APP_RESOURCE_PERMISSION:"".concat($n,":").concat(Jn.PERMISSION),STORYBOARD_BRICK:"".concat($n,":").concat(Jn.BRICK),STORYBOARD_ROUTE:"".concat($n,":").concat(Jn.ROUTE),STORYBOARD_TEMPLATE:"".concat($n,":").concat(Jn.TEMPLATE),STORYBOARD_SNIPPET:"".concat($n,":").concat(Jn.SNIPPET),STORYBOARD_I18N:"".concat($n,":").concat(Jn.I18N),MICRO_APP_RESOURCE_IMAGE:"".concat($n,":").concat(Jn.IMAGE),STORYBOARD_FUNCTION:"".concat($n,":").concat(Jn.FUNCTION),MICRO_APP_RESOURCE_MENU:"".concat($n,":").concat(Jn.MENU),MICRO_APP_RESOURCE_MENU_ITEM:"".concat($n,":").concat(Jn.MENU_ITEM),"WORKFLOW_DEF@EASYOPS":"".concat($n,":").concat(Jn.WORKFLOW)};function oi(e){var t,a,n,i,o,r,l,c,s,h,d,p,u,b,v,E,g,m="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",f=ei.i18n.t(null!==(t=ni[e.category])&&void 0!==t?t:e.category),w=ei.i18n.t(null!==(a=ti[m])&&void 0!==a?a:m),L=ei.i18n.t(null!==(n=ii[null===(i=e.abstract)||void 0===i?void 0:i.leftObjectId])&&void 0!==n?n:null===(o=e.abstract)||void 0===o?void 0:o.leftObjectId),k=ei.i18n.t(null!==(r=ii[null===(l=e.abstract)||void 0===l?void 0:l.rightObjectId])&&void 0!==r?r:null===(c=e.abstract)||void 0===c?void 0:c.rightObjectId),Z=ri(null===(s=e.abstract)||void 0===s?void 0:s.nodes,null===(h=e.abstract)||void 0===h?void 0:h.nodesCount),x=ri(null===(d=e.abstract)||void 0===d?void 0:d.leftNodes,null===(p=e.abstract)||void 0===p?void 0:p.leftNodesCount),N=ri(null===(u=e.abstract)||void 0===u?void 0:u.rightNodes,null===(b=e.abstract)||void 0===b?void 0:b.rightNodesCount),y="rollback"===m?oi(e.rollBackIdInfo).abstract:null;return{category:f,action:w,leftObjectId:L,rightObjectId:k,nodes:Z,leftNodes:x,rightNodes:N,abstract:ei.i18n.t(null!==(v=ai[m])&&void 0!==v?v:m,{category:f,nodes:Z,leftNodes:x,rightNodes:N,nodeChanges:null===(E=e.abstract)||void 0===E||null===(E=E.nodeChanges)||void 0===E?void 0:E.join(", "),relationChanges:null===(g=e.abstract)||void 0===g||null===(g=g.relationChanges)||void 0===g?void 0:g.join(", "),leftObjectId:L,rightObjectId:k,rollbackAbstract:y}),rollbackAbstract:y}}function ri(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return ei.i18n.t("".concat($n,":").concat(Jn.NODE),{nodes:e.join(a),context:t>e.length?"ellipsis":void 0,count:t})}(0,Yn.initializeReactI18n)($n,{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:"工作流"}});var li,{defineElement:ci,property:si,event:hi}=(0,I.createDecorators)(),di=(0,A.wrapBrick)("eo-button"),pi=(0,A.wrapBrick)("eo-link"),ui=(0,A.wrapBrick)("eo-icon"),bi=(0,A.wrapBrick)("eo-easyops-avatar"),vi=(0,A.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",beforeVisibleChange:"before.visible.change"});Nn=ci("visual-builder.workbench-history-action",{styleTexts:[Vn.Z]}),yn=si(),Rn=si(),An=hi({type:"history.item.click"}),Dn=hi({type:"rollback"}),Wn=hi({type:"rollback.all"});var Ei=new WeakMap,gi=new WeakMap,mi=new WeakMap,fi=new WeakMap,wi=new WeakMap,Li=new WeakMap,ki=new WeakMap,Zi=new WeakMap,xi=new WeakMap,Ni=new WeakMap,yi=new WeakMap;class Oi extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Ni,{get:_i,set:Ti}),(0,k.Z)(this,ki,{get:Mi,set:Ai}),(0,k.Z)(this,fi,{get:Ii,set:Ri}),(0,k.Z)(this,Ei,{writable:!0,value:(Kn(this),On(this))}),(0,k.Z)(this,gi,{writable:!0,value:In(this)}),(0,k.Z)(this,mi,{writable:!0,value:Mn(this)}),(0,k.Z)(this,wi,{writable:!0,value:e=>{(0,N.Z)(this,fi).emit(e)}}),(0,k.Z)(this,Li,{writable:!0,value:Cn(this)}),(0,k.Z)(this,Zi,{writable:!0,value:e=>{(0,N.Z)(this,ki).emit(e)}}),(0,k.Z)(this,xi,{writable:!0,value:Fn(this)}),(0,k.Z)(this,yi,{writable:!0,value:()=>{(0,N.Z)(this,Ni).emit()}})}get appId(){return(0,N.Z)(this,Ei)}set appId(e){(0,x.Z)(this,Ei,e)}get projectId(){return(0,N.Z)(this,gi)}set projectId(e){(0,x.Z)(this,gi,e)}render(){return R().createElement(Di,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,N.Z)(this,wi),onRollback:(0,N.Z)(this,Zi),onRollbackAll:(0,N.Z)(this,yi)})}}function Ri(e){_n(this,e)}function Ii(){return Tn(this)}function Ai(e){Un(this,e)}function Mi(){return Pn(this)}function Ti(e){Bn(this,e)}function _i(){return Sn(this)}function Di(e){var{appId:t,onHistoryItemClick:a,onRollback:n,onRollbackAll:i}=e,{t:o}=(0,Yn.useTranslation)($n),[r,l]=(0,O.useState)(!1),[c,s]=(0,O.useState)(!0),[h,d]=(0,O.useState)(!1),[p,u]=(0,O.useState)([]),b=(0,O.useRef)(""),v=e=>{l(!0),Qn(t,{ts:b.current,limit:20}).then((t=>{u((a=>{var n=t.list.map((e=>(0,zn.Z)((0,zn.Z)({},e),{},{translation:oi(e)})));return e?n:a.concat(n)})),b.current=t.ts,d(t.list.length<20),s(t.list.length<20)})).catch((e=>{(0,ze.handleHttpError)(e)})).finally((()=>{l(!1)}))};return R().createElement(vi,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",beforeVisibleChange:e=>{e.detail&&(s(!0),d(!1),u([]),b.current="",v(!0))}},R().createElement(di,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),R().createElement("div",null,R().createElement("div",{className:"history-title"},"History"),R().createElement("div",{className:"history-list"},p.length?R().createElement(R().Fragment,null,p.map(((e,t)=>R().createElement(Ci,{key:"".concat(e.uniqueKey,"-").concat(e.ts),data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:a,onRollback:n}))),!c&&R().createElement("span",{className:"load-more-container"},R().createElement(pi,{className:"load-more",disabled:r,onClick:()=>v()},o(Jn.LOAD_MORE))),h&&R().createElement("span",{className:"end-container"},"The End",R().createElement(ui,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>i()}))):R().createElement("div",{className:"empty"},o(r?Jn.LOADING:Jn.NO_DATA))),R().createElement("slot",null)))}function Ci(e){var{data:t,enableRollback:a,current:n,onHistoryItemClick:i,onRollback:o}=e,r=Hn()(Number(t.ts)/1e6),l=Hn().duration(r.diff(Hn()())),c=l.days()<=-1?r.format("YYYY-MM-DD HH:mm:ss"):l.humanize(!0,{ss:0,s:60,m:60,h:24});return R().createElement("div",{className:"item-container"},R().createElement("div",{className:"item-title"},R().createElement("div",{className:"title-left",onClick:()=>i((0,zn.Z)((0,zn.Z)({},t),{},{enableRollback:a}))},R().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),n&&R().createElement("div",{className:"branch"},"(current)")),R().createElement("div",{className:"title-right"},a&&R().createElement(ui,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>o(t)}))),R().createElement("div",{className:"item-info"},R().createElement(bi,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),R().createElement("div",{className:"time"},c),R().createElement("div",{className:"operator"},t.user)))}jn=Oi,({e:[On,In,Mn,Tn,_n,Cn,Pn,Un,Fn,Sn,Bn,Kn],c:[li,xn]}=(0,y.Z)(jn,[[yn,1,"appId"],[Rn,1,"projectId"],[An,1,"historyItemClickEvent",e=>(0,N.Z)(e,mi),(e,t)=>(0,x.Z)(e,mi,t)],[Dn,1,"rollbackEvent",e=>(0,N.Z)(e,Li),(e,t)=>(0,x.Z)(e,Li,t)],[Wn,1,"rollbackAllEvent",e=>(0,N.Z)(e,xi),(e,t)=>(0,x.Z)(e,xi,t)]],[Nn],0,(e=>yi.has((0,Z.Z)(e))),A.ReactNextElement)),xn();var Pi,Ui,Wi,Fi,Si,Bi,Ki,ji,zi,Gi,Hi,Vi,Yi,Ji,$i,qi,Xi,Qi,eo,to,ao,no,io,oo,ro,lo,co,so,ho,po,uo,bo,vo=a(1385),{defineElement:Eo,property:go,event:mo}=(0,I.createDecorators)(),fo=(0,A.wrapBrick)("eo-icon"),wo=new Set;Ui=Eo("visual-builder.page-arch-node",{styleTexts:[vo.Z]}),Wi=go(),Si=go(),Ki=go({attribute:!1}),zi=go({type:Boolean}),Gi=go({type:Boolean,render:!1}),Vi=go(),Ji=mo({type:"label.editing.change"}),Qi=mo({type:"label.change"}),no=mo({type:"child.append"}),lo=mo({type:"external.click"});var Lo=new WeakMap,ko=new WeakMap,Zo=new WeakMap,xo=new WeakMap,No=new WeakMap,yo=new WeakMap,Oo=new WeakMap,Ro=new WeakMap,Io=new WeakMap,Ao=new WeakMap,Mo=new WeakMap,To=new WeakMap,_o=new WeakMap,Do=new WeakMap,Co=new WeakMap,Po=new WeakMap,Uo=new WeakMap;class Wo extends A.ReactNextElement{constructor(){super(...arguments),(0,k.Z)(this,Po,{get:Ho,set:Go}),(0,k.Z)(this,_o,{get:zo,set:jo}),(0,k.Z)(this,Ao,{get:Ko,set:Bo}),(0,k.Z)(this,Oo,{get:So,set:Fo}),(0,k.Z)(this,Lo,{writable:!0,value:(po(this),Fi(this))}),(0,k.Z)(this,ko,{writable:!0,value:Bi(this)}),(0,k.Z)(this,Zo,{writable:!0,value:ji(this)}),(0,k.Z)(this,xo,{writable:!0,value:Hi(this)}),(0,k.Z)(this,No,{writable:!0,value:Yi(this)}),(0,k.Z)(this,yo,{writable:!0,value:$i(this)}),(0,k.Z)(this,Ro,{writable:!0,value:e=>{(0,N.Z)(this,Oo).emit(e)}}),(0,k.Z)(this,Io,{writable:!0,value:eo(this)}),(0,k.Z)(this,Mo,{writable:!0,value:e=>{(0,N.Z)(this,Ao).emit(e)}}),(0,k.Z)(this,To,{writable:!0,value:io(this)}),(0,k.Z)(this,Do,{writable:!0,value:()=>{(0,N.Z)(this,_o).emit()}}),(0,k.Z)(this,Co,{writable:!0,value:co(this)}),(0,k.Z)(this,Uo,{writable:!0,value:e=>{(0,N.Z)(this,Po).emit(e)}})}get label(){return(0,N.Z)(this,Lo)}set label(e){(0,x.Z)(this,Lo,e)}get type(){return(0,N.Z)(this,ko)}set type(e){(0,x.Z)(this,ko,e)}get external(){return(0,N.Z)(this,Zo)}set external(e){(0,x.Z)(this,Zo,e)}get active(){return(0,N.Z)(this,xo)}set active(e){(0,x.Z)(this,xo,e)}get autoFocusOnce(){return(0,N.Z)(this,No)}set autoFocusOnce(e){(0,x.Z)(this,No,e)}render(){return R().createElement(Vo,{label:this.label,type:this.type,external:this.external,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,N.Z)(this,Ro),onLabelChange:(0,N.Z)(this,Mo),onChildAppend:(0,N.Z)(this,Do),onExternalClick:(0,N.Z)(this,Uo)})}}function Fo(e){Xi(this,e)}function So(){return qi(this)}function Bo(e){ao(this,e)}function Ko(){return to(this)}function jo(e){ro(this,e)}function zo(){return oo(this)}function Go(e){ho(this,e)}function Ho(){return so(this)}function Vo(e){var{label:t,type:a,external:n,autoFocusOnce:i,onLabelEditingChange:o,onLabelChange:r,onChildAppend:l,onExternalClick:c}=e,s="board"===a?"board":"page",[h,d]=(0,O.useState)(t),[p,u]=(0,O.useState)(!1),b=(0,O.useRef)(!1),[v,E]=(0,O.useState)(!1),g=(0,O.useRef)(null);(0,O.useEffect)((()=>{d(t)}),[t]);var m=(0,O.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),u(!0)}),[]);(0,O.useEffect)((()=>{i&&!wo.has(i)&&(wo.add(i),setTimeout((()=>{u(!0)}),1))}),[i]),(0,O.useEffect)((()=>{var e,t;p&&(null===(e=g.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=g.current)||void 0===t||t.select())}),[p]),(0,O.useEffect)((()=>{b.current?null==o||o(p):b.current=!0}),[p,o]);var f=(0,O.useCallback)((e=>{d(e.target.value)}),[]),w=(0,O.useCallback)((e=>{var t,a=e.key||e.keyCode||e.which;"Enter"!==a&&13!==a||null===(t=g.current)||void 0===t||t.blur()}),[]),L=(0,O.useCallback)((()=>{u(!1),E(!0)}),[]);(0,O.useEffect)((()=>{v&&(null==r||r(h),E(!1))}),[h,r,v]);var k=(0,O.useCallback)((e=>{e.stopPropagation(),null==l||l()}),[l]),Z=(0,O.useCallback)((e=>{e.stopPropagation(),null==c||c(n)}),[n,c]);return R().createElement(R().Fragment,null,R().createElement("div",{className:D()("node",s,{"editing-label":p})},R().createElement("input",{className:"label-input",value:h,ref:g,onChange:f,onKeyDown:w,onBlur:L,onContextMenu:e=>e.stopPropagation()}),R().createElement("div",{className:"label",onDoubleClick:m},h),"board"===s?R().createElement("div",{className:"icon-container"},R().createElement(fo,{lib:"antd",icon:"unordered-list"})):R().createElement("div",{className:"thumbnail-container"},R().createElement(fo,{lib:"antd",icon:"ellipsis"}),n&&R().createElement("div",{className:"external",onClick:Z,onDoubleClick:e=>e.stopPropagation()},R().createElement(fo,{lib:"antd",icon:"desktop"}),R().createElement("span",{className:"external-label"},n.label)))),R().createElement("div",{className:"add-button",role:"button",onClick:k},R().createElement(fo,{lib:"fa",icon:"plus"})))}uo=Wo,({e:[Fi,Bi,ji,Hi,Yi,$i,qi,Xi,eo,to,ao,io,oo,ro,co,so,ho,po],c:[bo,Pi]}=(0,y.Z)(uo,[[Wi,1,"label"],[Si,1,"type"],[Ki,1,"external"],[[zi,Gi],1,"active"],[Vi,1,"autoFocusOnce"],[Ji,1,"labelEditingChange",e=>(0,N.Z)(e,yo),(e,t)=>(0,x.Z)(e,yo,t)],[Qi,1,"labelChange",e=>(0,N.Z)(e,Io),(e,t)=>(0,x.Z)(e,Io,t)],[no,1,"childAppend",e=>(0,N.Z)(e,To),(e,t)=>(0,x.Z)(e,To,t)],[lo,1,"externalClick",e=>(0,N.Z)(e,Co),(e,t)=>(0,x.Z)(e,Co,t)]],[Ui],0,(e=>Uo.has((0,Z.Z)(e))),A.ReactNextElement)),Pi()},1385:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{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;-moz-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-webkit-fit-content;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;-moz-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{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px solid var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;overflow:hidden;color:var(--palette-gray-5);font-size:36px;width:100%;position:relative}.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 solid var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px solid 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([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:-webkit-fit-content;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)}",""]);const l=r.toString()},8453:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},8799:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,'.workBenchActionList{display:flex;flex-direction:column;width:-webkit-min-content;width:-moz-min-content;width:min-content;height:100%;background-color:#4297ff}:host-context(html[data-theme="dark-v2"]) .workBenchActionList,\n:host-context([data-override-theme="dark-v2"]) .workBenchActionList{background-color:#323237}',""]);const l=r.toString()},7310:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:rgba(255,255,255,0.4);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:white}.action.active::part(link),\n.action::part(link):hover{color:white}',""]);const l=r.toString()},6094:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},8249:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()},3571:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(9601),i=a.n(n),o=a(2609),r=a.n(o)()(i());r.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 l=r.toString()}}]);
3
+ //# sourceMappingURL=7757.462657fe.js.map