UNPKG

@bicou/directus-extension-tiptap

Version:

Tiptap rich text editor interface and display for directus

1 lines 1.58 MB
import{defineInterface as A,defineDisplay as B}from"@directus/extensions-sdk";import{defineComponent as Q,ref as g,onMounted as I,onBeforeUnmount as w,h as E,markRaw as Y,getCurrentInstance as C,watchEffect as M,nextTick as F,unref as c,customRef as i,reactive as s,render as N,resolveComponent as U,openBlock as D,createElementBlock as G,createVNode as y,withCtx as h,Fragment as z,renderList as j,createBlock as e,createTextVNode as H,toDisplayString as J,createElementVNode as t,withAsyncContext as R,computed as o,watch as x,resolveDirective as L,normalizeClass as n,withDirectives as r,createCommentVNode as k,resolveDynamicComponent as a,isRef as W,Suspense as S,normalizeProps as K,guardReactiveProps as l}from"vue";import{Extension as T,isTextSelection as V,isNodeSelection as m,posToDOMRect as d,getText as b,getTextSerializersFromSchema as u,Editor as p,Node as X,mergeAttributes as Z}from"@tiptap/core";import{Plugin as O,PluginKey as f}from"@tiptap/pm/state";import{useI18n as P}from"vue-i18n";import v from"@tiptap/starter-kit";import{Underline as q}from"@tiptap/extension-underline";import{TextAlign as _}from"@tiptap/extension-text-align";import{CharacterCount as $}from"@tiptap/extension-character-count";import{Subscript as AA}from"@tiptap/extension-subscript";import{Superscript as BA}from"@tiptap/extension-superscript";import{Highlight as QA}from"@tiptap/extension-highlight";import{Typography as gA}from"@tiptap/extension-typography";import{Placeholder as IA}from"@tiptap/extension-placeholder";import{Link as wA}from"@tiptap/extension-link";import EA from"@tiptap/extension-focus";import{TaskList as YA}from"@tiptap/extension-task-list";import{TaskItem as CA}from"@tiptap/extension-task-item";import{Table as MA}from"@tiptap/extension-table";import{TableRow as FA}from"@tiptap/extension-table-row";import{TableCell as cA}from"@tiptap/extension-table-cell";import{TableHeader as iA}from"@tiptap/extension-table-header";var sA="top",NA="bottom",UA="right",DA="left",GA="auto",yA=[sA,NA,UA,DA],hA="start",zA="end",jA="viewport",eA="popper",HA=yA.reduce((function(A,B){return A.concat([B+"-"+hA,B+"-"+zA])}),[]),JA=[].concat(yA,[GA]).reduce((function(A,B){return A.concat([B,B+"-"+hA,B+"-"+zA])}),[]),tA=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function RA(A){return A?(A.nodeName||"").toLowerCase():null}function oA(A){if(null==A)return window;if("[object Window]"!==A.toString()){var B=A.ownerDocument;return B&&B.defaultView||window}return A}function xA(A){return A instanceof oA(A).Element||A instanceof Element}function LA(A){return A instanceof oA(A).HTMLElement||A instanceof HTMLElement}function nA(A){return"undefined"!=typeof ShadowRoot&&(A instanceof oA(A).ShadowRoot||A instanceof ShadowRoot)}var rA={name:"applyStyles",enabled:!0,phase:"write",fn:function(A){var B=A.state;Object.keys(B.elements).forEach((function(A){var Q=B.styles[A]||{},g=B.attributes[A]||{},I=B.elements[A];LA(I)&&RA(I)&&(Object.assign(I.style,Q),Object.keys(g).forEach((function(A){var B=g[A];!1===B?I.removeAttribute(A):I.setAttribute(A,!0===B?"":B)})))}))},effect:function(A){var B=A.state,Q={popper:{position:B.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(B.elements.popper.style,Q.popper),B.styles=Q,B.elements.arrow&&Object.assign(B.elements.arrow.style,Q.arrow),function(){Object.keys(B.elements).forEach((function(A){var g=B.elements[A],I=B.attributes[A]||{},w=Object.keys(B.styles.hasOwnProperty(A)?B.styles[A]:Q[A]).reduce((function(A,B){return A[B]="",A}),{});LA(g)&&RA(g)&&(Object.assign(g.style,w),Object.keys(I).forEach((function(A){g.removeAttribute(A)})))}))}},requires:["computeStyles"]};function kA(A){return A.split("-")[0]}var aA=Math.max,WA=Math.min,SA=Math.round;function KA(){var A=navigator.userAgentData;return null!=A&&A.brands&&Array.isArray(A.brands)?A.brands.map((function(A){return A.brand+"/"+A.version})).join(" "):navigator.userAgent}function lA(){return!/^((?!chrome|android).)*safari/i.test(KA())}function TA(A,B,Q){void 0===B&&(B=!1),void 0===Q&&(Q=!1);var g=A.getBoundingClientRect(),I=1,w=1;B&&LA(A)&&(I=A.offsetWidth>0&&SA(g.width)/A.offsetWidth||1,w=A.offsetHeight>0&&SA(g.height)/A.offsetHeight||1);var E=(xA(A)?oA(A):window).visualViewport,Y=!lA()&&Q,C=(g.left+(Y&&E?E.offsetLeft:0))/I,M=(g.top+(Y&&E?E.offsetTop:0))/w,F=g.width/I,c=g.height/w;return{width:F,height:c,top:M,right:C+F,bottom:M+c,left:C,x:C,y:M}}function VA(A){var B=TA(A),Q=A.offsetWidth,g=A.offsetHeight;return Math.abs(B.width-Q)<=1&&(Q=B.width),Math.abs(B.height-g)<=1&&(g=B.height),{x:A.offsetLeft,y:A.offsetTop,width:Q,height:g}}function mA(A,B){var Q=B.getRootNode&&B.getRootNode();if(A.contains(B))return!0;if(Q&&nA(Q)){var g=B;do{if(g&&A.isSameNode(g))return!0;g=g.parentNode||g.host}while(g)}return!1}function dA(A){return oA(A).getComputedStyle(A)}function bA(A){return["table","td","th"].indexOf(RA(A))>=0}function uA(A){return((xA(A)?A.ownerDocument:A.document)||window.document).documentElement}function pA(A){return"html"===RA(A)?A:A.assignedSlot||A.parentNode||(nA(A)?A.host:null)||uA(A)}function XA(A){return LA(A)&&"fixed"!==dA(A).position?A.offsetParent:null}function ZA(A){for(var B=oA(A),Q=XA(A);Q&&bA(Q)&&"static"===dA(Q).position;)Q=XA(Q);return Q&&("html"===RA(Q)||"body"===RA(Q)&&"static"===dA(Q).position)?B:Q||function(A){var B=/firefox/i.test(KA());if(/Trident/i.test(KA())&&LA(A)&&"fixed"===dA(A).position)return null;var Q=pA(A);for(nA(Q)&&(Q=Q.host);LA(Q)&&["html","body"].indexOf(RA(Q))<0;){var g=dA(Q);if("none"!==g.transform||"none"!==g.perspective||"paint"===g.contain||-1!==["transform","perspective"].indexOf(g.willChange)||B&&"filter"===g.willChange||B&&g.filter&&"none"!==g.filter)return Q;Q=Q.parentNode}return null}(A)||B}function OA(A){return["top","bottom"].indexOf(A)>=0?"x":"y"}function fA(A,B,Q){return aA(A,WA(B,Q))}function PA(A){return Object.assign({},{top:0,right:0,bottom:0,left:0},A)}function vA(A,B){return B.reduce((function(B,Q){return B[Q]=A,B}),{})}var qA={name:"arrow",enabled:!0,phase:"main",fn:function(A){var B,Q=A.state,g=A.name,I=A.options,w=Q.elements.arrow,E=Q.modifiersData.popperOffsets,Y=kA(Q.placement),C=OA(Y),M=[DA,UA].indexOf(Y)>=0?"height":"width";if(w&&E){var F=function(A,B){return PA("number"!=typeof(A="function"==typeof A?A(Object.assign({},B.rects,{placement:B.placement})):A)?A:vA(A,yA))}(I.padding,Q),c=VA(w),i="y"===C?sA:DA,s="y"===C?NA:UA,N=Q.rects.reference[M]+Q.rects.reference[C]-E[C]-Q.rects.popper[M],U=E[C]-Q.rects.reference[C],D=ZA(w),G=D?"y"===C?D.clientHeight||0:D.clientWidth||0:0,y=N/2-U/2,h=F[i],z=G-c[M]-F[s],j=G/2-c[M]/2+y,e=fA(h,j,z),H=C;Q.modifiersData[g]=((B={})[H]=e,B.centerOffset=e-j,B)}},effect:function(A){var B=A.state,Q=A.options.element,g=void 0===Q?"[data-popper-arrow]":Q;null!=g&&("string"!=typeof g||(g=B.elements.popper.querySelector(g)))&&mA(B.elements.popper,g)&&(B.elements.arrow=g)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _A(A){return A.split("-")[1]}var $A={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AB(A){var B,Q=A.popper,g=A.popperRect,I=A.placement,w=A.variation,E=A.offsets,Y=A.position,C=A.gpuAcceleration,M=A.adaptive,F=A.roundOffsets,c=A.isFixed,i=E.x,s=void 0===i?0:i,N=E.y,U=void 0===N?0:N,D="function"==typeof F?F({x:s,y:U}):{x:s,y:U};s=D.x,U=D.y;var G=E.hasOwnProperty("x"),y=E.hasOwnProperty("y"),h=DA,z=sA,j=window;if(M){var e=ZA(Q),H="clientHeight",J="clientWidth";if(e===oA(Q)&&"static"!==dA(e=uA(Q)).position&&"absolute"===Y&&(H="scrollHeight",J="scrollWidth"),I===sA||(I===DA||I===UA)&&w===zA)z=NA,U-=(c&&e===j&&j.visualViewport?j.visualViewport.height:e[H])-g.height,U*=C?1:-1;if(I===DA||(I===sA||I===NA)&&w===zA)h=UA,s-=(c&&e===j&&j.visualViewport?j.visualViewport.width:e[J])-g.width,s*=C?1:-1}var t,R=Object.assign({position:Y},M&&$A),o=!0===F?function(A,B){var Q=A.x,g=A.y,I=B.devicePixelRatio||1;return{x:SA(Q*I)/I||0,y:SA(g*I)/I||0}}({x:s,y:U},oA(Q)):{x:s,y:U};return s=o.x,U=o.y,C?Object.assign({},R,((t={})[z]=y?"0":"",t[h]=G?"0":"",t.transform=(j.devicePixelRatio||1)<=1?"translate("+s+"px, "+U+"px)":"translate3d("+s+"px, "+U+"px, 0)",t)):Object.assign({},R,((B={})[z]=y?U+"px":"",B[h]=G?s+"px":"",B.transform="",B))}var BB={passive:!0};var QB={left:"right",right:"left",bottom:"top",top:"bottom"};function gB(A){return A.replace(/left|right|bottom|top/g,(function(A){return QB[A]}))}var IB={start:"end",end:"start"};function wB(A){return A.replace(/start|end/g,(function(A){return IB[A]}))}function EB(A){var B=oA(A);return{scrollLeft:B.pageXOffset,scrollTop:B.pageYOffset}}function YB(A){return TA(uA(A)).left+EB(A).scrollLeft}function CB(A){var B=dA(A),Q=B.overflow,g=B.overflowX,I=B.overflowY;return/auto|scroll|overlay|hidden/.test(Q+I+g)}function MB(A){return["html","body","#document"].indexOf(RA(A))>=0?A.ownerDocument.body:LA(A)&&CB(A)?A:MB(pA(A))}function FB(A,B){var Q;void 0===B&&(B=[]);var g=MB(A),I=g===(null==(Q=A.ownerDocument)?void 0:Q.body),w=oA(g),E=I?[w].concat(w.visualViewport||[],CB(g)?g:[]):g,Y=B.concat(E);return I?Y:Y.concat(FB(pA(E)))}function cB(A){return Object.assign({},A,{left:A.x,top:A.y,right:A.x+A.width,bottom:A.y+A.height})}function iB(A,B,Q){return B===jA?cB(function(A,B){var Q=oA(A),g=uA(A),I=Q.visualViewport,w=g.clientWidth,E=g.clientHeight,Y=0,C=0;if(I){w=I.width,E=I.height;var M=lA();(M||!M&&"fixed"===B)&&(Y=I.offsetLeft,C=I.offsetTop)}return{width:w,height:E,x:Y+YB(A),y:C}}(A,Q)):xA(B)?function(A,B){var Q=TA(A,!1,"fixed"===B);return Q.top=Q.top+A.clientTop,Q.left=Q.left+A.clientLeft,Q.bottom=Q.top+A.clientHeight,Q.right=Q.left+A.clientWidth,Q.width=A.clientWidth,Q.height=A.clientHeight,Q.x=Q.left,Q.y=Q.top,Q}(B,Q):cB(function(A){var B,Q=uA(A),g=EB(A),I=null==(B=A.ownerDocument)?void 0:B.body,w=aA(Q.scrollWidth,Q.clientWidth,I?I.scrollWidth:0,I?I.clientWidth:0),E=aA(Q.scrollHeight,Q.clientHeight,I?I.scrollHeight:0,I?I.clientHeight:0),Y=-g.scrollLeft+YB(A),C=-g.scrollTop;return"rtl"===dA(I||Q).direction&&(Y+=aA(Q.clientWidth,I?I.clientWidth:0)-w),{width:w,height:E,x:Y,y:C}}(uA(A)))}function sB(A,B,Q,g){var I="clippingParents"===B?function(A){var B=FB(pA(A)),Q=["absolute","fixed"].indexOf(dA(A).position)>=0&&LA(A)?ZA(A):A;return xA(Q)?B.filter((function(A){return xA(A)&&mA(A,Q)&&"body"!==RA(A)})):[]}(A):[].concat(B),w=[].concat(I,[Q]),E=w[0],Y=w.reduce((function(B,Q){var I=iB(A,Q,g);return B.top=aA(I.top,B.top),B.right=WA(I.right,B.right),B.bottom=WA(I.bottom,B.bottom),B.left=aA(I.left,B.left),B}),iB(A,E,g));return Y.width=Y.right-Y.left,Y.height=Y.bottom-Y.top,Y.x=Y.left,Y.y=Y.top,Y}function NB(A){var B,Q=A.reference,g=A.element,I=A.placement,w=I?kA(I):null,E=I?_A(I):null,Y=Q.x+Q.width/2-g.width/2,C=Q.y+Q.height/2-g.height/2;switch(w){case sA:B={x:Y,y:Q.y-g.height};break;case NA:B={x:Y,y:Q.y+Q.height};break;case UA:B={x:Q.x+Q.width,y:C};break;case DA:B={x:Q.x-g.width,y:C};break;default:B={x:Q.x,y:Q.y}}var M=w?OA(w):null;if(null!=M){var F="y"===M?"height":"width";switch(E){case hA:B[M]=B[M]-(Q[F]/2-g[F]/2);break;case zA:B[M]=B[M]+(Q[F]/2-g[F]/2)}}return B}function UB(A,B){void 0===B&&(B={});var Q=B,g=Q.placement,I=void 0===g?A.placement:g,w=Q.strategy,E=void 0===w?A.strategy:w,Y=Q.boundary,C=void 0===Y?"clippingParents":Y,M=Q.rootBoundary,F=void 0===M?jA:M,c=Q.elementContext,i=void 0===c?eA:c,s=Q.altBoundary,N=void 0!==s&&s,U=Q.padding,D=void 0===U?0:U,G=PA("number"!=typeof D?D:vA(D,yA)),y=i===eA?"reference":eA,h=A.rects.popper,z=A.elements[N?y:i],j=sB(xA(z)?z:z.contextElement||uA(A.elements.popper),C,F,E),e=TA(A.elements.reference),H=NB({reference:e,element:h,strategy:"absolute",placement:I}),J=cB(Object.assign({},h,H)),t=i===eA?J:e,R={top:j.top-t.top+G.top,bottom:t.bottom-j.bottom+G.bottom,left:j.left-t.left+G.left,right:t.right-j.right+G.right},o=A.modifiersData.offset;if(i===eA&&o){var x=o[I];Object.keys(R).forEach((function(A){var B=[UA,NA].indexOf(A)>=0?1:-1,Q=[sA,NA].indexOf(A)>=0?"y":"x";R[A]+=x[Q]*B}))}return R}function DB(A,B){void 0===B&&(B={});var Q=B,g=Q.placement,I=Q.boundary,w=Q.rootBoundary,E=Q.padding,Y=Q.flipVariations,C=Q.allowedAutoPlacements,M=void 0===C?JA:C,F=_A(g),c=F?Y?HA:HA.filter((function(A){return _A(A)===F})):yA,i=c.filter((function(A){return M.indexOf(A)>=0}));0===i.length&&(i=c);var s=i.reduce((function(B,Q){return B[Q]=UB(A,{placement:Q,boundary:I,rootBoundary:w,padding:E})[kA(Q)],B}),{});return Object.keys(s).sort((function(A,B){return s[A]-s[B]}))}var GB={name:"flip",enabled:!0,phase:"main",fn:function(A){var B=A.state,Q=A.options,g=A.name;if(!B.modifiersData[g]._skip){for(var I=Q.mainAxis,w=void 0===I||I,E=Q.altAxis,Y=void 0===E||E,C=Q.fallbackPlacements,M=Q.padding,F=Q.boundary,c=Q.rootBoundary,i=Q.altBoundary,s=Q.flipVariations,N=void 0===s||s,U=Q.allowedAutoPlacements,D=B.options.placement,G=kA(D),y=C||(G===D||!N?[gB(D)]:function(A){if(kA(A)===GA)return[];var B=gB(A);return[wB(A),B,wB(B)]}(D)),h=[D].concat(y).reduce((function(A,Q){return A.concat(kA(Q)===GA?DB(B,{placement:Q,boundary:F,rootBoundary:c,padding:M,flipVariations:N,allowedAutoPlacements:U}):Q)}),[]),z=B.rects.reference,j=B.rects.popper,e=new Map,H=!0,J=h[0],t=0;t<h.length;t++){var R=h[t],o=kA(R),x=_A(R)===hA,L=[sA,NA].indexOf(o)>=0,n=L?"width":"height",r=UB(B,{placement:R,boundary:F,rootBoundary:c,altBoundary:i,padding:M}),k=L?x?UA:DA:x?NA:sA;z[n]>j[n]&&(k=gB(k));var a=gB(k),W=[];if(w&&W.push(r[o]<=0),Y&&W.push(r[k]<=0,r[a]<=0),W.every((function(A){return A}))){J=R,H=!1;break}e.set(R,W)}if(H)for(var S=function(A){var B=h.find((function(B){var Q=e.get(B);if(Q)return Q.slice(0,A).every((function(A){return A}))}));if(B)return J=B,"break"},K=N?3:1;K>0;K--){if("break"===S(K))break}B.placement!==J&&(B.modifiersData[g]._skip=!0,B.placement=J,B.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function yB(A,B,Q){return void 0===Q&&(Q={x:0,y:0}),{top:A.top-B.height-Q.y,right:A.right-B.width+Q.x,bottom:A.bottom-B.height+Q.y,left:A.left-B.width-Q.x}}function hB(A){return[sA,UA,NA,DA].some((function(B){return A[B]>=0}))}var zB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(A){var B=A.state,Q=A.options,g=A.name,I=Q.offset,w=void 0===I?[0,0]:I,E=JA.reduce((function(A,Q){return A[Q]=function(A,B,Q){var g=kA(A),I=[DA,sA].indexOf(g)>=0?-1:1,w="function"==typeof Q?Q(Object.assign({},B,{placement:A})):Q,E=w[0],Y=w[1];return E=E||0,Y=(Y||0)*I,[DA,UA].indexOf(g)>=0?{x:Y,y:E}:{x:E,y:Y}}(Q,B.rects,w),A}),{}),Y=E[B.placement],C=Y.x,M=Y.y;null!=B.modifiersData.popperOffsets&&(B.modifiersData.popperOffsets.x+=C,B.modifiersData.popperOffsets.y+=M),B.modifiersData[g]=E}};var jB={name:"preventOverflow",enabled:!0,phase:"main",fn:function(A){var B=A.state,Q=A.options,g=A.name,I=Q.mainAxis,w=void 0===I||I,E=Q.altAxis,Y=void 0!==E&&E,C=Q.boundary,M=Q.rootBoundary,F=Q.altBoundary,c=Q.padding,i=Q.tether,s=void 0===i||i,N=Q.tetherOffset,U=void 0===N?0:N,D=UB(B,{boundary:C,rootBoundary:M,padding:c,altBoundary:F}),G=kA(B.placement),y=_A(B.placement),h=!y,z=OA(G),j="x"===z?"y":"x",e=B.modifiersData.popperOffsets,H=B.rects.reference,J=B.rects.popper,t="function"==typeof U?U(Object.assign({},B.rects,{placement:B.placement})):U,R="number"==typeof t?{mainAxis:t,altAxis:t}:Object.assign({mainAxis:0,altAxis:0},t),o=B.modifiersData.offset?B.modifiersData.offset[B.placement]:null,x={x:0,y:0};if(e){if(w){var L,n="y"===z?sA:DA,r="y"===z?NA:UA,k="y"===z?"height":"width",a=e[z],W=a+D[n],S=a-D[r],K=s?-J[k]/2:0,l=y===hA?H[k]:J[k],T=y===hA?-J[k]:-H[k],V=B.elements.arrow,m=s&&V?VA(V):{width:0,height:0},d=B.modifiersData["arrow#persistent"]?B.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},b=d[n],u=d[r],p=fA(0,H[k],m[k]),X=h?H[k]/2-K-p-b-R.mainAxis:l-p-b-R.mainAxis,Z=h?-H[k]/2+K+p+u+R.mainAxis:T+p+u+R.mainAxis,O=B.elements.arrow&&ZA(B.elements.arrow),f=O?"y"===z?O.clientTop||0:O.clientLeft||0:0,P=null!=(L=null==o?void 0:o[z])?L:0,v=a+Z-P,q=fA(s?WA(W,a+X-P-f):W,a,s?aA(S,v):S);e[z]=q,x[z]=q-a}if(Y){var _,$="x"===z?sA:DA,AA="x"===z?NA:UA,BA=e[j],QA="y"===j?"height":"width",gA=BA+D[$],IA=BA-D[AA],wA=-1!==[sA,DA].indexOf(G),EA=null!=(_=null==o?void 0:o[j])?_:0,YA=wA?gA:BA-H[QA]-J[QA]-EA+R.altAxis,CA=wA?BA+H[QA]+J[QA]-EA-R.altAxis:IA,MA=s&&wA?function(A,B,Q){var g=fA(A,B,Q);return g>Q?Q:g}(YA,BA,CA):fA(s?YA:gA,BA,s?CA:IA);e[j]=MA,x[j]=MA-BA}B.modifiersData[g]=x}},requiresIfExists:["offset"]};function eB(A,B,Q){void 0===Q&&(Q=!1);var g,I,w=LA(B),E=LA(B)&&function(A){var B=A.getBoundingClientRect(),Q=SA(B.width)/A.offsetWidth||1,g=SA(B.height)/A.offsetHeight||1;return 1!==Q||1!==g}(B),Y=uA(B),C=TA(A,E,Q),M={scrollLeft:0,scrollTop:0},F={x:0,y:0};return(w||!w&&!Q)&&(("body"!==RA(B)||CB(Y))&&(M=(g=B)!==oA(g)&&LA(g)?{scrollLeft:(I=g).scrollLeft,scrollTop:I.scrollTop}:EB(g)),LA(B)?((F=TA(B,!0)).x+=B.clientLeft,F.y+=B.clientTop):Y&&(F.x=YB(Y))),{x:C.left+M.scrollLeft-F.x,y:C.top+M.scrollTop-F.y,width:C.width,height:C.height}}function HB(A){var B=new Map,Q=new Set,g=[];function I(A){Q.add(A.name),[].concat(A.requires||[],A.requiresIfExists||[]).forEach((function(A){if(!Q.has(A)){var g=B.get(A);g&&I(g)}})),g.push(A)}return A.forEach((function(A){B.set(A.name,A)})),A.forEach((function(A){Q.has(A.name)||I(A)})),g}var JB={placement:"bottom",modifiers:[],strategy:"absolute"};function tB(){for(var A=arguments.length,B=new Array(A),Q=0;Q<A;Q++)B[Q]=arguments[Q];return!B.some((function(A){return!(A&&"function"==typeof A.getBoundingClientRect)}))}function RB(A){void 0===A&&(A={});var B=A,Q=B.defaultModifiers,g=void 0===Q?[]:Q,I=B.defaultOptions,w=void 0===I?JB:I;return function(A,B,Q){void 0===Q&&(Q=w);var I,E,Y={placement:"bottom",orderedModifiers:[],options:Object.assign({},JB,w),modifiersData:{},elements:{reference:A,popper:B},attributes:{},styles:{}},C=[],M=!1,F={state:Y,setOptions:function(Q){var I="function"==typeof Q?Q(Y.options):Q;c(),Y.options=Object.assign({},w,Y.options,I),Y.scrollParents={reference:xA(A)?FB(A):A.contextElement?FB(A.contextElement):[],popper:FB(B)};var E,M,i=function(A){var B=HB(A);return tA.reduce((function(A,Q){return A.concat(B.filter((function(A){return A.phase===Q})))}),[])}((E=[].concat(g,Y.options.modifiers),M=E.reduce((function(A,B){var Q=A[B.name];return A[B.name]=Q?Object.assign({},Q,B,{options:Object.assign({},Q.options,B.options),data:Object.assign({},Q.data,B.data)}):B,A}),{}),Object.keys(M).map((function(A){return M[A]}))));return Y.orderedModifiers=i.filter((function(A){return A.enabled})),Y.orderedModifiers.forEach((function(A){var B=A.name,Q=A.options,g=void 0===Q?{}:Q,I=A.effect;if("function"==typeof I){var w=I({state:Y,name:B,instance:F,options:g}),E=function(){};C.push(w||E)}})),F.update()},forceUpdate:function(){if(!M){var A=Y.elements,B=A.reference,Q=A.popper;if(tB(B,Q)){Y.rects={reference:eB(B,ZA(Q),"fixed"===Y.options.strategy),popper:VA(Q)},Y.reset=!1,Y.placement=Y.options.placement,Y.orderedModifiers.forEach((function(A){return Y.modifiersData[A.name]=Object.assign({},A.data)}));for(var g=0;g<Y.orderedModifiers.length;g++)if(!0!==Y.reset){var I=Y.orderedModifiers[g],w=I.fn,E=I.options,C=void 0===E?{}:E,c=I.name;"function"==typeof w&&(Y=w({state:Y,options:C,name:c,instance:F})||Y)}else Y.reset=!1,g=-1}}},update:(I=function(){return new Promise((function(A){F.forceUpdate(),A(Y)}))},function(){return E||(E=new Promise((function(A){Promise.resolve().then((function(){E=void 0,A(I())}))}))),E}),destroy:function(){c(),M=!0}};if(!tB(A,B))return F;function c(){C.forEach((function(A){return A()})),C=[]}return F.setOptions(Q).then((function(A){!M&&Q.onFirstUpdate&&Q.onFirstUpdate(A)})),F}}var oB=RB({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(A){var B=A.state,Q=A.instance,g=A.options,I=g.scroll,w=void 0===I||I,E=g.resize,Y=void 0===E||E,C=oA(B.elements.popper),M=[].concat(B.scrollParents.reference,B.scrollParents.popper);return w&&M.forEach((function(A){A.addEventListener("scroll",Q.update,BB)})),Y&&C.addEventListener("resize",Q.update,BB),function(){w&&M.forEach((function(A){A.removeEventListener("scroll",Q.update,BB)})),Y&&C.removeEventListener("resize",Q.update,BB)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(A){var B=A.state,Q=A.name;B.modifiersData[Q]=NB({reference:B.rects.reference,element:B.rects.popper,strategy:"absolute",placement:B.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(A){var B=A.state,Q=A.options,g=Q.gpuAcceleration,I=void 0===g||g,w=Q.adaptive,E=void 0===w||w,Y=Q.roundOffsets,C=void 0===Y||Y,M={placement:kA(B.placement),variation:_A(B.placement),popper:B.elements.popper,popperRect:B.rects.popper,gpuAcceleration:I,isFixed:"fixed"===B.options.strategy};null!=B.modifiersData.popperOffsets&&(B.styles.popper=Object.assign({},B.styles.popper,AB(Object.assign({},M,{offsets:B.modifiersData.popperOffsets,position:B.options.strategy,adaptive:E,roundOffsets:C})))),null!=B.modifiersData.arrow&&(B.styles.arrow=Object.assign({},B.styles.arrow,AB(Object.assign({},M,{offsets:B.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:C})))),B.attributes.popper=Object.assign({},B.attributes.popper,{"data-popper-placement":B.placement})},data:{}},rA,zB,GB,jB,qA,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(A){var B=A.state,Q=A.name,g=B.rects.reference,I=B.rects.popper,w=B.modifiersData.preventOverflow,E=UB(B,{elementContext:"reference"}),Y=UB(B,{altBoundary:!0}),C=yB(E,g),M=yB(Y,I,w),F=hB(C),c=hB(M);B.modifiersData[Q]={referenceClippingOffsets:C,popperEscapeOffsets:M,isReferenceHidden:F,hasPopperEscaped:c},B.attributes.popper=Object.assign({},B.attributes.popper,{"data-popper-reference-hidden":F,"data-popper-escaped":c})}}]}),xB="tippy-content",LB="tippy-arrow",nB="tippy-svg-arrow",rB={passive:!0,capture:!0},kB=function(){return document.body};function aB(A,B,Q){if(Array.isArray(A)){var g=A[B];return null==g?Array.isArray(Q)?Q[B]:Q:g}return A}function WB(A,B){var Q={}.toString.call(A);return 0===Q.indexOf("[object")&&Q.indexOf(B+"]")>-1}function SB(A,B){return"function"==typeof A?A.apply(void 0,B):A}function KB(A,B){return 0===B?A:function(g){clearTimeout(Q),Q=setTimeout((function(){A(g)}),B)};var Q}function lB(A){return[].concat(A)}function TB(A,B){-1===A.indexOf(B)&&A.push(B)}function VB(A){return[].slice.call(A)}function mB(A){return Object.keys(A).reduce((function(B,Q){return void 0!==A[Q]&&(B[Q]=A[Q]),B}),{})}function dB(){return document.createElement("div")}function bB(A){return["Element","Fragment"].some((function(B){return WB(A,B)}))}function uB(A){return bB(A)?[A]:function(A){return WB(A,"NodeList")}(A)?VB(A):Array.isArray(A)?A:VB(document.querySelectorAll(A))}function pB(A,B){A.forEach((function(A){A&&(A.style.transitionDuration=B+"ms")}))}function XB(A,B){A.forEach((function(A){A&&A.setAttribute("data-state",B)}))}function ZB(A,B,Q){var g=B+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(B){A[g](B,Q)}))}function OB(A,B){for(var Q=B;Q;){var g;if(A.contains(Q))return!0;Q=null==Q.getRootNode||null==(g=Q.getRootNode())?void 0:g.host}return!1}var fB={isTouch:!1},PB=0;function vB(){fB.isTouch||(fB.isTouch=!0,window.performance&&document.addEventListener("mousemove",qB))}function qB(){var A=performance.now();A-PB<20&&(fB.isTouch=!1,document.removeEventListener("mousemove",qB)),PB=A}function _B(){var A,B=document.activeElement;if((A=B)&&A._tippy&&A._tippy.reference===A){var Q=B._tippy;B.blur&&!Q.state.isVisible&&B.blur()}}var $B=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,AQ=Object.assign({appendTo:kB,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),BQ=Object.keys(AQ);function QQ(A){var B=(A.plugins||[]).reduce((function(B,Q){var g,I=Q.name,w=Q.defaultValue;I&&(B[I]=void 0!==A[I]?A[I]:null!=(g=AQ[I])?g:w);return B}),{});return Object.assign({},A,B)}function gQ(A,B){var Q=Object.assign({},B,{content:SB(B.content,[A])},B.ignoreAttributes?{}:function(A,B){return(B?Object.keys(QQ(Object.assign({},AQ,{plugins:B}))):BQ).reduce((function(B,Q){var g=(A.getAttribute("data-tippy-"+Q)||"").trim();if(!g)return B;if("content"===Q)B[Q]=g;else try{B[Q]=JSON.parse(g)}catch(A){B[Q]=g}return B}),{})}(A,B.plugins));return Q.aria=Object.assign({},AQ.aria,Q.aria),Q.aria={expanded:"auto"===Q.aria.expanded?B.interactive:Q.aria.expanded,content:"auto"===Q.aria.content?B.interactive?null:"describedby":Q.aria.content},Q}function IQ(A,B){A.innerHTML=B}function wQ(A){var B=dB();return!0===A?B.className=LB:(B.className=nB,bB(A)?B.appendChild(A):IQ(B,A)),B}function EQ(A,B){bB(B.content)?(IQ(A,""),A.appendChild(B.content)):"function"!=typeof B.content&&(B.allowHTML?IQ(A,B.content):A.textContent=B.content)}function YQ(A){var B=A.firstElementChild,Q=VB(B.children);return{box:B,content:Q.find((function(A){return A.classList.contains(xB)})),arrow:Q.find((function(A){return A.classList.contains(LB)||A.classList.contains(nB)})),backdrop:Q.find((function(A){return A.classList.contains("tippy-backdrop")}))}}function CQ(A){var B=dB(),Q=dB();Q.className="tippy-box",Q.setAttribute("data-state","hidden"),Q.setAttribute("tabindex","-1");var g=dB();function I(Q,g){var I=YQ(B),w=I.box,E=I.content,Y=I.arrow;g.theme?w.setAttribute("data-theme",g.theme):w.removeAttribute("data-theme"),"string"==typeof g.animation?w.setAttribute("data-animation",g.animation):w.removeAttribute("data-animation"),g.inertia?w.setAttribute("data-inertia",""):w.removeAttribute("data-inertia"),w.style.maxWidth="number"==typeof g.maxWidth?g.maxWidth+"px":g.maxWidth,g.role?w.setAttribute("role",g.role):w.removeAttribute("role"),Q.content===g.content&&Q.allowHTML===g.allowHTML||EQ(E,A.props),g.arrow?Y?Q.arrow!==g.arrow&&(w.removeChild(Y),w.appendChild(wQ(g.arrow))):w.appendChild(wQ(g.arrow)):Y&&w.removeChild(Y)}return g.className=xB,g.setAttribute("data-state","hidden"),EQ(g,A.props),B.appendChild(Q),Q.appendChild(g),I(A.props,A.props),{popper:B,onUpdate:I}}CQ.$$tippy=!0;var MQ=1,FQ=[],cQ=[];function iQ(A,B){var Q,g,I,w,E,Y,C,M,F=gQ(A,Object.assign({},AQ,QQ(mB(B)))),c=!1,i=!1,s=!1,N=!1,U=[],D=KB(O,F.interactiveDebounce),G=MQ++,y=(M=F.plugins).filter((function(A,B){return M.indexOf(A)===B})),h={id:G,reference:A,popper:dB(),popperInstance:null,props:F,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(Q),clearTimeout(g),cancelAnimationFrame(I)},setProps:function(B){if(h.state.isDestroyed)return;a("onBeforeUpdate",[h,B]),X();var Q=h.props,g=gQ(A,Object.assign({},Q,mB(B),{ignoreAttributes:!0}));h.props=g,p(),Q.interactiveDebounce!==g.interactiveDebounce&&(K(),D=KB(O,g.interactiveDebounce));Q.triggerTarget&&!g.triggerTarget?lB(Q.triggerTarget).forEach((function(A){A.removeAttribute("aria-expanded")})):g.triggerTarget&&A.removeAttribute("aria-expanded");S(),k(),e&&e(Q,g);h.popperInstance&&(q(),$().forEach((function(A){requestAnimationFrame(A._tippy.popperInstance.forceUpdate)})));a("onAfterUpdate",[h,B])},setContent:function(A){h.setProps({content:A})},show:function(){var A=h.state.isVisible,B=h.state.isDestroyed,Q=!h.state.isEnabled,g=fB.isTouch&&!h.props.touch,I=aB(h.props.duration,0,AQ.duration);if(A||B||Q||g)return;if(x().hasAttribute("disabled"))return;if(a("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,o()&&(j.style.visibility="visible");k(),m(),h.state.isMounted||(j.style.transition="none");if(o()){var w=n();pB([w.box,w.content],0)}Y=function(){var A;if(h.state.isVisible&&!N){if(N=!0,j.offsetHeight,j.style.transition=h.props.moveTransition,o()&&h.props.animation){var B=n(),Q=B.box,g=B.content;pB([Q,g],I),XB([Q,g],"visible")}W(),S(),TB(cQ,h),null==(A=h.popperInstance)||A.forceUpdate(),a("onMount",[h]),h.props.animation&&o()&&function(A,B){b(A,B)}(I,(function(){h.state.isShown=!0,a("onShown",[h])}))}},function(){var A,B=h.props.appendTo,Q=x();A=h.props.interactive&&B===kB||"parent"===B?Q.parentNode:SB(B,[Q]);A.contains(j)||A.appendChild(j);h.state.isMounted=!0,q()}()},hide:function(){var A=!h.state.isVisible,B=h.state.isDestroyed,Q=!h.state.isEnabled,g=aB(h.props.duration,1,AQ.duration);if(A||B||Q)return;if(a("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,N=!1,c=!1,o()&&(j.style.visibility="hidden");if(K(),d(),k(!0),o()){var I=n(),w=I.box,E=I.content;h.props.animation&&(pB([w,E],g),XB([w,E],"hidden"))}W(),S(),h.props.animation?o()&&function(A,B){b(A,(function(){!h.state.isVisible&&j.parentNode&&j.parentNode.contains(j)&&B()}))}(g,h.unmount):h.unmount()},hideWithInteractivity:function(A){L().addEventListener("mousemove",D),TB(FQ,D),D(A)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){h.state.isVisible&&h.hide();if(!h.state.isMounted)return;_(),$().forEach((function(A){A._tippy.unmount()})),j.parentNode&&j.parentNode.removeChild(j);cQ=cQ.filter((function(A){return A!==h})),h.state.isMounted=!1,a("onHidden",[h])},destroy:function(){if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),X(),delete A._tippy,h.state.isDestroyed=!0,a("onDestroy",[h])}};if(!F.render)return h;var z=F.render(h),j=z.popper,e=z.onUpdate;j.setAttribute("data-tippy-root",""),j.id="tippy-"+h.id,h.popper=j,A._tippy=h,j._tippy=h;var H=y.map((function(A){return A.fn(h)})),J=A.hasAttribute("aria-expanded");return p(),S(),k(),a("onCreate",[h]),F.showOnCreate&&AA(),j.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),j.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",D)})),h;function t(){var A=h.props.touch;return Array.isArray(A)?A:[A,0]}function R(){return"hold"===t()[0]}function o(){var A;return!(null==(A=h.props.render)||!A.$$tippy)}function x(){return C||A}function L(){var A,B,Q=x().parentNode;return Q?null!=(B=lB(Q)[0])&&null!=(A=B.ownerDocument)&&A.body?B.ownerDocument:document:document}function n(){return YQ(j)}function r(A){return h.state.isMounted&&!h.state.isVisible||fB.isTouch||w&&"focus"===w.type?0:aB(h.props.delay,A?0:1,AQ.delay)}function k(A){void 0===A&&(A=!1),j.style.pointerEvents=h.props.interactive&&!A?"":"none",j.style.zIndex=""+h.props.zIndex}function a(A,B,Q){var g;(void 0===Q&&(Q=!0),H.forEach((function(Q){Q[A]&&Q[A].apply(Q,B)})),Q)&&(g=h.props)[A].apply(g,B)}function W(){var B=h.props.aria;if(B.content){var Q="aria-"+B.content,g=j.id;lB(h.props.triggerTarget||A).forEach((function(A){var B=A.getAttribute(Q);if(h.state.isVisible)A.setAttribute(Q,B?B+" "+g:g);else{var I=B&&B.replace(g,"").trim();I?A.setAttribute(Q,I):A.removeAttribute(Q)}}))}}function S(){!J&&h.props.aria.expanded&&lB(h.props.triggerTarget||A).forEach((function(A){h.props.interactive?A.setAttribute("aria-expanded",h.state.isVisible&&A===x()?"true":"false"):A.removeAttribute("aria-expanded")}))}function K(){L().removeEventListener("mousemove",D),FQ=FQ.filter((function(A){return A!==D}))}function l(B){if(!fB.isTouch||!s&&"mousedown"!==B.type){var Q=B.composedPath&&B.composedPath()[0]||B.target;if(!h.props.interactive||!OB(j,Q)){if(lB(h.props.triggerTarget||A).some((function(A){return OB(A,Q)}))){if(fB.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else a("onClickOutside",[h,B]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),i=!0,setTimeout((function(){i=!1})),h.state.isMounted||d())}}}function T(){s=!0}function V(){s=!1}function m(){var A=L();A.addEventListener("mousedown",l,!0),A.addEventListener("touchend",l,rB),A.addEventListener("touchstart",V,rB),A.addEventListener("touchmove",T,rB)}function d(){var A=L();A.removeEventListener("mousedown",l,!0),A.removeEventListener("touchend",l,rB),A.removeEventListener("touchstart",V,rB),A.removeEventListener("touchmove",T,rB)}function b(A,B){var Q=n().box;function g(A){A.target===Q&&(ZB(Q,"remove",g),B())}if(0===A)return B();ZB(Q,"remove",E),ZB(Q,"add",g),E=g}function u(B,Q,g){void 0===g&&(g=!1),lB(h.props.triggerTarget||A).forEach((function(A){A.addEventListener(B,Q,g),U.push({node:A,eventType:B,handler:Q,options:g})}))}function p(){var A;R()&&(u("touchstart",Z,{passive:!0}),u("touchend",f,{passive:!0})),(A=h.props.trigger,A.split(/\s+/).filter(Boolean)).forEach((function(A){if("manual"!==A)switch(u(A,Z),A){case"mouseenter":u("mouseleave",f);break;case"focus":u($B?"focusout":"blur",P);break;case"focusin":u("focusout",P)}}))}function X(){U.forEach((function(A){var B=A.node,Q=A.eventType,g=A.handler,I=A.options;B.removeEventListener(Q,g,I)})),U=[]}function Z(A){var B,Q=!1;if(h.state.isEnabled&&!v(A)&&!i){var g="focus"===(null==(B=w)?void 0:B.type);w=A,C=A.currentTarget,S(),!h.state.isVisible&&WB(A,"MouseEvent")&&FQ.forEach((function(B){return B(A)})),"click"===A.type&&(h.props.trigger.indexOf("mouseenter")<0||c)&&!1!==h.props.hideOnClick&&h.state.isVisible?Q=!0:AA(A),"click"===A.type&&(c=!Q),Q&&!g&&BA(A)}}function O(A){var B=A.target,Q=x().contains(B)||j.contains(B);if("mousemove"!==A.type||!Q){var g=$().concat(j).map((function(A){var B,Q=null==(B=A._tippy.popperInstance)?void 0:B.state;return Q?{popperRect:A.getBoundingClientRect(),popperState:Q,props:F}:null})).filter(Boolean);(function(A,B){var Q=B.clientX,g=B.clientY;return A.every((function(A){var B=A.popperRect,I=A.popperState,w=A.props.interactiveBorder,E=I.placement.split("-")[0],Y=I.modifiersData.offset;if(!Y)return!0;var C="bottom"===E?Y.top.y:0,M="top"===E?Y.bottom.y:0,F="right"===E?Y.left.x:0,c="left"===E?Y.right.x:0,i=B.top-g+C>w,s=g-B.bottom-M>w,N=B.left-Q+F>w,U=Q-B.right-c>w;return i||s||N||U}))})(g,A)&&(K(),BA(A))}}function f(A){v(A)||h.props.trigger.indexOf("click")>=0&&c||(h.props.interactive?h.hideWithInteractivity(A):BA(A))}function P(A){h.props.trigger.indexOf("focusin")<0&&A.target!==x()||h.props.interactive&&A.relatedTarget&&j.contains(A.relatedTarget)||BA(A)}function v(A){return!!fB.isTouch&&R()!==A.type.indexOf("touch")>=0}function q(){_();var B=h.props,Q=B.popperOptions,g=B.placement,I=B.offset,w=B.getReferenceClientRect,E=B.moveTransition,C=o()?YQ(j).arrow:null,M=w?{getBoundingClientRect:w,contextElement:w.contextElement||x()}:A,F={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(A){var B=A.state;if(o()){var Q=n().box;["placement","reference-hidden","escaped"].forEach((function(A){"placement"===A?Q.setAttribute("data-placement",B.placement):B.attributes.popper["data-popper-"+A]?Q.setAttribute("data-"+A,""):Q.removeAttribute("data-"+A)})),B.attributes.popper={}}}},c=[{name:"offset",options:{offset:I}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!E}},F];o()&&C&&c.push({name:"arrow",options:{element:C,padding:3}}),c.push.apply(c,(null==Q?void 0:Q.modifiers)||[]),h.popperInstance=oB(M,j,Object.assign({},Q,{placement:g,onFirstUpdate:Y,modifiers:c}))}function _(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function $(){return VB(j.querySelectorAll("[data-tippy-root]"))}function AA(A){h.clearDelayTimeouts(),A&&a("onTrigger",[h,A]),m();var B=r(!0),g=t(),I=g[0],w=g[1];fB.isTouch&&"hold"===I&&w&&(B=w),B?Q=setTimeout((function(){h.show()}),B):h.show()}function BA(A){if(h.clearDelayTimeouts(),a("onUntrigger",[h,A]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(A.type)>=0&&c)){var B=r(!1);B?g=setTimeout((function(){h.state.isVisible&&h.hide()}),B):I=requestAnimationFrame((function(){h.hide()}))}}else d()}}function sQ(A,B){void 0===B&&(B={});var Q=AQ.plugins.concat(B.plugins||[]);document.addEventListener("touchstart",vB,rB),window.addEventListener("blur",_B);var g=Object.assign({},B,{plugins:Q}),I=uB(A).reduce((function(A,B){var Q=B&&iQ(B,g);return Q&&A.push(Q),A}),[]);return bB(A)?I[0]:I}sQ.defaultProps=AQ,sQ.setDefaultProps=function(A){Object.keys(A).forEach((function(B){AQ[B]=A[B]}))},sQ.currentInput=fB,Object.assign({},rA,{effect:function(A){var B=A.state,Q={popper:{position:B.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(B.elements.popper.style,Q.popper),B.styles=Q,B.elements.arrow&&Object.assign(B.elements.arrow.style,Q.arrow)}}),sQ.setDefaultProps({render:CQ});class NQ{constructor({editor:A,element:B,view:Q,tippyOptions:g={},updateDelay:I=250,shouldShow:w}){this.preventHide=!1,this.shouldShow=({view:A,state:B,from:Q,to:g})=>{const{doc:I,selection:w}=B,{empty:E}=w,Y=!I.textBetween(Q,g).length&&V(B.selection),C=this.element.contains(document.activeElement);return!(!A.hasFocus()&&!C||E||Y||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:A})=>{var B;this.preventHide?this.preventHide=!1:(null==A?void 0:A.relatedTarget)&&(null===(B=this.element.parentNode)||void 0===B?void 0:B.contains(A.relatedTarget))||(null==A?void 0:A.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=A=>{this.blurHandler({event:A})},this.handleDebouncedUpdate=(A,B)=>{const Q=!(null==B?void 0:B.selection.eq(A.state.selection)),g=!(null==B?void 0:B.doc.eq(A.state.doc));(Q||g)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout((()=>{this.updateHandler(A,Q,g,B)}),this.updateDelay))},this.updateHandler=(A,B,Q,g)=>{var I,w,E;const{state:Y,composing:C}=A,{selection:M}=Y;if(C||!B&&!Q)return;this.createTooltip();const{ranges:F}=M,c=Math.min(...F.map((A=>A.$from.pos))),i=Math.max(...F.map((A=>A.$to.pos)));(null===(I=this.shouldShow)||void 0===I?void 0:I.call(this,{editor:this.editor,element:this.element,view:A,state:Y,oldState:g,from:c,to:i}))?(null===(w=this.tippy)||void 0===w||w.setProps({getReferenceClientRect:(null===(E=this.tippyOptions)||void 0===E?void 0:E.getReferenceClientRect)||(()=>{if(m(Y.selection)){let B=A.nodeDOM(c);if(B){const A=B.dataset.nodeViewWrapper?B:B.querySelector("[data-node-view-wrapper]");if(A&&(B=A.firstChild),B)return B.getBoundingClientRect()}}return d(A,c,i)})}),this.show()):this.hide()},this.editor=A,this.element=B,this.view=Q,this.updateDelay=I,w&&(this.shouldShow=w),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=g,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:A}=this.editor.options,B=!!A.parentElement;!this.tippy&&B&&(this.tippy=sQ(A,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(A,B){const{state:Q}=A,g=Q.selection.from!==Q.selection.to;if(this.updateDelay>0&&g)return void this.handleDebouncedUpdate(A,B);const I=!(null==B?void 0:B.selection.eq(A.state.selection)),w=!(null==B?void 0:B.doc.eq(A.state.doc));this.updateHandler(A,I,w,B)}show(){var A;null===(A=this.tippy)||void 0===A||A.show()}hide(){var A;null===(A=this.tippy)||void 0===A||A.hide()}destroy(){var A,B;(null===(A=this.tippy)||void 0===A?void 0:A.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(B=this.tippy)||void 0===B||B.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const UQ=A=>new O({key:"string"==typeof A.pluginKey?new f(A.pluginKey):A.pluginKey,view:B=>new NQ({view:B,...A})});T.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[UQ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class DQ{getTextContent(A){return b(A,{textSerializers:u(this.editor.schema)})}constructor({editor:A,element:B,view:Q,tippyOptions:g={},shouldShow:I}){this.preventHide=!1,this.shouldShow=({view:A,state:B})=>{const{selection:Q}=B,{$anchor:g,empty:I}=Q,w=1===g.depth,E=g.parent.isTextblock&&!g.parent.type.spec.code&&!g.parent.textContent&&0===g.parent.childCount&&!this.getTextContent(g.parent);return!!(A.hasFocus()&&I&&w&&E&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:A})=>{var B;this.preventHide?this.preventHide=!1:(null==A?void 0:A.relatedTarget)&&(null===(B=this.element.parentNode)||void 0===B?void 0:B.contains(A.relatedTarget))||(null==A?void 0:A.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=A=>{this.blurHandler({event:A})},this.editor=A,this.element=B,this.view=Q,I&&(this.shouldShow=I),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=g,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:A}=this.editor.options,B=!!A.parentElement;!this.tippy&&B&&(this.tippy=sQ(A,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(A,B){var Q,g,I;const{state:w}=A,{doc:E,selection:Y}=w,{from:C,to:M}=Y;if(B&&B.doc.eq(E)&&B.selection.eq(Y))return;this.createTooltip();(null===(Q=this.shouldShow)||void 0===Q?void 0:Q.call(this,{editor:this.editor,view:A,state:w,oldState:B}))?(null===(g=this.tippy)||void 0===g||g.setProps({getReferenceClientRect:(null===(I=this.tippyOptions)||void 0===I?void 0:I.getReferenceClientRect)||(()=>d(A,C,M))}),this.show()):this.hide()}show(){var A;null===(A=this.tippy)||void 0===A||A.show()}hide(){var A;null===(A=this.tippy)||void 0===A||A.hide()}destroy(){var A,B;(null===(A=this.tippy)||void 0===A?void 0:A.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(B=this.tippy)||void 0===B||B.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const GQ=A=>new O({key:"string"==typeof A.pluginKey?new f(A.pluginKey):A.pluginKey,view:B=>new DQ({view:B,...A})});T.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[GQ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const yQ=Q({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(A,{slots:B}){const Q=g(null);return I((()=>{const{updateDelay:B,editor:g,pluginKey:I,shouldShow:w,tippyOptions:E}=A;g.registerPlugin(UQ({updateDelay:B,editor:g,element:Q.value,pluginKey:I,shouldShow:w,tippyOptions:E}))})),w((()=>{const{pluginKey:B,editor:Q}=A;Q.unregisterPlugin(B)})),()=>{var A;return E("div",{ref:Q},null===(A=B.default)||void 0===A?void 0:A.call(B))}}});function hQ(A){return i(((B,Q)=>({get:()=>(B(),A),set(B){A=B,requestAnimationFrame((()=>{requestAnimationFrame((()=>{Q()}))}))}})))}class zQ extends p{constructor(A={}){return super(A),this.contentComponent=null,this.appContext=null,this.reactiveState=hQ(this.view.state),this.reactiveExtensionStorage=hQ(this.extensionStorage),this.on("beforeTransaction",(({nextState:A})=>{this.reactiveState.value=A,this.reactiveExtensionStorage.value=this.extensionStorage})),Y(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(A,B){const Q=super.registerPlugin(A,B);return this.reactiveState&&(this.reactiveState.value=Q),Q}unregisterPlugin(A){const B=super.unregisterPlugin(A);return this.reactiveState&&B&&(this.reactiveState.value=B),B}}const jQ=Q({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(A){const B=g(),Q=C();return M((()=>{const g=A.editor;g&&g.options.element&&B.value&&F((()=>{if(!B.value||!g.options.element.firstChild)return;const A=c(B.value);B.value.append(...g.options.element.childNodes),g.contentComponent=Q.ctx._,Q&&(g.appContext={...Q.appContext,provides:Q.provides}),g.setOptions({element:A}),g.createNodeViews()}))})),w((()=>{const B=A.editor;B&&(B.contentComponent=null,B.appContext=null)})),{rootEl:B}},render(){return E("div",{ref:A=>{this.rootEl=A}})}});Q({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(A,{slots:B}){const Q=g(null);return I((()=>{const{pluginKey:B,editor:g,tippyOptions:I,shouldShow:w}=A;g.registerPlugin(GQ({pluginKey:B,editor:g,element:Q.value,tippyOptions:I,shouldShow:w}))})),w((()=>{const{pluginKey:B,editor:Q}=A;Q.unregisterPlugin(B)})),()=>{var A;return E("div",{ref:Q},null===(A=B.default)||void 0===A?void 0:A.call(B))}}}),Q({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return E(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),Q({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var A,B;return E(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null===(B=(A=this.$slots).default)||void 0===B?void 0:B.call(A))}});class eQ{constructor(A,{props:B={},editor:Q}){this.editor=Q,this.component=Y(A),this.el=document.createElement("div"),this.props=s(B),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var A,B,Q,g;return(null===(B=null===(A=this.renderedComponent.vNode)||void 0===A?void 0:A.component)||void 0===B?void 0:B.exposed)?this.renderedComponent.vNode.component.exposed:null===(g=null===(Q=this.renderedComponent.vNode)||void 0===Q?void 0:Q.component)||void 0===g?void 0:g.proxy}renderComponent(){let A=E(this.component,this.props);this.editor.appContext&&(A.appContext=this.editor.appContext),"undefined"!=typeof document&&this.el&&N(A,this.el);return{vNode:A,destroy:()=>{this.el&&N(null,this.el),this.el=null,A=null},el:this.el?this.el.firstElementChild:null}}updateProps(A={}){Object.entries(A).forEach((([A,B])=>{this.props[A]=B})),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const HQ=A=>A.charAt(0).toUpperCase()+A.slice(1).toLowerCase();function JQ(A){return navigator.platform.toLowerCase().startsWith("mac")||navigator.platform.startsWith("iP")?A.map((A=>"meta"===A?"⌘":"option"===A?"⌥":"shift"===A?"⇧":"alt"===A?"⌥":HQ(A))).join(""):A.map((A=>"meta"===A?"Ctrl":HQ(A))).join("+")}const tQ={name:"underline",title:"Underline",package:"@tiptap/extension-underline",group:"mark",defaults:{},options:[],load:()=>q},RQ={types:["heading","paragraph"]},oQ={name:"textAlign",title:"TextAlign",package:"@tiptap/extension-text-align",group:"node",defaults:RQ,options:[{field:"textAlignTypes",name:"Text align types",type:"json",schema:{default_value:RQ.types},meta:{width:"full",interface:"select-multiple-dropdown",note:"Nodes where the text align attribute should be applied to",options:{choices:[{value:"heading",text:"heading"},{value:"paragraph",text:"paragraph"}],allowOther:!0,previewThreshold:5}}}],load(A){var B;return _.configure({types:null!=(B=A.textAlignTypes)?B:RQ.types})}},xQ={limit:null,mode:"textSize"},LQ={name:"characterCount",title:"CharacterCount",package:"@tiptap/extension-character-count",group:"editor",defaults:xQ,options:[{field:"characterCountLimit",name:"Character count limit",type:"integer",meta:{interface:"input",width:"half",note:"The maximum number of characters that should be allowed"},schema:{default_value:xQ.limit}},{field:"characterCountMode",name:"Character count mode",type:"string",meta:{interface:"select-dropdown",width:"half",note:"The mode by which the size is calculated",options:{choices:[{text:"text",value:"textSize"},{text:"node",value:"nodeSize"}]}},schema:{default_value:xQ.mode}}],load(A){var B,Q;return $.configure({limit:null!=(B=A.characterCountLimit)?B:xQ.limit,mode:null!=(Q=A.characterCountMode)?Q:xQ.mode})}},nQ={name:"subscript",title:"Subscript",package:"@tiptap/extension-subscript",group:"mark",defaults:{},options:[],load:()=>AA},rQ={name:"superscript",title:"Superscript",package:"@tiptap/extension-superscript",group:"mark",defaults:{},options:[],load:()=>BA},kQ={name:"highlight",title