1import{_ as M,b as G,c as R,e as K}from"./BsR9itgK.js";import{c as L,b as Q,f as Y}from"./PnHXRdXq.js";import{_ as H}from"./BjiLse1n.js";import{_ as J}from"./PAUADqLi.js";import{_ as P}from"./C-4xKkNk.js";import{u as W}from"./VQzQmOLA.js";import{u as X}from"./COePPooe.js";import{g as z}from"./C3vaz5Bu.js";import{I as k,Q as B,aj as U,ak as o,al as c,aa as s,az as Z,Y as l,aC as d,ap as _,aq as i,a3 as a,an as w,a9 as ee,aB as te,K as oe}from"./Csg0bbzG.js";const ne={class:"flex h-full min-h-0 flex-col"},se={class:"flex shrink-0 items-center justify-between gap-3 border-b px-4 py-3 sm:px-6"},ae={class:"min-w-0 text-base font-semibold text-foreground sm:text-lg"},le={key:0,class:"ml-1 font-normal text-muted-foreground"},ie={class:"flex shrink-0 items-center gap-1.5 sm:gap-2"},ce={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6"},re={key:0,class:"mb-3 text-lg font-semibold text-foreground"},de={key:1,class:"whitespace-pre-wrap break-words text-foreground"},ue={key:0},me={key:1,class:"m-0 whitespace-pre-wrap break-words font-sans"},fe={key:2},pe={key:0,class:"whitespace-pre-wrap break-words text-foreground"},_e={key:0},ge={key:1,class:"m-0 whitespace-pre-wrap break-words font-sans"},xe={key:1,class:"flex min-h-48 items-center justify-center py-8"},ve={class:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6"},ye={key:0,class:"flex flex-wrap items-center gap-2"},he={key:1},ke={key:2,class:"ml-auto flex items-center gap-2"},je={__name:"OrganismsModalNoteShow",props:{modelValue:{type:Boolean,required:!0},isGlobal:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showEditAction:{type:Boolean,default:!1},note:{type:Object,required:!0}},emits:["update:modelValue","edit","delete"],setup(t,{emit:T}){const{getTypeName:C}=X(),u=t,m=L(),{t:r}=Q(),b=k(!1),g=k(!1),x=k(""),v=k(!0),{unlockNote:V}=W(),j=T,S=B(()=>u.fullscreen?["!inset-0 !left-0 !top-0 !flex !h-dvh !max-h-dvh !w-screen !max-w-none","!translate-x-0 !translate-y-0 !scale-100 !gap-0 !rounded-none !p-0","flex-col overflow-hidden data-[state=open]:!zoom-in-100 data-[state=closed]:!zoom-out-100"].join(" "):["!flex !w-[min(92vw,56rem)] !max-w-[56rem] !max-h-[calc(100dvh-2rem)]","!gap-0 !p-0 flex-col overflow-hidden rounded-xl"].join(" ")),y=B({get:()=>u.modelValue,set:p=>j("update:modelValue",p)});function N(){y.value=!1}async function $(p){b.value=!0;try{const e=await V(u.note.uuid,p);e.data?(m.add({title:r("toast.unlockNoteSuccessTitle"),color:"success",icon:"i-tabler:login"}),g.value=!0,x.value=e.data.plain_data):m.add({title:r("toast.unlockNoteFailedTitle"),description:z(e.error),color:"error",icon:"i-tabler:login"})}catch(e){m.add({title:r("toast.unlockNoteFailedTitle"),description:z(e),color:"error",icon:"i-tabler:login"})}finally{b.value=!1}}function D(){u.note.content?(navigator.clipboard.writeText(u.note.content),m.add({title:r("global.table.copyContentSuccess"),color:"success",icon:"i-lucide-circle-check"})):u.note.is_sensitive&&!g.value?m.add({title:r("global.table.copyContentSensitive"),color:"warning",icon:"lucide:eye-off"}):u.note.is_sensitive&&g.value?(navigator.clipboard.writeText(x.value),m.add({title:r("global.table.copyContentSuccess"),color:"success",icon:"i-lucide-circle-check"})):m.add({title:r("global.table.copyContentNull"),color:"warning",icon:"lucide:file-warning"})}return(p,e)=>{const E=G,F=R,h=Y,f=H,O=J,q=P,A=M,I=K;return o(),U(I,{open:l(y),"onUpdate:open":e[5]||(e[5]=n=>oe(y)?y.value=n:null)},{default:c(()=>[s(A,{class:Z(l(S)),"show-close":!1},{default:c(()=>[s(E,{class:"sr-only"},{default:c(()=>[_(i(t.note.title||l(C)(t.note.type)),1)]),_:1}),s(F,{class:"sr-only"},{default:c(()=>[_(i(l(r)("global.table.content")),1)]),_:1}),d("div",ne,[d("header",se,[d("div",ae,[d("span",null,i(l(C)(t.note.type))+":",1),t.note.scheduled_at?(o(),a("span",le,i(t.note.scheduled_at),1)):w("",!0)]),d("div",ie,[s(f,{variant:"outline",size:"sm",onClick:e[0]||(e[0]=n=>v.value=!0)},{default:c(()=>[s(h,{name:"mdi-light:format-align-left",class:"size-4"}),e[6]||(e[6]=d("span",{class:"hidden sm:inline"},"plain",-1))]),_:1}),s(f,{variant:"outline",size:"sm",onClick:e[1]||(e[1]=n=>v.value=!1)},{default:c(()=>[s(h,{name:"mdi-light:format-align-center",class:"size-4"}),e[7]||(e[7]=d("span",{class:"hidden sm:inline"},"format",-1))]),_:1}),s(f,{variant:"outline",size:"sm",onClick:e[2]||(e[2]=n=>D())},{default:c(()=>[s(h,{name:"i-lucide-copy",class:"size-4"}),e[8]||(e[8]=d("span",{class:"hidden sm:inline"},"copy",-1))]),_:1}),s(f,{variant:"ghost",size:"icon",class:"ml-1",onClick:N},{default:c(()=>[s(h,{name:"lucide:x",class:"size-5"})]),_:1}
1)])]),d("div",ce,[t.note.title?(o(),a("h2",re,i(t.note.title),1)):w("",!0),t.note.is_sensitive?(o(),a("div",fe,[l(g)?(o(),a("div",pe,[l(v)?(o(),a("span",_e,i(l(x)),1)):(o(),a("pre",ge,i(l(x)),1))])):(o(),a("div",xe,[s(O,{loading:l(b),"is-global":t.isGlobal,onSecret:e[3]||(e[3]=n=>$(n))},null,8,["loading","is-global"])]))])):(o(),a("div",de,[l(v)?(o(),a("span",ue,i(t.note.content),1)):(o(),a("pre",me,i(t.note.content),1))]))]),d("footer",ve,[t.note.tags?.length?(o(),a("div",ye,[(o(!0),a(ee,null,te(t.note.tags,n=>(o(),U(q,{key:n.value??n.id??n.label??n.name,variant:"subtle"},{default:c(()=>[_(i(n.label??n.name),1)]),_:2},1024))),128))])):(o(),a("div",he)),t.showEditAction?(o(),a("div",ke,[s(f,{variant:"ghost",onClick:N},{default:c(()=>[_(i(l(r)("global.close")),1)]),_:1}),s(f,{onClick:e[4]||(e[4]=n=>p.$emit("edit",t.note.uuid))},{default:c(()=>[_(i(l(r)("global.edit")),1)]),_:1})])):w("",!0)])])]),_:1},8,["class"])]),_:1},8,["open"])}}};export{je as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.