var K=Object.defineProperty;var G=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var j=(r,n,t)=>n in r?K(r,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[n]=t,S=(r,n)=>{for(var t in n||(n={}))X.call(n,t)&&j(r,t,n[t]);if(G)for(var t of G(n))Y.call(n,t)&&j(r,t,n[t]);return r};var N=(r,n,t)=>new Promise((h,E)=>{var m=c=>{try{f(t.next(c))}catch(v){E(v)}},R=c=>{try{f(t.throw(c))}catch(v){E(v)}},f=c=>c.done?h(c.value):Promise.resolve(c.value).then(m,R);f((t=t.apply(r,n)).next())});import{d as Z,h as T,a1 as V,y as ee,b3 as te,V as oe,r as _,o as C,c as $,b as s,w as e,F as D,p as se,A as z,B as ne,m as ae,t as b,e as w,u as F,aH as re,a4 as le,Q as k,I as ie,b4 as ce,ae as ue,af as I,aE as L,J as pe,f as de}from"./index-7f9b3dc0.js";import{u as _e}from"./index-e0156180.js";import{u as me,P as U}from"./chartEditStore-a7c7155c.js";import{s as fe}from"./useSyncUpdate.hook-4faaed6a.js";import{a as ve}from"./project.api-ce920c4d.js";import{i as ye}from"./icon-24c63d72.js";import{l as we}from"./index-1a7a69bd.js";import"./plugin-7a76ddd3.js";import"./useSync.hook-b7bb3a07.js";import"./chartLayoutStore-02530a25.js";import"./SettingItem-8cd8dfcb.js";/* empty css */import"./SettingItemBox-8561e243.js";import"./CollapseItem.vue_vue_type_script_setup_true_lang-923be82d.js";import"./index.esm.min-6233459c.js";import"./fileTypeEnum-21359a08.js";const Ee=Z({__name:"index",setup(r){const{BrowsersOutlineIcon:n,SendIcon:t,AnalyticsIcon:h,CloseIcon:E}=ye.ionicons5,m=me(),R=T(V()),{copy:f,isSupported:c}=_e({source:R}),v=ee(),y=T(!1),u=T(!1);te(()=>{u.value=m.getProjectInfo.release||!1});const x=()=>{y.value=!1},J=()=>{const a=ie(ce.CHART_PREVIEW_NAME,"href");if(!a)return;const{id:o}=v.params,l=typeof o=="string"?o:o[0],p=m.getStorageInfo(),i=ue(I.GO_CHART_STORAGE_LIST)||[];if(i!=null&&i.length){const g=i.findIndex(P=>P.id===l);g!==-1?(i.splice(g,1,S({id:l},p)),L(I.GO_CHART_STORAGE_LIST,i)):(i.push(S({id:l},p)),L(I.GO_CHART_STORAGE_LIST,i))}else L(I.GO_CHART_STORAGE_LIST,[S({id:l},p)]);pe(a,[l],void 0,!0)},A=()=>{y.value=!y.value},H=(a,o)=>{c?(f(),window.$message.success(a||"复制成功!")):window.$message.error(o||"复制失败!")},M=()=>N(this,null,function*(){const a=yield ve({id:re(),state:u.value?-1:1});a&&a.code===le.SUCCESS?(A(),u.value?window.$message.success("已取消发布"):H("发布成功!已复制地址到剪贴板~","发布成功!"),m.setProjectInfo(U.RELEASE,!u.value)):window.$message.success("已取消发布"),m.setProjectInfo(U.RELEASE,!u.value)}),B=[{select:!0,title:()=>"同步内容",type:()=>"primary",icon:k(h),event:fe},{key:"preview",title:()=>"预览",type:()=>"default",icon:k(n),event:J},{key:"release",title:()=>u.value?"已发布":"发布",icon:k(t),type:()=>u.value?"primary":"default",event:A}],Q=oe(()=>{if(m.getEditCanvas.isCodeEdit)return B;const a=we.cloneDeep(B);return a.shift(),a});return(a,o)=>{const l=_("n-button"),p=_("n-space"),i=_("n-h3"),g=_("n-icon"),P=_("n-alert"),O=_("n-list-item"),W=_("n-list"),q=_("n-modal");return C(),$(D,null,[s(p,{class:"go-mt-0"},{default:e(()=>[(C(!0),$(D,null,se(Q.value,d=>(C(),z(l,{key:d.key,type:d.type(),ghost:"",onClick:d.event},{icon:e(()=>[(C(),z(ne(d.icon)))]),default:e(()=>[ae("span",null,b(d.title()),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}),s(q,{show:y.value,"onUpdate:show":o[1]||(o[1]=d=>y.value=d),onAfterLeave:x},{default:e(()=>[s(W,{bordered:"",class:"go-system-setting"},{header:e(()=>[s(p,{justify:"space-between"},{default:e(()=>[s(i,{class:"go-mb-0"},{default:e(()=>o[2]||(o[2]=[w("发布管理")])),_:1}),s(g,{size:"20",class:"go-cursor-pointer",onClick:x},{default:e(()=>[s(F(E))]),_:1})]),_:1})]),default:e(()=>[s(O,null,{default:e(()=>[s(p,{size:10},{default:e(()=>[s(P,{"show-icon":!1,title:"预览地址:",type:"success"},{default:e(()=>[w(b(F(V)()),1)]),_:1}),s(p,{vertical:""},{default:e(()=>[s(l,{tertiary:"",type:"primary",onClick:o[0]||(o[0]=d=>H())},{default:e(()=>o[3]||(o[3]=[w(" 复制地址 ")])),_:1}),s(l,{type:u.value?"warning":"primary",onClick:M},{default:e(()=>[w(b(u.value?"取消发布":"发布大屏"),1)]),_:1},8,["type"])]),_:1})]),_:1})]),_:1}),s(O,null,{default:e(()=>[s(p,{size:10},{default:e(()=>[s(l,{onClick:A},{default:e(()=>o[4]||(o[4]=[w("关闭弹窗")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["show"])],64)}}});const je=de(Ee,[["__scopeId","data-v-921cebb1"]]);export{je as default};