var x=(c,g,u)=>new Promise((y,a)=>{var r=n=>{try{l(u.next(n))}catch(m){a(m)}},s=n=>{try{l(u.throw(n))}catch(m){a(m)}},l=n=>n.done?y(n.value):Promise.resolve(n.value).then(r,s);l((u=u.apply(c,g)).next())});import{dn as P,r as v,u as h,dE as I,dF as M,am as R,c3 as S,dG as $,bV as C,d as z,z as V,_ as B,y as W,o as G,c as H,w as _,e as p,b,__tla as L}from"./index-fd0fd824.js";import{P as U,__tla as j}from"./index-d35460c6.js";import{__tla as A}from"./onMountedOrActivated-c075b0f3.js";import{__tla as D}from"./useWindowSizeFn-0280681a.js";import{__tla as F}from"./useContentViewHeight-3f9f9984.js";let E,N=Promise.all([(()=>{try{return L}catch(c){}})(),(()=>{try{return j}catch(c){}})(),(()=>{try{return A}catch(c){}})(),(()=>{try{return D}catch(c){}})(),(()=>{try{return F}catch(c){}})()]).then(()=>x(void 0,null,function*(){const c=Symbol("watermark-dom");function g(a=v(document.body)){const r=$(function(){const e=h(a);if(!e)return;const{clientHeight:t,clientWidth:i}=e;d({height:t,width:i})}),s=c.toString(),l=P(),n=()=>{const e=h(l);l.value=void 0;const t=h(a);t&&(e&&t.removeChild(e),I(t,r))};function m(e){const t=document.createElement("canvas"),i=300,f=240;Object.assign(t,{width:i,height:f});const o=t.getContext("2d");return o&&(o.rotate(-20*Math.PI/120),o.font="15px Vedana",o.fillStyle="rgba(0, 0, 0, 0.15)",o.textAlign="left",o.textBaseline="middle",o.fillText(e,i/20,f)),t.toDataURL("image/png")}function d(e={}){const t=h(l);t&&(C(e.width)&&(t.style.width=`${e.width}px`),C(e.height)&&(t.style.height=`${e.height}px`),C(e.str)&&(t.style.background=`url(${m(e.str)}) left top repeat`))}const k=e=>{if(h(l))return d({str:e}),s;const t=document.createElement("div");l.value=t,t.id=s,t.style.pointerEvents="none",t.style.top="0px",t.style.left="0px",t.style.position="absolute",t.style.zIndex="100000";const i=h(a);if(!i)return s;const{clientHeight:f,clientWidth:o}=i;return d({str:e,width:o,height:f}),i.appendChild(t),s};function w(e){k(e),M(document.documentElement,r),R()&&S(()=>{n()})}return{setWatermark:w,clear:n}}const u=z({components:{CollapseContainer:V,PageWrapper:U},setup(){const a=v(null),{setWatermark:r,clear:s}=g();return{setWatermark:r,clear:s,areaRef:a}}});function y(a,r,s,l,n,m){const d=W("a-button"),k=W("CollapseContainer"),w=W("PageWrapper");return G(),H(w,{title:"\u6C34\u5370\u793A\u4F8B"},{default:_(()=>[p(k,{class:"w-full h-32 bg-white rounded-md",title:"Global WaterMark"},{default:_(()=>[p(d,{type:"primary",class:"mr-2",onClick:r[0]||(r[0]=e=>a.setWatermark("WaterMark Info"))},{default:_(()=>[b(" Create ")]),_:1}),p(d,{color:"error",class:"mr-2",onClick:a.clear},{default:_(()=>[b(" Clear ")]),_:1},8,["onClick"]),p(d,{color:"warning",class:"mr-2",onClick:r[1]||(r[1]=e=>a.setWatermark("WaterMark Info New"))},{default:_(()=>[b(" Reset ")]),_:1})]),_:1})]),_:1})}E=B(u,[["render",y]])}));export{N as __tla,E as default};