import{l as r}from"./index-DfiDB3im.chunk.mjs";import{_ as n}from"./index-y0wjO9Xi.chunk.mjs";import{l as s}from"./logger-Bvti-6nU.chunk.mjs";const A=function(o,e){const t=o.attrs.href;if(!t||!window.OCA?.Viewer||t.match(/^[a-zA-Z]*:/)||t.startsWith("#")||r("core","active-app","")==="collectives"||t.includes("/apps/collectives/"))return t;const i=t.match(/^([^?]*)\?fileId=(\d+)/);if(i){const[,,a]=i;return new URL(n(`/f/${a}`),window.origin).href}return t},R=function(o){const e=o.getAttribute("href");if(!e)return e;const t=e.match(/\?dir=([^&]*)&openfile=([^&]*)#relPath=([^&]*)/);if(t){const[,,i]=t;return new URL(n(`/f/${i}`),window.origin).href}return e},C=function(o){const e=window.location.origin+window.location.pathname+window.location.search;return o?.startsWith("#")||o?.startsWith(e+"#")},l=function(o){const e=new URL(o,window.location.href),t="/apps/collectives";if(window.OCA.Collectives?.vueRouter&&e.pathname.toString().startsWith(n(t))){const i=e.href.substring(e.href.indexOf(t)+t.length);window.OCA.Collectives.vueRouter.push(i);return}window.open(e,"_blank")},c=Symbol("tiptap:editor"),d=Symbol("editor:file"),m=Symbol("attachment:resolver"),f=Symbol("editor:is-mobile"),u=Symbol("editor:is-public"),h=Symbol("editor:is-rich-editor"),p=Symbol("editor:is-rich-woskapace"),w=Symbol("sync:service"),b=Symbol("editor:upload"),L=Symbol("hook:mention-search"),O=Symbol("hook:mention-insert"),S=Symbol("editor:open-link-handler"),U={inject:{$editor:{from:c,default:null}}},W={inject:{$syncService:{from:w,default:null}}},x={inject:{$isPublic:{from:u,default:!1}}},P={inject:{$isRichWorkspace:{from:p,default:!1}}},I={inject:{$isRichEditor:{from:h,default:!1}}},E={inject:{$isMobile:{from:f,default:!1}}},H={inject:{$file:{from:d,default:()=>({fileId:0,relativePath:null,document:null})}}},_={inject:{$attachmentResolver:{from:m,default:{resolve(o){return s.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[o]}}}}},M={inject:{$editorUpload:{from:b,default:!0}}},N={inject:{$openLinkHandler:{from:S,default:{openLink:l}}}},v=Symbol("state:uploading-state"),y=Symbol("editor:action:attachment-prompt"),$=Symbol("editor:action:upload-attachment"),q={inject:{$uploadingState:{from:v,default:{isUploadingAttachments:!1}}}},z={inject:{$callAttachmentPrompt:{from:y,default:()=>{}}}},D={inject:{$callChooseLocalAttachment:{from:$,default:()=>{}}}};export{y as A,b as E,d as F,L as H,h as I,S as O,v as S,O as a,m as b,c,E as d,U as e,I as f,P as g,H as h,$ as i,M as j,x as k,w as l,u as m,p as n,l as o,f as p,z as q,q as r,D as s,_ as t,W as u,N as v,A as w,C as x,R as y};
//# sourceMappingURL=MediaHandler.provider-_u2LRYyP.chunk.mjs.map
