"use strict";(this.webpackChunk_lingxiteam_pcfactory=this.webpackChunk_lingxiteam_pcfactory||[]).push([[392],{19340:function(e,t,n){n.r(t);var i=n(7896),r=n(33028),a=n(31461),o=n(90359),l=n.n(o),c=n(80693),u=n(70247),d=n(69517),s=n(84707),p=n(72779),g=n.n(p),f=n(37382),y=["children","style","className","visible","backgroundType","getEngineApis","loading"],v=(0,d.UB)((function(e,t){var n=e.children,d=e.style,p=e.className,v=e.visible,h=void 0===v||v,m=e.backgroundType,b=e.getEngineApis,x=e.loading,k=(0,a.Z)(e,y),C=(null==b?void 0:b())||{},E=(0,s.b)(C).getLocale,Z=(0,c.Z)({engineApis:C,backgroundType:m,appId:null==k?void 0:k.appId,mode:"engine"}).backgroundStyle,w=(0,f.Z)(h,d),I=(0,o.useRef)(),R=(0,o.useRef)(),S=(0,o.useState)(0),T=S[0],_=S[1],A=function(e){var t={};if(I.current&&R.current){var n=window.getComputedStyle(I.current),i=I.current,r=i.offsetWidth,a=i.offsetHeight,o=I.current.getBoundingClientRect(),l=R.current.getBoundingClientRect(),c={x:l.left-o.left,y:l.top-o.top};t.position="absolute",t.width="".concat(r,"px"),t.height="".concat(a,"px"),t.zIndex=n.zIndex,t.backgroundColor="rgba(255,255,255,0.5)",t.display="flex",t.justifyContent="center",t.alignItems="center",t.left=0,t.top=0,(c.x>0||c.y>0)&&(t.transform="translate(".concat(-c.x,"px, ").concat(-c.y,"px)"))}return e||(t.display="none"),t},B=(0,o.useMemo)((function(){return x&&R.current?l().createElement("div",{style:A(!0)},l().createElement(u.Spin,{tip:null==E?void 0:E("loadingText")})):null}),[x,R.current,T]);return(0,o.useEffect)((function(){x&&_(T+1)}),[x]),l().createElement("div",(0,i.Z)({style:(0,r.Z)((0,r.Z)((0,r.Z)({},Z),w),{},{position:"relative"}),className:g()("ued-free-layout",p),"data-compid":null==e?void 0:e["data-compid"]},k,{ref:I}),n,x&&l().createElement("div",{style:{width:0,height:0,position:"relative",backgroundColor:"transparent",visibility:x?"visible":"hidden"},ref:R},B))}));t.default=v}}]);