sand-components-vben 2.7.28 → 2.7.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sand-components-vben",
3
- "version": "2.7.28",
3
+ "version": "2.7.29",
4
4
  "description": "",
5
5
  "main": "sand-components-vben.js",
6
6
  "scripts": {
@@ -93388,20 +93388,20 @@ const cJe = { class: "hint-content" }, lJe = { class: "dialog-body" }, dJe = { c
93388
93388
  const t = OJe(e), n = xJe(t);
93389
93389
  return encodeURIComponent(n);
93390
93390
  }, SJe = (e) => {
93391
- const { url: t, type: n, isOpenDirectly: r = !0 } = e, { origin: a } = location;
93391
+ const { url: t, type: n, isOpenDirectly: r = !0, watermark: a } = e, { origin: i } = location;
93392
93392
  if (t instanceof Array && !n)
93393
93393
  throw new Error("仅图片支持多文件预览");
93394
- let i = "";
93395
- const o = (s) => TJe(s);
93394
+ let o = "";
93395
+ const s = (u) => TJe(u);
93396
93396
  if (n) {
93397
- let s = "";
93398
- t instanceof Array ? s = t.join("|") : s = t, i = a + `/preview/picturesPreview?urls=${o(a + s)}`;
93397
+ let u = "";
93398
+ t instanceof Array ? u = t.join("|") : u = t, o = i + `/preview/picturesPreview?urls=${s(i + u)}`;
93399
93399
  } else
93400
- i = a + `/preview/onlinePreview?url=${o(a + t)}`;
93401
- if (r)
93402
- window.open(i);
93400
+ o = i + `/preview/onlinePreview?url=${s(i + t)}`;
93401
+ if (a && (o += `&watermarkTxt=${a}`), r)
93402
+ window.open(o);
93403
93403
  else
93404
- return i;
93404
+ return o;
93405
93405
  }, EJe = {
93406
93406
  ApiSelect: Woe,
93407
93407
  BaseUpload: vS,
@@ -377,4 +377,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),De=ce,xt=Re),qe===void
377
377
  width: ${q.width}px;
378
378
  height: ${q.height}px;
379
379
  display: block;
380
- `},T=()=>{A.overlay&&(A.overlay.style.display="none")},x=W=>{if(!A.isActive)return;const q=W.target;if(q.closest("#element-picker-overlay")||q.closest(".chat-bot-box")||q.closest(".ant-tooltip")||q.closest(".element-picker-hint")||q===document.body||q===document.documentElement||q.tagName==="SCRIPT"||q.tagName==="STYLE"||q.tagName==="LINK"||q.tagName==="META"){T();return}const z=q.getBoundingClientRect();if(z.width<3||z.height<3){T();return}if(z.bottom<0||z.top>window.innerHeight||z.right<0||z.left>window.innerWidth){T();return}A.currentElement=q,E(q)},N=async W=>{if(!A.isActive)return;W.preventDefault(),W.stopPropagation();const q=W.target;if(q.closest("#element-picker-overlay")||q.closest(".chat-bot-box")||q.closest(".ant-tooltip")||q.closest(".element-picker-hint")||q===document.body||q===document.documentElement||q.tagName==="SCRIPT"||q.tagName==="STYLE"||q.tagName==="LINK"||q.tagName==="META")return;const z=q.getBoundingClientRect();if(z.width<3||z.height<3)return;A.selectedElement=q;const C=D(q);M(),A.isLoading=!0,console.log("选中的元素:",q),console.log("元素信息:",C);const{minimalHtml:L,formHtml:B,structure:Q,formData:V,selectorInfo:oe}=Cqe(q);u(),await s({url:Ake(),data:{content:B},onComplete:()=>{console.log("完成")}})},D=W=>{var C;const q=W.getBoundingClientRect(),z=window.getComputedStyle(W);return{tagName:W.tagName.toLowerCase(),className:W.className,id:W.id,textContent:((C=W.textContent)==null?void 0:C.trim().substring(0,100))||"",attributes:Array.from(W.attributes).reduce((L,B)=>(L[B.name]=B.value,L),{}),dimensions:{width:q.width,height:q.height,left:q.left,top:q.top},styles:{backgroundColor:z.backgroundColor,color:z.color,fontSize:z.fontSize,fontFamily:z.fontFamily,display:z.display,position:z.position},xpath:P(W),cssSelector:S(W)}},P=W=>{if(W.id)return`//*[@id="${W.id}"]`;const q=[];for(;W&&W.nodeType===Node.ELEMENT_NODE;){let z=0,C=!1,L=W.previousSibling;for(;L;)L.nodeType===Node.ELEMENT_NODE&&L.nodeName===W.nodeName&&z++,L=L.previousSibling;for(L=W.nextSibling;L;){if(L.nodeType===Node.ELEMENT_NODE&&L.nodeName===W.nodeName){C=!0;break}L=L.nextSibling}const B=z||C?`[${z+1}]`:"";q.unshift(W.nodeName.toLowerCase()+B),W=W.parentNode}return q.length?"/"+q.join("/"):""},S=W=>{if(W.id)return`#${W.id}`;const q=[];for(;W&&W.nodeType===Node.ELEMENT_NODE;){let z=W.nodeName.toLowerCase();W.className&&(z+="."+W.className.split(" ").join(".")),q.unshift(z),W=W.parentNode}return q.join(" > ")},R=W=>{W.key==="Escape"&&A.isActive&&M()},H=()=>{!A.isActive||!A.currentElement||E(A.currentElement)},F=W=>{A.isActive=!0,A.currentElement=null,A.selectedElement=null,O(),document.addEventListener("mousemove",x,!0),document.addEventListener("click",N,!0),document.addEventListener("keydown",R,!0),document.addEventListener("scroll",H,!0),document.body.style.cursor="crosshair"},M=()=>{A.isActive=!1,A.currentElement=null,A.isLoading=!1,document.removeEventListener("mousemove",x,!0),document.removeEventListener("click",N,!0),document.removeEventListener("keydown",R,!0),document.removeEventListener("scroll",H,!0),document.body.style.cursor="",T()};return{pickerState:A,startPicker:F,stopPicker:M,cleanup:()=>{M(),A.overlay&&(document.body.removeChild(A.overlay),A.overlay=null)},showDialog:()=>{},hideDialog:()=>{A.showDialog=!1,A.isLoading=!1}}}const{pickerState:d,startPicker:f,stopPicker:p,cleanup:b,showDialog:h,hideDialog:g}=l(),y=()=>{p()},v=()=>{g()};return t({pickerState:d,startPicker:f,stopPicker:p,cleanup:b,showDialog:h,hideDialog:g}),m.watch(o,A=>{d.content=A,A&&d.isLoading&&(d.isLoading=!1,d.showDialog=!0)}),(A,O)=>m.unref(d).isActive||m.unref(d).showDialog||m.unref(d).isLoading?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["element-picker-hint",{"dialog-mode":m.unref(d).showDialog,"loading-mode":m.unref(d).isLoading}])},[m.createElementVNode("div",Lqe,[m.unref(d).isActive&&!m.unref(d).showDialog&&!m.unref(d).isLoading?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[O[0]||(O[0]=m.createElementVNode("div",{class:"hint-icon"},"🎯",-1)),O[1]||(O[1]=m.createElementVNode("div",{class:"hint-text"},[m.createElementVNode("div",{class:"hint-title"},"元素选择模式已启动"),m.createElementVNode("div",{class:"hint-description"}," 移动鼠标选择页面元素,点击确认选择,按ESC键退出 ")],-1)),m.createElementVNode("div",{class:"hint-close",onClick:y},"✕")],64)):m.createCommentVNode("",!0),m.unref(d).isLoading?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[O[2]||(O[2]=m.createStaticVNode('<div class="loading-icon" data-v-67a04885><div class="spinner" data-v-67a04885></div></div><div class="loading-text" data-v-67a04885><div class="loading-title" data-v-67a04885>正在分析元素</div><div class="loading-description" data-v-67a04885> 上传图片并进行AI分析中,请稍候... </div></div>',2))],64)):m.createCommentVNode("",!0),m.unref(d).showDialog?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createElementVNode("div",{class:"dialog-header"},[m.createElementVNode("div",{class:"dialog-close",onClick:v},"✕")]),m.createElementVNode("div",Hqe,[m.createElementVNode("div",Bqe,[m.createElementVNode("p",{innerHTML:m.unref(r)(m.unref(d).content||"")},null,8,Iqe)])])],64)):m.createCommentVNode("",!0)])],2)):m.createCommentVNode("",!0)}},[["__scopeId","data-v-67a04885"]]),Xqe={class:"chat-bot-box"},jqe={class:"chat-bot-sidebar-menu"},Fqe={class:"chat-bot-sidebar-menu-item"},Gqe=["src"],hie=Zt({__name:"ChatBot",setup(e){const t=m.ref(null),{animationState:n,sidebarHeight:r,sidebarStyle:a,iframeStyle:o,buttonAnimationClass:i,resizeHandleClass:s,toggleMainPanel:c,toggleIframe:u,startDragAnimation:l,endDragAnimation:d,updateIframeWidth:f}=Dqe(),{createDragHandler:p}=Pqe(),b=p({startDragAnimation:l,endDragAnimation:d,updateIframeWidth:f,animationState:n}),h=()=>{c(),setTimeout(()=>u(),300)},g=()=>v("newConversation"),y=()=>{n.menuVisible=!n.menuVisible,v("saasMenu",{visible:n.menuVisible})},v=(T,x={})=>{const N=document.querySelector("iframe");if(N)try{N.contentWindow.postMessage({type:T,...x},"*")}catch(D){console.warn(`发送${T}消息到iframe失败:`,D)}},A=window.location.hostname.includes("localhost"),O=`?sdkey=${localStorage.getItem("accessToken")}&sysFlag=2&tenantId=${localStorage.getItem("tenantId")}&from=saas`,E=()=>{var T,x;if((T=t.value)!=null&&T.pickerState.isActive){t.value.stopPicker();return}(x=t.value)==null||x.startPicker()};return m.onUnmounted(()=>{var T;n.isDragging=!1,n.menuVisible=!1,(T=t.value)==null||T.cleanup();try{window.removeEventListener("message")}catch(x){console.warn("移除message事件监听器失败:",x)}}),m.onMounted(()=>{window.addEventListener("message",T=>{T.data.type==="closeSaasMenu"&&y()})}),(T,x)=>{var D,P;const N=m.resolveComponent("a-tooltip");return m.openBlock(),m.createElementBlock("div",Xqe,[m.createVNode(kqe,{ref_key:"elementPickerHintRef",ref:t},null,512),m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-btn",m.unref(i)]),onClick:h},x[2]||(x[2]=[m.createElementVNode("img",{src:Oqe,alt:""},null,-1)]),2),m.createElementVNode("div",{class:"chat-bot-sidebar",style:m.normalizeStyle(m.unref(a))},[m.createElementVNode("div",{class:"chat-bot-sidebar-header",onClick:x[0]||(x[0]=(...S)=>m.unref(u)&&m.unref(u)(...S))},x[3]||(x[3]=[m.createElementVNode("img",{src:xqe,alt:""},null,-1)])),m.createElementVNode("div",jqe,[m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-sidebar-menu-item",{"chat-bot-sidebar-menu-item-active":m.unref(n).menuVisible}])},[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>x[4]||(x[4]=[m.createTextVNode("历史对话")])),default:m.withCtx(()=>[m.createElementVNode("img",{onClick:y,src:Eqe,alt:""})]),_:1})],2),m.createElementVNode("div",Fqe,[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>x[5]||(x[5]=[m.createTextVNode("新的对话")])),default:m.withCtx(()=>[m.createElementVNode("img",{onClick:g,src:Tqe,alt:""})]),_:1})]),m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-sidebar-menu-item",{"chat-bot-sidebar-menu-item-active":(P=(D=t.value)==null?void 0:D.pickerState)==null?void 0:P.isActive}])},[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>{var S,R;return[m.createTextVNode(m.toDisplayString((R=(S=t.value)==null?void 0:S.pickerState)!=null&&R.isActive?"退出选择模式":"鼐思图析"),1)]}),default:m.withCtx(()=>{var S,R;return[m.createElementVNode("img",{onClick:E,src:Nqe,alt:"",style:m.normalizeStyle({filter:(R=(S=t.value)==null?void 0:S.pickerState)!=null&&R.isActive?"brightness(1.2) saturate(1.3)":""})},null,4)]}),_:1})],2)])],4),m.unref(n).isOpenShowIframe?(m.openBlock(),m.createElementBlock("div",{key:0,class:"chat-bot-iframe",style:m.normalizeStyle(m.unref(o))},[m.createElementVNode("div",{class:m.normalizeClass(["resize-handle",m.unref(s)]),onMousedown:x[1]||(x[1]=(...S)=>m.unref(b)&&m.unref(b)(...S))},x[6]||(x[6]=[m.createElementVNode("div",{class:"resize-line"},null,-1)]),34),m.createElementVNode("iframe",{src:`${m.unref(A)?"http://localhost:81":""}/nsibot-ai/?${O}`,frameborder:"0"},null,8,Gqe)],4)):m.createCommentVNode("",!0)])}}},[["__scopeId","data-v-e3b5ff32"]]),Zqe=e=>{const t=[];let n;const r=e.length;for(let a=0;a<r;a++)n=e.charCodeAt(a),n>=65536&&n<=1114111?(t.push(n>>18&7|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(n&63|128)):n>=2048&&n<=65535?(t.push(n>>12&15|224),t.push(n>>6&63|128),t.push(n&63|128)):n>=128&&n<=2047?(t.push(n>>6&31|192),t.push(n&63|128)):t.push(n&255);return t},Yqe=e=>{let t="";const n=new Uint8Array(e),r=n.byteLength;for(let a=0;a<r;a++)t+=String.fromCharCode(n[a]);return window.btoa(t)},Wqe=e=>{const t=Zqe(e),n=Yqe(t);return encodeURIComponent(n)},Vqe=e=>{const{url:t,type:n,isOpenDirectly:r=!0}=e,{origin:a}=location;if(t instanceof Array&&!n)throw new Error("仅图片支持多文件预览");let o="";const i=s=>Wqe(s);if(n){let s="";t instanceof Array?s=t.join("|"):s=t,o=a+`/preview/picturesPreview?urls=${i(a+s)}`}else o=a+`/preview/onlinePreview?url=${i(a+t)}`;if(r)window.open(o);else return o},yie={ApiSelect:AR,BaseUpload:Qg,UploadImage:Pte,UploadFile:Dte,DetailItem:Bte,DetailRow:Ite,EmployeeStatus:AS,SexStatus:Xte,PositionStatus:kte,BaseUserSelect:Fte,SelectUserDialog:xS,UserTag:cO,SandEditor:xte,SelectAddress:Tte,EnterpriseSearch:BB,ChangeRecord:Lte,FollowUpRecord:Hte,UserCard:OS,BtnAi:mie,ChatBot:hie,AITextarea:Rte,AIInput:Mte,UploadImage2:Ste,UploadFile2:zte},qqe={install:e=>{Object.entries(yie).forEach(([t,n])=>{e.component(t,n)})}},Uqe=e=>bde(e);yt.AIInput=Mte,yt.AITextarea=Rte,yt.ApiSelect=AR,yt.BaseUpload=Qg,yt.BaseUserSelect=Fte,yt.BtnAi=mie,yt.ChangeRecord=Lte,yt.ChatBot=hie,yt.DeptTree=jte,yt.DetailItem=Bte,yt.DetailRow=Ite,yt.EmployeeStatus=AS,yt.EnterpriseSearch=BB,yt.FollowUpRecord=Hte,yt.PositionStatus=kte,yt.SandEditor=xte,yt.SelectAddress=Tte,yt.SelectUserDialog=xS,yt.SexStatus=Xte,yt.TreeOrg=LXe,yt.UploadFile=Dte,yt.UploadFile2=zte,yt.UploadImage=Pte,yt.UploadImage2=Ste,yt.UserCard=OS,yt.UserTag=cO,yt.components=yie,yt.default=qqe,yt.filePreview=Vqe,yt.sandInit=Uqe,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
380
+ `},T=()=>{A.overlay&&(A.overlay.style.display="none")},x=W=>{if(!A.isActive)return;const q=W.target;if(q.closest("#element-picker-overlay")||q.closest(".chat-bot-box")||q.closest(".ant-tooltip")||q.closest(".element-picker-hint")||q===document.body||q===document.documentElement||q.tagName==="SCRIPT"||q.tagName==="STYLE"||q.tagName==="LINK"||q.tagName==="META"){T();return}const z=q.getBoundingClientRect();if(z.width<3||z.height<3){T();return}if(z.bottom<0||z.top>window.innerHeight||z.right<0||z.left>window.innerWidth){T();return}A.currentElement=q,E(q)},N=async W=>{if(!A.isActive)return;W.preventDefault(),W.stopPropagation();const q=W.target;if(q.closest("#element-picker-overlay")||q.closest(".chat-bot-box")||q.closest(".ant-tooltip")||q.closest(".element-picker-hint")||q===document.body||q===document.documentElement||q.tagName==="SCRIPT"||q.tagName==="STYLE"||q.tagName==="LINK"||q.tagName==="META")return;const z=q.getBoundingClientRect();if(z.width<3||z.height<3)return;A.selectedElement=q;const C=D(q);M(),A.isLoading=!0,console.log("选中的元素:",q),console.log("元素信息:",C);const{minimalHtml:L,formHtml:B,structure:Q,formData:V,selectorInfo:oe}=Cqe(q);u(),await s({url:Ake(),data:{content:B},onComplete:()=>{console.log("完成")}})},D=W=>{var C;const q=W.getBoundingClientRect(),z=window.getComputedStyle(W);return{tagName:W.tagName.toLowerCase(),className:W.className,id:W.id,textContent:((C=W.textContent)==null?void 0:C.trim().substring(0,100))||"",attributes:Array.from(W.attributes).reduce((L,B)=>(L[B.name]=B.value,L),{}),dimensions:{width:q.width,height:q.height,left:q.left,top:q.top},styles:{backgroundColor:z.backgroundColor,color:z.color,fontSize:z.fontSize,fontFamily:z.fontFamily,display:z.display,position:z.position},xpath:P(W),cssSelector:S(W)}},P=W=>{if(W.id)return`//*[@id="${W.id}"]`;const q=[];for(;W&&W.nodeType===Node.ELEMENT_NODE;){let z=0,C=!1,L=W.previousSibling;for(;L;)L.nodeType===Node.ELEMENT_NODE&&L.nodeName===W.nodeName&&z++,L=L.previousSibling;for(L=W.nextSibling;L;){if(L.nodeType===Node.ELEMENT_NODE&&L.nodeName===W.nodeName){C=!0;break}L=L.nextSibling}const B=z||C?`[${z+1}]`:"";q.unshift(W.nodeName.toLowerCase()+B),W=W.parentNode}return q.length?"/"+q.join("/"):""},S=W=>{if(W.id)return`#${W.id}`;const q=[];for(;W&&W.nodeType===Node.ELEMENT_NODE;){let z=W.nodeName.toLowerCase();W.className&&(z+="."+W.className.split(" ").join(".")),q.unshift(z),W=W.parentNode}return q.join(" > ")},R=W=>{W.key==="Escape"&&A.isActive&&M()},H=()=>{!A.isActive||!A.currentElement||E(A.currentElement)},F=W=>{A.isActive=!0,A.currentElement=null,A.selectedElement=null,O(),document.addEventListener("mousemove",x,!0),document.addEventListener("click",N,!0),document.addEventListener("keydown",R,!0),document.addEventListener("scroll",H,!0),document.body.style.cursor="crosshair"},M=()=>{A.isActive=!1,A.currentElement=null,A.isLoading=!1,document.removeEventListener("mousemove",x,!0),document.removeEventListener("click",N,!0),document.removeEventListener("keydown",R,!0),document.removeEventListener("scroll",H,!0),document.body.style.cursor="",T()};return{pickerState:A,startPicker:F,stopPicker:M,cleanup:()=>{M(),A.overlay&&(document.body.removeChild(A.overlay),A.overlay=null)},showDialog:()=>{},hideDialog:()=>{A.showDialog=!1,A.isLoading=!1}}}const{pickerState:d,startPicker:f,stopPicker:p,cleanup:b,showDialog:h,hideDialog:g}=l(),y=()=>{p()},v=()=>{g()};return t({pickerState:d,startPicker:f,stopPicker:p,cleanup:b,showDialog:h,hideDialog:g}),m.watch(o,A=>{d.content=A,A&&d.isLoading&&(d.isLoading=!1,d.showDialog=!0)}),(A,O)=>m.unref(d).isActive||m.unref(d).showDialog||m.unref(d).isLoading?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["element-picker-hint",{"dialog-mode":m.unref(d).showDialog,"loading-mode":m.unref(d).isLoading}])},[m.createElementVNode("div",Lqe,[m.unref(d).isActive&&!m.unref(d).showDialog&&!m.unref(d).isLoading?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[O[0]||(O[0]=m.createElementVNode("div",{class:"hint-icon"},"🎯",-1)),O[1]||(O[1]=m.createElementVNode("div",{class:"hint-text"},[m.createElementVNode("div",{class:"hint-title"},"元素选择模式已启动"),m.createElementVNode("div",{class:"hint-description"}," 移动鼠标选择页面元素,点击确认选择,按ESC键退出 ")],-1)),m.createElementVNode("div",{class:"hint-close",onClick:y},"✕")],64)):m.createCommentVNode("",!0),m.unref(d).isLoading?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[O[2]||(O[2]=m.createStaticVNode('<div class="loading-icon" data-v-67a04885><div class="spinner" data-v-67a04885></div></div><div class="loading-text" data-v-67a04885><div class="loading-title" data-v-67a04885>正在分析元素</div><div class="loading-description" data-v-67a04885> 上传图片并进行AI分析中,请稍候... </div></div>',2))],64)):m.createCommentVNode("",!0),m.unref(d).showDialog?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createElementVNode("div",{class:"dialog-header"},[m.createElementVNode("div",{class:"dialog-close",onClick:v},"✕")]),m.createElementVNode("div",Hqe,[m.createElementVNode("div",Bqe,[m.createElementVNode("p",{innerHTML:m.unref(r)(m.unref(d).content||"")},null,8,Iqe)])])],64)):m.createCommentVNode("",!0)])],2)):m.createCommentVNode("",!0)}},[["__scopeId","data-v-67a04885"]]),Xqe={class:"chat-bot-box"},jqe={class:"chat-bot-sidebar-menu"},Fqe={class:"chat-bot-sidebar-menu-item"},Gqe=["src"],hie=Zt({__name:"ChatBot",setup(e){const t=m.ref(null),{animationState:n,sidebarHeight:r,sidebarStyle:a,iframeStyle:o,buttonAnimationClass:i,resizeHandleClass:s,toggleMainPanel:c,toggleIframe:u,startDragAnimation:l,endDragAnimation:d,updateIframeWidth:f}=Dqe(),{createDragHandler:p}=Pqe(),b=p({startDragAnimation:l,endDragAnimation:d,updateIframeWidth:f,animationState:n}),h=()=>{c(),setTimeout(()=>u(),300)},g=()=>v("newConversation"),y=()=>{n.menuVisible=!n.menuVisible,v("saasMenu",{visible:n.menuVisible})},v=(T,x={})=>{const N=document.querySelector("iframe");if(N)try{N.contentWindow.postMessage({type:T,...x},"*")}catch(D){console.warn(`发送${T}消息到iframe失败:`,D)}},A=window.location.hostname.includes("localhost"),O=`?sdkey=${localStorage.getItem("accessToken")}&sysFlag=2&tenantId=${localStorage.getItem("tenantId")}&from=saas`,E=()=>{var T,x;if((T=t.value)!=null&&T.pickerState.isActive){t.value.stopPicker();return}(x=t.value)==null||x.startPicker()};return m.onUnmounted(()=>{var T;n.isDragging=!1,n.menuVisible=!1,(T=t.value)==null||T.cleanup();try{window.removeEventListener("message")}catch(x){console.warn("移除message事件监听器失败:",x)}}),m.onMounted(()=>{window.addEventListener("message",T=>{T.data.type==="closeSaasMenu"&&y()})}),(T,x)=>{var D,P;const N=m.resolveComponent("a-tooltip");return m.openBlock(),m.createElementBlock("div",Xqe,[m.createVNode(kqe,{ref_key:"elementPickerHintRef",ref:t},null,512),m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-btn",m.unref(i)]),onClick:h},x[2]||(x[2]=[m.createElementVNode("img",{src:Oqe,alt:""},null,-1)]),2),m.createElementVNode("div",{class:"chat-bot-sidebar",style:m.normalizeStyle(m.unref(a))},[m.createElementVNode("div",{class:"chat-bot-sidebar-header",onClick:x[0]||(x[0]=(...S)=>m.unref(u)&&m.unref(u)(...S))},x[3]||(x[3]=[m.createElementVNode("img",{src:xqe,alt:""},null,-1)])),m.createElementVNode("div",jqe,[m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-sidebar-menu-item",{"chat-bot-sidebar-menu-item-active":m.unref(n).menuVisible}])},[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>x[4]||(x[4]=[m.createTextVNode("历史对话")])),default:m.withCtx(()=>[m.createElementVNode("img",{onClick:y,src:Eqe,alt:""})]),_:1})],2),m.createElementVNode("div",Fqe,[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>x[5]||(x[5]=[m.createTextVNode("新的对话")])),default:m.withCtx(()=>[m.createElementVNode("img",{onClick:g,src:Tqe,alt:""})]),_:1})]),m.createElementVNode("div",{class:m.normalizeClass(["chat-bot-sidebar-menu-item",{"chat-bot-sidebar-menu-item-active":(P=(D=t.value)==null?void 0:D.pickerState)==null?void 0:P.isActive}])},[m.createVNode(N,{placement:"left"},{title:m.withCtx(()=>{var S,R;return[m.createTextVNode(m.toDisplayString((R=(S=t.value)==null?void 0:S.pickerState)!=null&&R.isActive?"退出选择模式":"鼐思图析"),1)]}),default:m.withCtx(()=>{var S,R;return[m.createElementVNode("img",{onClick:E,src:Nqe,alt:"",style:m.normalizeStyle({filter:(R=(S=t.value)==null?void 0:S.pickerState)!=null&&R.isActive?"brightness(1.2) saturate(1.3)":""})},null,4)]}),_:1})],2)])],4),m.unref(n).isOpenShowIframe?(m.openBlock(),m.createElementBlock("div",{key:0,class:"chat-bot-iframe",style:m.normalizeStyle(m.unref(o))},[m.createElementVNode("div",{class:m.normalizeClass(["resize-handle",m.unref(s)]),onMousedown:x[1]||(x[1]=(...S)=>m.unref(b)&&m.unref(b)(...S))},x[6]||(x[6]=[m.createElementVNode("div",{class:"resize-line"},null,-1)]),34),m.createElementVNode("iframe",{src:`${m.unref(A)?"http://localhost:81":""}/nsibot-ai/?${O}`,frameborder:"0"},null,8,Gqe)],4)):m.createCommentVNode("",!0)])}}},[["__scopeId","data-v-e3b5ff32"]]),Zqe=e=>{const t=[];let n;const r=e.length;for(let a=0;a<r;a++)n=e.charCodeAt(a),n>=65536&&n<=1114111?(t.push(n>>18&7|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(n&63|128)):n>=2048&&n<=65535?(t.push(n>>12&15|224),t.push(n>>6&63|128),t.push(n&63|128)):n>=128&&n<=2047?(t.push(n>>6&31|192),t.push(n&63|128)):t.push(n&255);return t},Yqe=e=>{let t="";const n=new Uint8Array(e),r=n.byteLength;for(let a=0;a<r;a++)t+=String.fromCharCode(n[a]);return window.btoa(t)},Wqe=e=>{const t=Zqe(e),n=Yqe(t);return encodeURIComponent(n)},Vqe=e=>{const{url:t,type:n,isOpenDirectly:r=!0,watermark:a}=e,{origin:o}=location;if(t instanceof Array&&!n)throw new Error("仅图片支持多文件预览");let i="";const s=c=>Wqe(c);if(n){let c="";t instanceof Array?c=t.join("|"):c=t,i=o+`/preview/picturesPreview?urls=${s(o+c)}`}else i=o+`/preview/onlinePreview?url=${s(o+t)}`;if(a&&(i+=`&watermarkTxt=${a}`),r)window.open(i);else return i},yie={ApiSelect:AR,BaseUpload:Qg,UploadImage:Pte,UploadFile:Dte,DetailItem:Bte,DetailRow:Ite,EmployeeStatus:AS,SexStatus:Xte,PositionStatus:kte,BaseUserSelect:Fte,SelectUserDialog:xS,UserTag:cO,SandEditor:xte,SelectAddress:Tte,EnterpriseSearch:BB,ChangeRecord:Lte,FollowUpRecord:Hte,UserCard:OS,BtnAi:mie,ChatBot:hie,AITextarea:Rte,AIInput:Mte,UploadImage2:Ste,UploadFile2:zte},qqe={install:e=>{Object.entries(yie).forEach(([t,n])=>{e.component(t,n)})}},Uqe=e=>bde(e);yt.AIInput=Mte,yt.AITextarea=Rte,yt.ApiSelect=AR,yt.BaseUpload=Qg,yt.BaseUserSelect=Fte,yt.BtnAi=mie,yt.ChangeRecord=Lte,yt.ChatBot=hie,yt.DeptTree=jte,yt.DetailItem=Bte,yt.DetailRow=Ite,yt.EmployeeStatus=AS,yt.EnterpriseSearch=BB,yt.FollowUpRecord=Hte,yt.PositionStatus=kte,yt.SandEditor=xte,yt.SelectAddress=Tte,yt.SelectUserDialog=xS,yt.SexStatus=Xte,yt.TreeOrg=LXe,yt.UploadFile=Dte,yt.UploadFile2=zte,yt.UploadImage=Pte,yt.UploadImage2=Ste,yt.UserCard=OS,yt.UserTag=cO,yt.components=yie,yt.default=qqe,yt.filePreview=Vqe,yt.sandInit=Uqe,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});