diff --git a/js/editor.js b/js/editor.js index 1b9ccef2c84..fd9a864126f 100644 --- a/js/editor.js +++ b/js/editor.js @@ -1,3 +1,3 @@ /*! For license information please see editor.js.LICENSE.txt */ -(self.webpackChunk_nextcloud_text=self.webpackChunk_nextcloud_text||[]).push([["editor"],{31728:(t,e,n)=>{"use strict";n.d(e,{$r:()=>k,BG:()=>b,C6:()=>A,Cy:()=>m,FQ:()=>a,HB:()=>o,IT:()=>d,OV:()=>p,QT:()=>v,Uw:()=>r,Zf:()=>x,a_:()=>y,cY:()=>l,eP:()=>w,fB:()=>C,q$:()=>s,rz:()=>f,sw:()=>u,vo:()=>c,wU:()=>h,ww:()=>_,zZ:()=>g});var i=n(52029);const r=Symbol("tiptap:editor"),o=Symbol("editor:file"),a=Symbol("attachment:resolver"),s=Symbol("editor:is-mobile"),l=Symbol("editor:is-public"),c=Symbol("editor:is-rich-editor"),d=Symbol("editor:is-rich-woskapace"),h=Symbol("sync:service"),A=Symbol("editor:upload"),p=Symbol("hook:link-click"),u=Symbol("hook:mention-search"),g=Symbol("hook:mention-insert"),m={inject:{$editor:{from:r,default:null}}},b={inject:{$syncService:{from:h,default:null}}},C={inject:{$isPublic:{from:l,default:!1}}},f={inject:{$isRichWorkspace:{from:d,default:!1}}},v={inject:{$isRichEditor:{from:c,default:!1}}},_={inject:{$isMobile:{from:s,default:!1}}},y={inject:{$file:{from:o,default:()=>({fileId:0,relativePath:null,document:null})}}},x={inject:{$attachmentResolver:{from:a,default:{resolve:t=>(i.k.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[t])}}}},w={inject:{$editorUpload:{from:A,default:!0}}},k={inject:{$linkHookClick:{from:p,default:null}}}},33528:(t,e,n)=>{"use strict";n.d(e,{TI:()=>s,eS:()=>o,gn:()=>r,kZ:()=>a,qj:()=>l,uT:()=>i});const i=Symbol("state:uploading-state"),r=Symbol("editor:action:attachment-prompt"),o=Symbol("editor:action:upload-attachment"),a={inject:{$uploadingState:{from:i,default:{isUploadingAttachments:!1}}}},s={inject:{$callAttachmentPrompt:{from:r,default:()=>{}}}},l={inject:{$callChooseLocalAttachment:{from:o,default:()=>{}}}}},28612:(t,e,n)=>{"use strict";n.d(e,{Ad:()=>a,Dr:()=>i,aM:()=>r,vV:()=>o});const i=Symbol("wrapper:outline-state"),r=Symbol("wrapper:outline-actions"),o={inject:{$outlineState:{from:i,default:{visible:!1,enable:!1}}}},a={inject:{$outlineActions:{from:r,default:{toggle:()=>{}}}}}},85724:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i=n(68418),r=n(70285);const o={name:"ActionEntry",functional:!0,render(t,e){const{actionEntry:n}=e.props,{data:o,props:a,listeners:s}=e,{key:l}=o,c={data:o,key:l,props:a,on:s};return n.component?t(n.component,c):n.children?t(r.Z,c):t(i.Z,c)}}},76115:(t,e,n)=>{"use strict";n.d(e,{b:()=>w});var i=n(15961),r=n(20296),o=n.n(r),a=n(31728),s=n(28612),l=n(72076),c=n(13815),d=n(93379),h=n.n(d),A=n(7795),p=n.n(A),u=n(90569),g=n.n(u),m=n(3565),b=n.n(m),C=n(19216),f=n.n(C),v=n(44589),_=n.n(v),y=n(97646),x={};x.styleTagTransform=_(),x.setAttributes=b(),x.insert=g().bind(null,"head"),x.domAPI=p(),x.insertStyleElement=f();h()(y.Z,x);y.Z&&y.Z.locals&&y.Z.locals;const w={directives:{Tooltip:i.u},mixins:[a.Cy,a.ww,c.Z,s.Ad,s.vV],props:{actionEntry:{type:Object,required:!0}},data(){return{state:(0,l.wr)(this.actionEntry,this.$editor)}},computed:{label(){const{label:t}=this.actionEntry;return"function"==typeof t?t(this):t},icon(){return this.actionEntry.icon},keyshortcuts(){return(0,l.FZ)(this.actionEntry)},tooltip(){return[this.label,(0,l.RR)(this.$isMobile,this.actionEntry)].join(" ")}},mounted(){this.$_updateState=o()(this.updateState.bind(this),50),this.$editor.on("update",this.$_updateState),this.$editor.on("selectionUpdate",this.$_updateState)},beforeDestroy(){this.$editor.off("update",this.$_updateState),this.$editor.off("selectionUpdate",this.$_updateState)},methods:{updateState(){this.state=(0,l.wr)(this.actionEntry,this.$editor)}}}},60948:(t,e,n)=>{"use strict";n.d(e,{V:()=>i,q:()=>r});const i=Symbol("menu::id"),r={inject:{$menuID:{from:i,default:null}},computed:{menuIDSelector(){return"#".concat(this.$menuID)}}}},82496:(e,n,i)=>{"use strict";i.d(n,{E:()=>O,Z:()=>R});var r=i(32318),o=i(76115),a=i(15961),s=i(60948);const l={name:"EmojiPickerAction",components:{NcEmojiPicker:a.Xo,NcButton:a.P2},extends:o.b,mixins:[s.q],methods:{addEmoji(t){let{id:e,native:n}=t;this.actionEntry.action(this.$editor.chain(),{id:e,native:n}).focus().run()}}};var c=i(51900);const d=(0,c.Z)(l,(function(){var t=this,e=t._self._c;return e("NcEmojiPicker",{staticClass:"entry-action entry-action__emoji",attrs:{"data-text-action-entry":t.actionEntry.key,container:t.menuIDSelector},on:{"select-data":t.addEmoji}},[e("NcButton",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.actionEntry.label,expression:"actionEntry.label"}],staticClass:"entry-action__button",attrs:{role:"menu",title:t.actionEntry.label,"aria-label":t.actionEntry.label,"aria-haspopup":!0},scopedSlots:t._u([{key:"icon",fn:function(){return[e(t.icon,{tag:"component"})]},proxy:!0}])})],1)}),[],!1,null,null,null).exports;var h=i(31728),A=i(33528);const p={name:"ActionAttachmentUpload",components:{NcActions:a.O3,NcActionButton:a.Js,Loading:r.gb,Folder:r.gt,Upload:r.gq},extends:o.b,mixins:[h.fB,h.eP,A.TI,A.kZ,A.qj,s.q],computed:{icon(){return this.isUploadingAttachments?r.gb:this.actionEntry.icon},isUploadingAttachments(){return this.$uploadingState.isUploadingAttachments}}};const u=(0,c.Z)(p,(function(){var t=this,e=t._self._c;return e("NcActions",{staticClass:"entry-action entry-action__image-upload",attrs:{"data-text-action-entry":t.actionEntry.key,name:t.actionEntry.label,"aria-label":t.actionEntry.label,container:t.menuIDSelector,role:"menu","aria-haspopup":""},scopedSlots:t._u([{key:"icon",fn:function(){return[e(t.icon,{tag:"component",attrs:{name:t.actionEntry.label,"aria-label":t.actionEntry.label,"aria-haspopup":""}})]},proxy:!0}])},[t._v(" "),t.$editorUpload?e("NcActionButton",{attrs:{"close-after-click":"",disabled:t.isUploadingAttachments,"data-text-action-entry":"".concat(t.actionEntry.key,"-upload")},on:{click:t.$callChooseLocalAttachment},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Upload")]},proxy:!0}],null,!1,933298848)},[t._v("\n\t\t"+t._s(t.t("text","Upload from computer"))+"\n\t")]):t._e(),t._v(" "),t.$isPublic?t._e():e("NcActionButton",{attrs:{"close-after-click":"",disabled:t.isUploadingAttachments,"data-text-action-entry":"".concat(t.actionEntry.key,"-insert")},on:{click:t.$callAttachmentPrompt},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Folder")]},proxy:!0}],null,!1,2750733237)},[t._v("\n\t\t"+t._s(t.t("text","Insert from Files"))+"\n\t")])],1)}),[],!1,null,null,null).exports;var g=i(86680),m=i(3255),b=i(73845),C=i(43573);const f={name:"ActionInsertLink",components:{NcActions:a.O3,NcActionButton:a.Js,NcActionInput:a.Iw,Document:r.BB,Loading:r.gb,LinkOff:r.pR,Web:r.ph,Shape:r.bn},extends:o.b,mixins:[h.a_,s.q],data:()=>({href:null,isInputMode:!1,startPath:null}),computed:{activeClass(){return this.state.active?"is-active":""},relativePath(){var t,e;return null!==(t=null===(e=this.$file)||void 0===e?void 0:e.relativePath)&&void 0!==t?t:"/"}},methods:{linkFile(){null===this.startPath&&(this.startPath=this.relativePath.split("/").slice(0,-1).join("/"));new m.GB(t("text","Select file or folder to link to"),!1,[],!0,m.K9.Choose,!0,this.startPath).pick().then((t=>{OC.Files.getClient().getFileInfo(t).then(((t,e)=>{const n=(0,C.Lz)(this.relativePath,"".concat(e.path,"/").concat(e.name)).split("/").map(encodeURIComponent).join("/")+("dir"===e.type?"/":""),i="".concat(n,"?fileId=").concat(e.id);this.setLink(i,e.name),this.startPath=e.path+("dir"===e.type?"/".concat(e.name,"/"):"")}))}))},linkWebsite(t){if("submit"===(null==t?void 0:t.type)){const e=[...t.target.elements].filter((t=>"text"===(null==t?void 0:t.type)))[0].value;return this.$refs.menu.closeMenu(),this.isInputMode=!1,this.href=null,this.setLink(e,e)}if((0,b.zh)(this.$editor.state,"link")){const t=(0,b.Jo)(this.$editor.state,"link");this.href=t.href}this.isInputMode=!0},setLink(t,e){var n;t&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((e=>t.match(e)))&&(t="https://"+t);const i=t.replaceAll(" ","%20"),r=this.$editor.chain();null!==(n=this.$editor.view.state)&&void 0!==n&&n.selection.empty?r.insertContent({type:"paragraph",content:[{type:"text",marks:[{type:"link",attrs:{href:i}}],text:e}]}):r.setLink({href:i}),r.focus().run()},removeLink(){this.$editor.chain().unsetLink().focus().run()},linkPicker(){(0,g.getLinkWithPicker)(null,!0).then((t=>{this.$editor.chain().focus().insertContent(t+" ").run()})).catch((t=>{console.error("Smart picker promise rejected",t)}))}}};var v=i(93379),_=i.n(v),y=i(7795),x=i.n(y),w=i(90569),k=i.n(w),E=i(3565),j=i.n(E),M=i(19216),S=i.n(M),N=i(44589),I=i.n(N),B=i(23069),T={};T.styleTagTransform=I(),T.setAttributes=j(),T.insert=k().bind(null,"head"),T.domAPI=x(),T.insertStyleElement=S();_()(B.Z,T);B.Z&&B.Z.locals&&B.Z.locals;const D=(0,c.Z)(f,(function(){var t=this,e=t._self._c;return e("NcActions",{ref:"menu",staticClass:"entry-action entry-action__insert-link",class:t.activeClass,attrs:{"aria-haspopup":"","aria-label":t.actionEntry.label,container:t.menuIDSelector,"data-text-action-entry":t.actionEntry.key,name:t.actionEntry.label},scopedSlots:t._u([{key:"icon",fn:function(){return[e(t.icon,{tag:"component",attrs:{name:t.actionEntry.label,"aria-label":t.actionEntry.label,"aria-haspopup":""}})]},proxy:!0}])},[t._v(" "),t.state.active?e("NcActionButton",{attrs:{"close-after-click":"","data-text-action-entry":"".concat(t.actionEntry.key,"-remove")},on:{click:t.removeLink},scopedSlots:t._u([{key:"icon",fn:function(){return[e("LinkOff")]},proxy:!0}],null,!1,3589828876)},[t._v("\n\t\t"+t._s(t.t("text","Remove link"))+"\n\t")]):t._e(),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":"","data-text-action-entry":"".concat(t.actionEntry.key,"-file")},on:{click:t.linkFile},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Document")]},proxy:!0}])},[t._v("\n\t\t"+t._s(t.t("text","Link to file or folder"))+"\n\t")]),t._v(" "),t.isInputMode?e("NcActionInput",{attrs:{type:"text",value:t.href,"data-text-action-entry":"".concat(t.actionEntry.key,"-input")},on:{submit:t.linkWebsite},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Web")]},proxy:!0}],null,!1,1844845715)},[t._v("\n\t\t"+t._s(t.t("text","Link to website"))+"\n\t")]):e("NcActionButton",{attrs:{"data-text-action-entry":"".concat(t.actionEntry.key,"-website")},on:{click:t.linkWebsite},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Web")]},proxy:!0}])},[t._v("\n\t\t"+t._s(t.state.active?t.t("text","Update link"):t.t("text","Link to website"))+"\n\t")]),t._v(" "),e("NcActionButton",{attrs:{"data-text-action-entry":"".concat(t.actionEntry.key,"-picker")},on:{click:t.linkPicker},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Shape")]},proxy:!0}])},[t._v("\n\t\t"+t._s(t.t("text","Open the Smart Picker"))+"\n\t")])],1)}),[],!1,null,"b01cbf5e",null).exports;var P=i(59400);const O=[{key:"outline",forceLabel:!0,icon:r.Cj,click:t=>{let{$outlineActions:e}=t;return e.toggle()},label:e=>{let{$outlineState:n}=e;return n.visible?t("text","Hide outline"):t("text","Show outline")}}],R=[{key:"undo",label:t("text","Undo"),keyChar:"z",keyModifiers:[P.v.Mod],icon:r.WP,action:t=>t.undo(),priority:6},{key:"redo",label:t("text","Redo"),keyChar:"y",keyModifiers:[P.v.Mod],icon:r.Jw,action:t=>t.redo(),priority:12},{key:"bold",label:t("text","Bold"),keyChar:"b",keyModifiers:[P.v.Mod],icon:r.VK,isActive:"strong",action:t=>t.toggleBold(),priority:7},{key:"italic",label:t("text","Italic"),keyChar:"i",keyModifiers:[P.v.Mod],icon:r.mV,isActive:"em",action:t=>t.toggleItalic(),priority:8},{key:"underline",label:t("text","Underline"),keyChar:"u",keyModifiers:[P.v.Mod],icon:r.Bz,isActive:"underline",action:t=>t.toggleUnderline(),priority:15},{key:"strikethrough",label:t("text","Strikethrough"),keyChar:"x",keyModifiers:[P.v.Mod,P.v.Shift],icon:r.Lo,isActive:"strike",action:t=>t.toggleStrike(),priority:16},{key:"headings",label:t("text","Headings"),keyChar:"1…6",keyModifiers:[P.v.Mod,P.v.Shift],icon:r.Lz,isActive:"heading",children:[{key:"headings-h1",label:t("text","Heading 1"),icon:r.Lz,isActive:["heading",{level:1}],action:t=>t.toggleHeading({level:1})},{key:"headings-h2",label:t("text","Heading 2"),icon:r.DB,isActive:["heading",{level:2}],action:t=>t.toggleHeading({level:2})},{key:"headings-h3",label:t("text","Heading 3"),icon:r.XD,isActive:["heading",{level:3}],action:t=>t.toggleHeading({level:3})},{key:"headings-h4",label:t("text","Heading 4"),isActive:["heading",{level:4}],icon:r.fy,action:t=>t.toggleHeading({level:4})},{key:"headings-h5",label:t("text","Heading 5"),isActive:["heading",{level:5}],icon:r.Ze,action:t=>t.toggleHeading({level:5})},{key:"headings-h6",label:t("text","Heading 6"),isActive:["heading",{level:6}],icon:r.J4,action:t=>t.toggleHeading({level:6})},{key:"outline",icon:r.Cj,click:t=>{let{$outlineActions:e}=t;return e.toggle()},visible:t=>{let{$outlineState:e}=t;return e.enable},label:e=>{let{$outlineState:n}=e;return n.visible?t("text","Hide outline"):t("text","Show outline")}}],priority:1},{key:"unordered-list",label:t("text","Unordered list"),keyChar:"8",keyModifiers:[P.v.Mod,P.v.Shift],isActive:"bulletList",icon:r.Cj,action:t=>t.toggleBulletList(),priority:9},{key:"ordered-list",label:t("text","Ordered list"),keyChar:"7",keyModifiers:[P.v.Mod,P.v.Shift],isActive:"orderedList",icon:r.mH,action:t=>t.toggleOrderedList(),priority:10},{key:"task-list",label:t("text","To-Do list"),keyChar:"9",keyModifiers:[P.v.Mod,P.v.Shift],isActive:"taskList",icon:r.Fv,action:t=>t.toggleTaskList(),priority:11},{key:"insert-link",label:t("text","Insert link"),isActive:"link",icon:r.xP,component:D,priority:2},{key:"blockquote",label:t("text","Blockquote"),keyChar:"b",keyModifiers:[P.v.Mod,P.v.Shift],isActive:"blockquote",icon:r.UX,action:t=>t.toggleBlockquote(),priority:13},{key:"callouts",label:t("text","Callouts"),visible:!1,icon:r.kI,isActive:"callout",children:[{key:"callout-info",label:t("text","Info"),isActive:["callout",{type:"info"}],icon:r.kI,action:t=>t.toggleCallout({type:"info"})},{key:"callout-success",label:t("text","Success"),isActive:["callout",{type:"success"}],icon:r.Ho,action:t=>t.toggleCallout({type:"success"})},{key:"callout-warn",label:t("text","Warning"),isActive:["callout",{type:"warn"}],icon:r.uU,action:t=>t.toggleCallout({type:"warn"})},{key:"callout-error",label:t("text","Danger"),isActive:["callout",{type:"error"}],icon:r.b0,action:t=>t.toggleCallout({type:"error"})}],priority:3},{key:"code-block",label:t("text","Code block"),keyChar:"c",keyModifiers:[P.v.Mod,P.v.Alt],isActive:"codeBlock",icon:r.Nk,action:t=>t.toggleCodeBlock(),priority:14},{key:"table",label:t("text","Table"),isActive:"table",icon:r.iA,action:t=>t.insertTable(),priority:17},{key:"emoji-picker",label:t("text","Insert emoji"),icon:r.tk,component:d,action:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.emoji(e)},priority:5},{key:"insert-attachment",label:t("text","Insert attachment"),icon:r.rU,component:u,priority:4}]},59400:(e,n,i)=>{"use strict";i.d(n,{K:()=>a,v:()=>o});const r=navigator.userAgent.includes("Mac"),o={Mod:r?"Meta":"Control",Alt:"Alt",Control:"Control",Shift:"Shift"},a={[o.Mod]:r?t("text","Command"):t("text","Control"),[o.Control]:t("text","Ctrl"),[o.Alt]:t("text",r?"Option":"Alt"),[o.Shift]:t("text","Shift")}},72076:(t,e,n)=>{"use strict";n.d(e,{FZ:()=>o,RR:()=>a,vK:()=>l,wr:()=>c});var i=n(59400);const r=(t,e)=>({"is-active":e,["action-menu-".concat(t.key)]:!0}),o=t=>{let{keyChar:e,keyModifiers:n=[]}=t;return n.map((t=>i.v[t])).concat(e).join("+")},a=(t,e)=>{let{keyChar:n,keyModifiers:r}=e;return!t&&n?"(".concat(function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((t=>i.K[t])).concat(t.toUpperCase()).join("+")}(n,r),")"):""},s=(t,e)=>t.action&&!t.action(e.can()),l=(t,e)=>{let{isActive:n}=t;if(!n)return!1;const i=Array.isArray(n)?n:[n];return e.isActive(...i)},c=(t,e)=>{const n=l(t,e);return{disabled:s(t,e),class:r(t,n),active:n}}},28374:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i=n(13861),r=n(79835);const o=t=>{let{listComponent:e,items:n=(()=>{}),command:o=(t=>{let{editor:e,range:n,props:i}=t})}=t;return{items:n,command:o,render:()=>{let t,n;return{onStart:o=>{t=new r.aA(e,{parent:void 0,propsData:o}),o.clientRect&&(n=(0,i.ZP)("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}),t.ref.$on("select",(()=>{n.length>0&&n[0].hide()})))},onUpdate(e){t.updateProps(e),e.clientRect&&n&&n[0].setProps({getReferenceClientRect:e.clientRect})},onKeyDown(e){var i,r;if(n)return"Escape"===e.event.key?(n[0].hide(),n[0].destroy(),t.destroy(),n=null,!0):null===(i=t.ref)||void 0===i||null===(r=i.onKeyDown)||void 0===r?void 0:r.call(i,e)},onExit(){n&&(n[0].destroy(),t.destroy())}}}}}},32318:(t,e,n)=>{"use strict";n.d(e,{Ah:()=>Zt,BB:()=>ht,BF:()=>At,Bz:()=>Mt,Cj:()=>xt,DB:()=>bt,Ee:()=>Nt,F5:()=>zt,Fq:()=>Ht,Fv:()=>wt,HG:()=>dt,Ho:()=>Pt,IY:()=>$t,J4:()=>_t,Jw:()=>Ot,L9:()=>ot,Lo:()=>jt,Lz:()=>mt,Nk:()=>lt,Pn:()=>it,QK:()=>rt,UX:()=>Et,VK:()=>gt,WP:()=>Gt,WW:()=>St,XD:()=>Ct,Ze:()=>vt,_2:()=>Ut,b0:()=>ct,bn:()=>Rt,fy:()=>ft,gb:()=>nt,gq:()=>Wt,gr:()=>at,gt:()=>ut,iA:()=>Lt,kI:()=>Bt,mH:()=>kt,mV:()=>yt,pR:()=>Dt,ph:()=>Kt,pn:()=>Ft,rU:()=>It,tk:()=>pt,uU:()=>qt,x8:()=>st,xP:()=>Tt});var i=n(96963),r=n(82675),o=n(80419),a=n(75441),s=n(45795),l=n(75816),c=n(57612),d=n(13881),h=n(89115),A=n(37319),p=n(34829),u=n(88723),g=n(10864),m=n(39027),b=n(4738),C=n(57637),f=n(13237),v=n(52986),_=n(17238),y=n(11465),x=n(94669),w=n(34415),k=n(9829),E=n(65875),j=n(35357),M=n(92801),S=n(42413),N=n(88505),I=n(39227),B=n(5039),T=n(93603),D=n(37838),P=n(19695),O=n(72468),R=n(64836),L=n(65745),Z=n(79542),$=n(91265),z=n(96104),F=n(21666),U=n(61562),H=n(52880),G=n(49759),W=n(39850),q=n(9571),K=n(69699),V=n(33581),Y=n(4650),Q=n(75762),X=n(8421),J=n(97859),tt=n(54503);const et=t=>({functional:!0,render(e,n){let{data:i,props:r}=n;return e(t,{data:i,key:i.key,staticClass:i.staticClass,props:{size:20,...r}})}}),nt={functional:!0,render(t,e){let{data:n,props:i}=e;return t(L.Z,{data:n,staticClass:"animation-rotate",props:{size:20,...i}})}},it=et(i.Z),rt=et(g.Z),ot=et(m.Z),at=et(b.Z),st=et(r.default),lt=(et(o.default),et(s.Z)),ct=(et(a.Z),et(l.default)),dt=et(c.Z),ht=et(d.Z),At=et(h.default),pt=et(A.Z),ut=et(p.default),gt=et(u.Z),mt=et(C.Z),bt=et(f.Z),Ct=et(v.Z),ft=et(_.Z),vt=et(y.Z),_t=et(x.Z),yt=et(w.Z),xt=et(k.Z),wt=et(E.Z),kt=et(j.Z),Et=et(M.Z),jt=et(S.Z),Mt=et(N.Z),St=et(I.default),Nt=et(B.Z),It=et(T.Z),Bt=et(D.default),Tt=et(P.Z),Dt=et(O.Z),Pt=(et(R.Z),et(Z.Z),et($.default)),Ot=et(z.Z),Rt=et(F.Z),Lt=et(U.Z),Zt=et(H.Z),$t=et(G.Z),zt=et(W.Z),Ft=et(q.Z),Ut=et(K.Z),Ht=(et(V.Z),et(tt.Z)),Gt=et(Y.Z),Wt=et(Q.Z),qt=et(X.default),Kt=et(J.default)},73073:(t,e,n)=>{"use strict";n.d(e,{Z:()=>A,g:()=>c});var i=n(73845),r=n(2376),o=n(55963),a=n(40187),s=n(87823);const l=i.hj.create({name:"markdown",extendMarkSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{toMarkdown:(0,i.Nl)(t,"toMarkdown",e)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{toMarkdown:(0,i.Nl)(t,"toMarkdown",e)}},addProseMirrorPlugins(){let t=!1;return[new r.Sy({key:new r.H$("pasteEventHandler"),props:{handleDOMEvents:{mouseup:(e,n)=>(t=n.shiftKey,!1)},handleKeyDown:(e,n)=>(t=n.shiftKey,!1),clipboardTextParser(e,n,i,r){const o=s.aw.fromSchema(r.state.schema),l=document.cloneNode(!1).createElement("div");return l.innerHTML=t?"
"+e.replaceAll("\n","
").replaceAll("
","
")+"
":a.Z.render(e),o.parseSlice(l,{preserveWhitespace:!0,context:n})}}})]}}),c=t=>{let{nodes:e,marks:n}=t;const i=h(o.Dm.nodes),r=h(o.Dm.marks);return{serializer:new o.nZ({...i,...d(e)},{...r,...d(n)}),serialize(t,e){return this.serializer.serialize(t,{...e,tightLists:!0})}}},d=t=>Object.entries(t).map((t=>{let[e,n]=t;return[e,n.spec.toMarkdown]})).filter((t=>{let[,e]=t;return e})).reduce(((t,e)=>{let[n,i]=e;return{...t,[n]:i}}),{}),h=t=>{const e=t=>t.replace(/_(\w)/g,((t,e)=>e.toUpperCase()));return Object.fromEntries(Object.entries(t).map((t=>{let[n,i]=t;return[e(n),i]})))},A=l},78979:(e,n,i)=>{"use strict";function r(t){setTimeout((()=>{const e=document.getElementById("collaboration-cursor__label__".concat(t));e&&(e.classList.add("collaboration-cursor__label__active"),setTimeout((()=>{null==e||e.classList.remove("collaboration-cursor__label__active")}),50))}),50)}function o(){return Math.floor(Date.now()/1e3)}i.d(n,{lN:()=>a,N8:()=>A,pf:()=>oe,f3:()=>v,Ho:()=>dn});const a=i(14539).l.extend({addOptions:()=>({provider:null,user:{name:null,clientId:null,color:null,lastUpdate:o()},render:t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style","border-color: ".concat(t.color));const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.id="collaboration-cursor__label__".concat(t.clientId),n.setAttribute("style","background-color: ".concat(t.color)),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e}}),onCreate(){this.options.provider.awareness.on("change",((t,e)=>{let{added:n,removed:i,updated:o}=t;if("local"!==e)for(const t of[...n,...o])t!==this.options.user.clientId&&r(t)}))},onTransaction(t){var e;let{transaction:n}=t;const{updated:i,meta:r}=n;!i||null!==(e=r.addToHistory)&&void 0!==e&&!e||r.pointer||(this.options.user.lastUpdate=o(),this.options.provider.awareness.setLocalStateField("user",this.options.user))}});var s=i(73845),l=i(2376),c=i(16722);const d=new l.H$("emoji"),h=s.NB.create({name:"emoji",addOptions:()=>({HTMLAttributes:{},suggestion:{char:":",allowedPrefixes:[" "],pluginKey:d}}),content:"text*",addCommands:()=>({emoji:t=>e=>{let{commands:n}=e;return n.insertContent(t.native+" ")}}),addProseMirrorPlugins(){return[(0,c.ZP)({editor:this.editor,...this.options.suggestion})]}}),A=s.hj.create({name:"customkeymap",addKeyboardShortcuts(){return this.options},addProseMirrorPlugins:()=>[new l.Sy({props:{handleKeyDown(t,e){const n=e.key||e.keyCode;return!e.ctrlKey&&!e.metaKey||e.shiftKey||"f"!==n&&70!==n?"Delete"===e.key&&!0===e.ctrlKey?(e.stopPropagation(),window.dispatchEvent(e),!0):void 0:(e.stopPropagation(),window.dispatchEvent(e),!0)}}})]});var p=i(84348);class u{constructor(t,e,n){this.from=t,this.to=e,this.author=n}}function g(t,e,n,i){if(e>=n)return;let r,o=0;for(;o'.concat((0,f.escapeHtml)(t[e].meta),"
"),v.renderer.rules.bullet_list_open=(t,e,n)=>(t[e].attrs=[...t[e].attrs||[],["data-bullet",t[e].markup]],v.renderer.renderToken(t,e,n));const _=v},13815:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(25030);const r={data:()=>({$store:i.Z}),beforeMount(){void 0===this.$store?this.$store=i.Z:this.$store.hasModule("text")||this.$store.registerModule("text",i.D)}}},86536:(t,e,n)=>{"use strict";n.d(e,{r2:()=>Q,jA:()=>Y,QS:()=>X,TY:()=>V,_U:()=>tt});var i=n(59391),r=n(20296),o=n.n(r),a=n(52029),s=n(88911),l=n(79753);function c(t,e){h(t,e),e.add(t)}function d(t,e,n){h(t,e),e.set(t,n)}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function A(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,g(t,e,"get"))}function p(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function u(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,g(t,e,"set"),n),n}function g(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}var m=new WeakMap,b=new WeakSet;function C(t){return I(t,!!A(this,m).shareToken)}var f=new WeakMap,v=new WeakMap,_=new WeakMap,y=new WeakMap,x=new WeakMap,w=new WeakMap,k=new WeakMap,E=new WeakMap,j=new WeakSet;class M{constructor(t,e){c(this,j),d(this,E,{get:S,set:void 0}),d(this,f,{writable:!0,value:void 0}),d(this,v,{writable:!0,value:void 0}),d(this,_,{writable:!0,value:void 0}),d(this,y,{writable:!0,value:void 0}),d(this,x,{writable:!0,value:void 0}),d(this,w,{writable:!0,value:void 0}),d(this,k,{writable:!0,value:void 0});const{document:n,session:i,lock:r,readOnly:o,content:a,documentState:s}=t.data;u(this,_,n),u(this,y,i),u(this,x,r),u(this,w,o),u(this,f,a),u(this,v,s),u(this,k,e)}get session(){return A(this,y)}get document(){return A(this,_)}get docStateVersion(){return A(this,v)?A(this,_).lastSavedVersion:0}get state(){return{document:{...A(this,_),readOnly:A(this,w)},session:A(this,y),documentSource:A(this,f)||"",documentState:A(this,v)}}sync(t){let{version:e}=t;return s.Z.post(p(this,j,N).call(this,"session/sync"),{...A(this,E),filePath:A(this,k).filePath,version:e})}save(t){let{version:e,autosaveContent:n,documentState:i,force:r,manualSave:o}=t;return s.Z.post(p(this,j,N).call(this,"session/save"),{...A(this,E),filePath:A(this,k).filePath,version:e,autosaveContent:n,documentState:i,force:r,manualSave:o})}push(t){let{steps:e,version:n,awareness:i}=t;return s.Z.post(p(this,j,N).call(this,"session/push"),{...A(this,E),filePath:A(this,k).filePath,steps:e,version:n,awareness:i})}update(t){return s.Z.post(p(this,j,N).call(this,"session"),{...A(this,E),guestName:t}).then((t=>{let{data:e}=t;u(this,y,e)}))}uploadAttachment(t){const e=new FormData;e.append("file",t);const n=I("attachment/upload")+"?documentId="+encodeURIComponent(A(this,_).id)+"&sessionId="+encodeURIComponent(A(this,y).id)+"&sessionToken="+encodeURIComponent(A(this,y).token)+"&shareToken="+encodeURIComponent(A(this,k).shareToken||"");return s.Z.post(n,e,{headers:{"Content-Type":"multipart/form-data"}})}insertAttachmentFile(t){return s.Z.post(I("attachment/filepath"),{documentId:A(this,_).id,sessionId:A(this,y).id,sessionToken:A(this,y).token,filePath:t})}close(){return s.Z.post(p(this,j,N).call(this,"session/close"),A(this,E))}}function S(){return{documentId:A(this,_).id,sessionId:A(this,y).id,sessionToken:A(this,y).token,token:A(this,k).shareToken}}function N(t){return I(t,!!A(this,E).token)}function I(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,l.generateUrl)("/apps/text");return e?"".concat(n,"/public/").concat(t):"".concat(n,"/").concat(t)}const B=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c(this,b),d(this,m,{writable:!0,value:void 0}),u(this,m,t)}open(t){let{fileId:e}=t;return s.Z.put(p(this,b,C).call(this,"session/create"),{fileId:e,filePath:A(this,m).filePath,token:A(this,m).shareToken,guestName:A(this,m).guestName,forceRecreate:A(this,m).forceRecreate}).then((t=>new M(t,A(this,m))))}};function T(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)}function D(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,O(t,e,"get"))}function P(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,O(t,e,"set"),n),n}function O(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}var R=new WeakMap,L=new WeakMap,Z=new WeakMap,$=new WeakMap,z=new WeakMap,F=new WeakMap,U=new WeakMap;const H=class{constructor(t,e){T(this,R,{writable:!0,value:void 0}),T(this,L,{writable:!0,value:void 0}),T(this,Z,{writable:!0,value:void 0}),T(this,$,{writable:!0,value:void 0}),T(this,z,{writable:!0,value:void 0}),T(this,F,{writable:!0,value:void 0}),T(this,U,{writable:!0,value:void 0}),P(this,R,t),P(this,L,e),P(this,$,300),P(this,z,0),P(this,Z,0)}connect(){this.fetcher>0?console.error("Trying to connect, but already connected"):(P(this,U,!1),this.fetcher=setInterval(this._fetchSteps.bind(this),50),document.addEventListener("visibilitychange",this.visibilitychange.bind(this)))}async _fetchSteps(){if(D(this,F))return;const t=Date.now();D(this,Z)>t-D(this,$)||(this.fetcher?(P(this,F,!0),a.k.debug("[PollingBackend] Fetching steps",D(this,R).version),await D(this,L).sync({version:D(this,R).version}).then(this._handleResponse.bind(this),this._handleError.bind(this)),P(this,Z,Date.now()),P(this,F,!1)):console.error("No inverval but triggered"))}_handleResponse(t){let{data:e}=t;const{document:n,sessions:i}=e;if(P(this,z,0),D(this,R).emit("change",{document:n,sessions:i}),D(this,R)._receiveSteps(e),0===e.steps.length){if(D(this,U)||P(this,U,!0),D(this,R).checkIdle())return;const t=Date.now()-9e4;return i.filter((e=>1e3*e.lastContact>t)).length<2?this.maximumRefetchTimer():this.increaseRefetchTimer(),void D(this,R).emit("stateChange",{initialLoading:!0})}D(this,U)&&this.resetRefetchTimer()}_handleError(t){var e,n;t.response&&"ECONNABORTED"!==t.code?409===t.response.status?(this._handleResponse(t.response),a.k.error("Conflict during file save, please resolve"),D(this,R).emit("error",{type:X.SAVE_COLLISSION,data:{outsideChange:t.response.data.outsideChange}})):403===t.response.status||404===t.response.status?(D(this,R).emit("error",{type:X.SOURCE_NOT_FOUND,data:{}}),this.disconnect()):503===t.response.status?(this.increaseRefetchTimer(),D(this,R).emit("error",{type:X.CONNECTION_FAILED,data:{}}),a.k.error("Failed to fetch steps due to unavailable service",{error:t})):(this.disconnect(),D(this,R).emit("error",{type:X.CONNECTION_FAILED,data:{}}),a.k.error("Failed to fetch steps due to other reason",{error:t})):(P(this,z,(e=D(this,z),n=e++,e)),n>=5?(a.k.error("[PollingBackend:fetchSteps] Network error when fetching steps, emitting CONNECTION_FAILED"),D(this,R).emit("error",{type:X.CONNECTION_FAILED,data:{}})):a.k.error("[PollingBackend:fetchSteps] Network error when fetching steps, retry ".concat(D(this,z))))}disconnect(){clearInterval(this.fetcher),this.fetcher=0,document.removeEventListener("visibilitychange",this.visibilitychange.bind(this))}resetRefetchTimer(){P(this,$,300)}increaseRefetchTimer(){P(this,$,Math.min(2*D(this,$),5e3))}maximumRefetchTimer(){P(this,$,5e3)}visibilitychange(){"hidden"===document.visibilityState?P(this,$,6e4):this.resetRefetchTimer()}};function G(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)}function W(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,K(t,e,"get"))}function q(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,K(t,e,"set"),n),n}function K(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}const V=1440,Y=60,Q=90,X={SAVE_COLLISSION:0,PUSH_FAILURE:1,LOAD_ERROR:2,CONNECTION_FAILED:3,SOURCE_NOT_FOUND:4};var J=new WeakMap;class tt{constructor(t){let{serialize:e,getDocumentState:n,...r}=t;return G(this,J,{writable:!0,value:void 0}),this._bus=(0,i.Z)(),this.serialize=e,this.getDocumentState=n,this._api=new B(r),this.connection=null,this.sessions=[],this.steps=[],this.stepClientIDs=[],this.lastStepPush=Date.now(),this.version=null,this.sending=!1,q(this,J,null),this.autosave=o()(this._autosave.bind(this),3e4),this}async open(t){let{fileId:e,initialSession:n}=t;const i=t=>{let{sessions:e}=t;this.sessions=e};this.on("change",i);const r=n?Promise.resolve(new M({data:n},{})):this._api.open({fileId:e}).catch((t=>this._emitError(t)));this.connection=await r,this.connection?(this.backend=new H(this,this.connection),this.version=this.connection.docStateVersion,this.emit("opened",{...this.connection.state,version:this.version}),this.emit("loaded",{...this.connection.state,version:this.version})):this.off("change",i)}startSync(){this.backend.connect()}syncUp(){this.backend.resetRefetchTimer()}_emitError(t){t.response&&"ECONNABORTED"!==t.code?this.emit("error",{type:X.LOAD_ERROR,data:t.response}):this.emit("error",{type:X.CONNECTION_FAILED,data:{}})}updateSession(t){if(this.connection.isPublic)return this.connection.update(t).catch((t=>(a.k.error("Failed to update the session",{error:t}),Promise.reject(t))))}sendSteps(t){if(!W(this,J))return new Promise(((e,n)=>{q(this,J,setInterval((()=>{this.connection&&!this.sending&&(clearInterval(W(this,J)),q(this,J,null),this._sendSteps(t).then(e).catch(n))}),200))}))}_sendSteps(t){this.sending=!0;const e=t();return e.steps.length>0&&this.emit("stateChange",{dirty:!0}),this.connection.push(e).then((t=>{this.sending=!1,this.emit("sync",{steps:[],document:this.connection.document,version:this.version})})).catch((t=>{const{response:n,code:i}=t;var r;(this.sending=!1,n&&"ECONNABORTED"!==i||this.emit("error",{type:X.CONNECTION_FAILED,data:{}}),403===(null==n?void 0:n.status))&&(e.document||a.k.error("failed to write to document - not allowed"),(null===(r=n.data.document)||void 0===r?void 0:r.currentVersion)===this.version&&(this.emit("error",{type:X.PUSH_FAILURE,data:{}}),OC.Notification.showTemporary("Changes could not be sent yet")));throw new Error("Failed to apply steps. Retry!",{cause:t})}))}_receiveSteps(t){let{steps:e,document:n,sessions:i}=t;const r=i.filter((t=>t.lastContact>Math.floor(Date.now()/1e3)-Q)).filter((t=>t.lastAwarenessMessage)).map((t=>({step:t.lastAwarenessMessage,clientId:t.clientId}))),o=[...r];this.steps=[...this.steps,...r.map((t=>t.step))];for(let t=0;t' + str.replaceAll('\\n', '
').replaceAll('
', '
') + '
'\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdom.innerHTML = markdownit.render(str)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parser.parseSlice(dom, { preserveWhitespace: true, context: $context })\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t},\n})\n\nconst createMarkdownSerializer = ({ nodes, marks }) => {\n\tconst defaultNodes = convertNames(defaultMarkdownSerializer.nodes)\n\tconst defaultMarks = convertNames(defaultMarkdownSerializer.marks)\n\treturn {\n\t\tserializer: new MarkdownSerializer(\n\t\t\t{ ...defaultNodes, ...extractToMarkdown(nodes) },\n\t\t\t{ ...defaultMarks, ...extractToMarkdown(marks) },\n\t\t),\n\t\tserialize(content, options) {\n\t\t\treturn this.serializer.serialize(content, { ...options, tightLists: true })\n\t\t},\n\t}\n}\n\nconst extractToMarkdown = (nodesOrMarks) => {\n\treturn Object\n\t\t.entries(nodesOrMarks)\n\t\t.map(([name, nodeOrMark]) => [name, nodeOrMark.spec.toMarkdown])\n\t\t.filter(([, toMarkdown]) => toMarkdown)\n\t\t.reduce((items, [name, toMarkdown]) => ({\n\t\t\t...items,\n\t\t\t[name]: toMarkdown,\n\t\t}), {})\n}\n\nconst convertNames = (object) => {\n\tconst convert = (name) => {\n\t\treturn name.replace(/_(\\w)/g, (_m, letter) => letter.toUpperCase())\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries(object)\n\t\t\t.map(([name, value]) => [convert(name), value]),\n\t)\n}\n\nexport { createMarkdownSerializer }\nexport default Markdown\n","import { CollaborationCursor as TiptapCollaborationCursor } from '@tiptap/extension-collaboration-cursor'\n\n/**\n * Show cursor for client ID\n * Wait 50ms for cases where the cursor gets re-rendered\n *\n * @param {number} clientId The Yjs client ID\n */\nfunction showCursorLabel(clientId) {\n\tsetTimeout(() => {\n\t\tconst el = document.getElementById(`collaboration-cursor__label__${clientId}`)\n\t\tif (!el) {\n\t\t\treturn\n\t\t}\n\n\t\tel.classList.add('collaboration-cursor__label__active')\n\t\tsetTimeout(() => {\n\t\t\tel?.classList.remove('collaboration-cursor__label__active')\n\t\t}, 50)\n\t}, 50)\n}\n\n/**\n * Unix timestamp in seconds.\n */\nfunction getTimestamp() {\n\treturn Math.floor(Date.now() / 1000)\n}\n\nconst CollaborationCursor = TiptapCollaborationCursor.extend({\n\taddOptions() {\n\t\treturn {\n\t\t\tprovider: null,\n\t\t\tuser: {\n\t\t\t\tname: null,\n\t\t\t\tclientId: null,\n\t\t\t\tcolor: null,\n\t\t\t\tlastUpdate: getTimestamp(),\n\t\t\t},\n\t\t\trender: user => {\n\t\t\t\tconst cursor = document.createElement('span')\n\n\t\t\t\tcursor.classList.add('collaboration-cursor__caret')\n\t\t\t\tcursor.setAttribute('style', `border-color: ${user.color}`)\n\n\t\t\t\tconst label = document.createElement('div')\n\n\t\t\t\tlabel.classList.add('collaboration-cursor__label')\n\t\t\t\tlabel.id = `collaboration-cursor__label__${user.clientId}`\n\t\t\t\tlabel.setAttribute('style', `background-color: ${user.color}`)\n\t\t\t\tlabel.insertBefore(document.createTextNode(user.name), null)\n\t\t\t\tcursor.insertBefore(label, null)\n\n\t\t\t\treturn cursor\n\t\t\t},\n\t\t}\n\t},\n\n\tonCreate() {\n\t\tthis.options.provider.awareness.on('change', ({ added, removed, updated }, origin) => {\n\t\t\tif (origin !== 'local') {\n\t\t\t\tfor (const clientId of [...added, ...updated]) {\n\t\t\t\t\tif (clientId !== this.options.user.clientId) {\n\t\t\t\t\t\tshowCursorLabel(clientId)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\n\t// Flag own cursor as active on undoable changes to the document state\n\tonTransaction({ transaction }) {\n\t\tconst { updated, meta } = transaction\n\t\tif (updated && (meta.addToHistory ?? true) && !meta.pointer) {\n\t\t\tthis.options.user.lastUpdate = getTimestamp()\n\t\t\tthis.options.provider.awareness.setLocalStateField('user', this.options.user)\n\t\t}\n\t},\n})\n\nexport default CollaborationCursor\n","/*\n * @copyright Copyright (c) 2021 Jonas${escapeHtml(tokens[idx].meta)}
`\n\n// Render lists with bullet attribute\nmarkdownit.renderer.rules.bullet_list_open = (tokens, idx, options) => {\n\ttokens[idx].attrs = [\n\t\t...(tokens[idx].attrs || []),\n\t\t['data-bullet', tokens[idx].markup],\n\t]\n\treturn markdownit.renderer.renderToken(tokens, idx, options)\n}\n\nexport default markdownit\n","/*\n * @copyright Copyright (c) 2022 Max