import{_ as w}from"./AbstraButton.vue_vue_type_script_setup_true_lang-BBMaXQJu.js";import{e as h,W as I,r as o,n as A,J as m,q as x,g as r,x as g,v as c,f as p,s as a,K as t,as as P,X as S,j as z,b1 as D,T as C,U as E,ar as O}from"./jwt-decode.esm-CX61wVx3.js";import"./router-C3xfRTQ9.js";import{M as B,i as F}from"./member-Mqwx3LJ6.js";import{a as M}from"./organization-CGHGUCUV.js";import"./tables-uXC0iev6.js";import{O as N,a as T}from"./OrgPageHeader-DG2Sq4jL.js";import"./LoadingOutlined-CVkBHrpy.js";import"./ts.worker-DBbJtN2A.js";import"./string-BfaOmKtt.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new Error().stack;d&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[d]="54ce2781-8f99-4ea9-9fca-5140711bcbb1",s._sentryDebugIdIdentifier="sentry-dbid-54ce2781-8f99-4ea9-9fca-5140711bcbb1")}catch{}})();const V={key:0,class:"loading-container"},$={key:0,class:"ai-skills-footer"},R=h({__name:"AiSkills",setup(s){const l=I().params.organizationId,_=new M,b=new B,v=o(!0),u=o(!1),i=o(""),f=o(!1);A(async()=>{try{const[e,n]=await Promise.all([_.listSkills(l),b.me(l).catch(()=>null)]);e.length>0&&(i.value=e[0].content),f.value=F(n)}catch(e){m.error(e instanceof Error?e.message:"Failed to load skill")}finally{v.value=!1}});async function k(){u.value=!0;try{await _.upsertSkill(l,{content:i.value}),m.success(t.translate("i18n_aiskills_saved"))}catch(e){m.error(e instanceof Error?e.message:"Failed to save")}finally{u.value=!1}}return(e,n)=>(r(),x(T,null,{default:g(()=>[c(N,{title:a(t).translate("i18n_aiskills_title"),subtitle:a(t).translate("i18n_aiskills_subtitle")},null,8,["title","subtitle"]),v.value?(r(),p("div",V,[c(a(P),{size:"large"})])):(r(),p(S,{key:1},[c(a(D),{value:i.value,"onUpdate:value":n[0]||(n[0]=y=>i.value=y),placeholder:a(t).translate("i18n_aiskills_placeholder"),"auto-size":{minRows:20},disabled:!f.value,class:"ai-skills-editor"},null,8,["value","placeholder","disabled"]),f.value?(r(),p("div",$,[c(w,{type:"primary",loading:u.value,onClick:k},{default:g(()=>[C(E(a(t).translate("i18n_aiskills_save")),1)]),_:1},8,["loading"])])):z("",!0)],64))]),_:1}))}}),Q=O(R,[["__scopeId","data-v-c355984b"]]);export{Q as default};
//# sourceMappingURL=AiSkills-Co5SOOtA.js.map
