import{l as r}from"./index-Dl858C8_.chunk.mjs";import{g as a}from"./index-DxwFe63_.chunk.mjs";import{l as s}from"./logger-CoS2pszN.chunk.mjs";const y=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 n=t.match(/^([^?]*)\?fileId=(\d+)/);if(n){const[,,i]=n;return new URL(a(`/f/${i}`),window.origin).href}return t},A=function(o){const e=o.getAttribute("href");if(!e)return e;const t=e.match(/\?dir=([^&]*)&openfile=([^&]*)#relPath=([^&]*)/);if(t){const[,,n]=t;return new URL(a(`/f/${n}`),window.origin).href}return e},$=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(a(t))){const n=e.href.substring(e.href.indexOf(t)+t.length);window.OCA.Collectives.vueRouter.push(n);return}window.open(e,"_blank")},c=Symbol("editor:file"),m=Symbol("attachment:resolver"),d=Symbol("editor:is-mobile"),f=Symbol("editor:upload"),j=Symbol("hook:mention-search"),C=Symbol("hook:mention-insert"),u=Symbol("editor:open-link-handler"),k={inject:{$isMobile:{from:d,default:!1}}},L={inject:{$file:{from:c,default:()=>({fileId:0,relativePath:null,document:null})}}},R={inject:{$attachmentResolver:{from:m,default:{resolve(o){return s.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[o]}}}}},O={inject:{$editorUpload:{from:f,default:!0}}},U={inject:{$openLinkHandler:{from:u,default:{openLink:l}}}},h=Symbol("state:uploading-state"),p=Symbol("editor:action:attachment-prompt"),w=Symbol("editor:action:upload-attachment"),b=Symbol("editor:action:create-attachment"),I={inject:{$uploadingState:{from:h,default:{isUploadingAttachments:!1}}}},W={inject:{$callAttachmentPrompt:{from:p,default:()=>{}}}},x={inject:{$callChooseLocalAttachment:{from:w,default:()=>{}}}},H={inject:{$callCreateAttachment:{from:b,default:()=>o=>{}}}};export{m as A,f as E,c as F,C as H,d as I,u as O,h as S,j as a,p as b,L as c,b as d,w as e,O as f,x as g,W as h,I as i,H as j,U as k,y as l,$ as m,R as n,l as o,A as p,k as u}; //# sourceMappingURL=MediaHandler.provider-CTjO6aKX.chunk.mjs.map