vue-devui 1.6.34-alpha.0 → 1.6.34-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/breadcrumb/index.es.js +6 -1
- package/breadcrumb/index.umd.js +2 -2
- package/category-search/index.es.js +30 -9
- package/category-search/index.umd.js +24 -24
- package/data-grid/index.es.js +6 -1
- package/data-grid/index.umd.js +1 -1
- package/dropdown/index.es.js +6 -1
- package/dropdown/index.umd.js +2 -2
- package/editor-md/index.es.js +6 -1
- package/editor-md/index.umd.js +2 -2
- package/package.json +1 -1
- package/pagination/index.es.js +12 -2
- package/pagination/index.umd.js +2 -2
- package/select/index.es.js +6 -1
- package/select/index.umd.js +2 -2
- package/table/index.es.js +6 -1
- package/table/index.umd.js +2 -2
- package/time-select/index.es.js +6 -1
- package/time-select/index.umd.js +8 -8
- package/types/breadcrumb/src/breadcrumb-item.d.ts +3 -0
- package/types/breadcrumb/src/breadcrumb.d.ts +3 -0
- package/types/category-search/src/category-search-types.d.ts +7 -0
- package/types/dropdown/src/dropdown-types.d.ts +4 -0
- package/types/dropdown/src/dropdown.d.ts +3 -0
- package/types/select/src/select-types.d.ts +4 -0
- package/vue-devui.es.js +37 -11
- package/vue-devui.umd.js +67 -67
package/editor-md/index.umd.js
CHANGED
|
@@ -133,11 +133,11 @@ __p += '`),te&&($+=`' +
|
|
|
133
133
|
function print() { __p += __j.call(arguments, '') }
|
|
134
134
|
`:`;
|
|
135
135
|
`)+$+`return __p
|
|
136
|
-
}`;var X=Ms(function(){return oe(s,N+"return "+$).apply(i,c)});if(X.source=$,Vo(X))throw X;return X}function E4(e){return ue(e).toLowerCase()}function O4(e){return ue(e).toUpperCase()}function I4(e,t,n){if(e=ue(e),e&&(n||t===i))return Hu(e);if(!e||!(t=Ke(t)))return e;var o=st(e),u=st(t),s=Vu(o,u),c=Ku(o,u)+1;return Nt(o,s,c).join("")}function F4(e,t,n){if(e=ue(e),e&&(n||t===i))return e.slice(0,Zu(e)+1);if(!e||!(t=Ke(t)))return e;var o=st(e),u=Ku(o,st(t))+1;return Nt(o,0,u).join("")}function M4(e,t,n){if(e=ue(e),e&&(n||t===i))return e.replace(Hi,"");if(!e||!(t=Ke(t)))return e;var o=st(e),u=Vu(o,st(t));return Nt(o,u).join("")}function R4(e,t){var n=je,o=Be;if(ye(t)){var u="separator"in t?t.separator:u;n="length"in t?j(t.length):n,o="omission"in t?Ke(t.omission):o}e=ue(e);var s=e.length;if(bn(e)){var c=st(e);s=c.length}if(n>=s)return e;var d=n-wn(o);if(d<1)return o;var g=c?Nt(c,0,d).join(""):e.slice(0,d);if(u===i)return g+o;if(c&&(d+=g.length-d),Ko(u)){if(e.slice(d).search(u)){var A,T=g;for(u.global||(u=oo(u.source,ue(fu.exec(u))+"g")),u.lastIndex=0;A=u.exec(T);)var $=A.index;g=g.slice(0,$===i?d:$)}}else if(e.indexOf(Ke(u),d)!=d){var O=g.lastIndexOf(u);O>-1&&(g=g.slice(0,O))}return g+o}function P4(e){return e=ue(e),e&&Zv.test(e)?e.replace(uu,f_):e}var B4=Sn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),zo=Rl("toUpperCase");function Fs(e,t,n){return e=ue(e),t=n?i:t,t===i?o_(e)?d_(e):X2(e):e.match(t)||[]}var Ms=Y(function(e,t){try{return He(e,i,t)}catch(n){return Vo(n)?n:new Z(n)}}),D4=xt(function(e,t){return Qe(t,function(n){n=_t(n),Lt(e,n,Uo(e[n],e))}),e});function N4(e){var t=e==null?0:e.length,n=U();return e=t?ve(e,function(o){if(typeof o[1]!="function")throw new et(m);return[n(o[0]),o[1]]}):[],Y(function(o){for(var u=-1;++u<t;){var s=e[u];if(He(s[0],this,o))return He(s[1],this,o)}})}function k4(e){return f6(nt(e,x))}function jo(e){return function(){return e}}function W4(e,t){return e==null||e!==e?t:e}var U4=Bl(),H4=Bl(!0);function Ue(e){return e}function qo(e){return hl(typeof e=="function"?e:nt(e,x))}function V4(e){return pl(nt(e,x))}function K4(e,t){return gl(e,nt(t,x))}var G4=Y(function(e,t){return function(n){return Yn(n,e,t)}}),Z4=Y(function(e,t){return function(n){return Yn(e,n,t)}});function Xo(e,t,n){var o=$e(t),u=Ur(t,o);n==null&&!(ye(t)&&(u.length||!o.length))&&(n=t,t=e,e=this,u=Ur(t,$e(t)));var s=!(ye(n)&&"chain"in n)||!!n.chain,c=Tt(e);return Qe(u,function(d){var g=t[d];e[d]=g,c&&(e.prototype[d]=function(){var A=this.__chain__;if(s||A){var T=e(this.__wrapped__),$=T.__actions__=Ne(this.__actions__);return $.push({func:g,args:arguments,thisArg:e}),T.__chain__=A,T}return g.apply(e,Ft([this.value()],arguments))})}),e}function z4(){return Se._===this&&(Se._=y_),this}function Yo(){}function j4(e){return e=j(e),Y(function(t){return vl(t,e)})}var q4=So(ve),X4=So(Du),Y4=So(Ji);function Rs(e){return Po(e)?Qi(_t(e)):$6(e)}function J4(e){return function(t){return e==null?i:Jt(e,t)}}var Q4=Nl(),eb=Nl(!0);function Jo(){return[]}function Qo(){return!1}function tb(){return{}}function nb(){return""}function rb(){return!0}function ib(e,t){if(e=j(e),e<1||e>qe)return[];var n=Oe,o=Ie(e,Oe);t=U(t),e-=Oe;for(var u=no(o,t);++n<e;)t(n);return u}function ob(e){return z(e)?ve(e,_t):Ge(e)?[e]:Ne(es(ue(e)))}function ab(e){var t=++__;return ue(e)+t}var ub=zr(function(e,t){return e+t},0),lb=Eo("ceil"),sb=zr(function(e,t){return e/t},1),fb=Eo("floor");function cb(e){return e&&e.length?Wr(e,Ue,po):i}function hb(e,t){return e&&e.length?Wr(e,U(t,2),po):i}function db(e){return Wu(e,Ue)}function pb(e,t){return Wu(e,U(t,2))}function gb(e){return e&&e.length?Wr(e,Ue,mo):i}function vb(e,t){return e&&e.length?Wr(e,U(t,2),mo):i}var _b=zr(function(e,t){return e*t},1),mb=Eo("round"),yb=zr(function(e,t){return e-t},0);function bb(e){return e&&e.length?to(e,Ue):0}function wb(e,t){return e&&e.length?to(e,U(t,2)):0}return l.after=Vm,l.ary=cs,l.assign=Oy,l.assignIn=As,l.assignInWith=ai,l.assignWith=Iy,l.at=Fy,l.before=hs,l.bind=Uo,l.bindAll=D4,l.bindKey=ds,l.castArray=ty,l.chain=ls,l.chunk=f5,l.compact=c5,l.concat=h5,l.cond=N4,l.conforms=k4,l.constant=jo,l.countBy=bm,l.create=My,l.curry=ps,l.curryRight=gs,l.debounce=vs,l.defaults=Ry,l.defaultsDeep=Py,l.defer=Km,l.delay=Gm,l.difference=d5,l.differenceBy=p5,l.differenceWith=g5,l.drop=v5,l.dropRight=_5,l.dropRightWhile=m5,l.dropWhile=y5,l.fill=b5,l.filter=Lm,l.flatMap=Am,l.flatMapDeep=Tm,l.flatMapDepth=$m,l.flatten=is,l.flattenDeep=w5,l.flattenDepth=L5,l.flip=Zm,l.flow=U4,l.flowRight=H4,l.fromPairs=C5,l.functions=Hy,l.functionsIn=Vy,l.groupBy=Sm,l.initial=A5,l.intersection=T5,l.intersectionBy=$5,l.intersectionWith=S5,l.invert=Gy,l.invertBy=Zy,l.invokeMap=Om,l.iteratee=qo,l.keyBy=Im,l.keys=$e,l.keysIn=We,l.map=ei,l.mapKeys=jy,l.mapValues=qy,l.matches=V4,l.matchesProperty=K4,l.memoize=ni,l.merge=Xy,l.mergeWith=Ts,l.method=G4,l.methodOf=Z4,l.mixin=Xo,l.negate=ri,l.nthArg=j4,l.omit=Yy,l.omitBy=Jy,l.once=zm,l.orderBy=Fm,l.over=q4,l.overArgs=jm,l.overEvery=X4,l.overSome=Y4,l.partial=Ho,l.partialRight=_s,l.partition=Mm,l.pick=Qy,l.pickBy=$s,l.property=Rs,l.propertyOf=J4,l.pull=F5,l.pullAll=as,l.pullAllBy=M5,l.pullAllWith=R5,l.pullAt=P5,l.range=Q4,l.rangeRight=eb,l.rearg=qm,l.reject=Bm,l.remove=B5,l.rest=Xm,l.reverse=ko,l.sampleSize=Nm,l.set=t4,l.setWith=n4,l.shuffle=km,l.slice=D5,l.sortBy=Hm,l.sortedUniq=K5,l.sortedUniqBy=G5,l.split=A4,l.spread=Ym,l.tail=Z5,l.take=z5,l.takeRight=j5,l.takeRightWhile=q5,l.takeWhile=X5,l.tap=cm,l.throttle=Jm,l.thru=Qr,l.toArray=Ls,l.toPairs=Ss,l.toPairsIn=Es,l.toPath=ob,l.toPlainObject=xs,l.transform=r4,l.unary=Qm,l.union=Y5,l.unionBy=J5,l.unionWith=Q5,l.uniq=em,l.uniqBy=tm,l.uniqWith=nm,l.unset=i4,l.unzip=Wo,l.unzipWith=us,l.update=o4,l.updateWith=a4,l.values=In,l.valuesIn=u4,l.without=rm,l.words=Fs,l.wrap=ey,l.xor=im,l.xorBy=om,l.xorWith=am,l.zip=um,l.zipObject=lm,l.zipObjectDeep=sm,l.zipWith=fm,l.entries=Ss,l.entriesIn=Es,l.extend=As,l.extendWith=ai,Xo(l,l),l.add=ub,l.attempt=Ms,l.camelCase=c4,l.capitalize=Os,l.ceil=lb,l.clamp=l4,l.clone=ny,l.cloneDeep=iy,l.cloneDeepWith=oy,l.cloneWith=ry,l.conformsTo=ay,l.deburr=Is,l.defaultTo=W4,l.divide=sb,l.endsWith=h4,l.eq=ct,l.escape=d4,l.escapeRegExp=p4,l.every=wm,l.find=Cm,l.findIndex=ns,l.findKey=By,l.findLast=xm,l.findLastIndex=rs,l.findLastKey=Dy,l.floor=fb,l.forEach=ss,l.forEachRight=fs,l.forIn=Ny,l.forInRight=ky,l.forOwn=Wy,l.forOwnRight=Uy,l.get=Go,l.gt=uy,l.gte=ly,l.has=Ky,l.hasIn=Zo,l.head=os,l.identity=Ue,l.includes=Em,l.indexOf=x5,l.inRange=s4,l.invoke=zy,l.isArguments=tn,l.isArray=z,l.isArrayBuffer=sy,l.isArrayLike=ke,l.isArrayLikeObject=Le,l.isBoolean=fy,l.isBuffer=kt,l.isDate=cy,l.isElement=hy,l.isEmpty=dy,l.isEqual=py,l.isEqualWith=gy,l.isError=Vo,l.isFinite=vy,l.isFunction=Tt,l.isInteger=ms,l.isLength=ii,l.isMap=ys,l.isMatch=_y,l.isMatchWith=my,l.isNaN=yy,l.isNative=by,l.isNil=Ly,l.isNull=wy,l.isNumber=bs,l.isObject=ye,l.isObjectLike=be,l.isPlainObject=rr,l.isRegExp=Ko,l.isSafeInteger=Cy,l.isSet=ws,l.isString=oi,l.isSymbol=Ge,l.isTypedArray=On,l.isUndefined=xy,l.isWeakMap=Ay,l.isWeakSet=Ty,l.join=E5,l.kebabCase=g4,l.last=it,l.lastIndexOf=O5,l.lowerCase=v4,l.lowerFirst=_4,l.lt=$y,l.lte=Sy,l.max=cb,l.maxBy=hb,l.mean=db,l.meanBy=pb,l.min=gb,l.minBy=vb,l.stubArray=Jo,l.stubFalse=Qo,l.stubObject=tb,l.stubString=nb,l.stubTrue=rb,l.multiply=_b,l.nth=I5,l.noConflict=z4,l.noop=Yo,l.now=ti,l.pad=m4,l.padEnd=y4,l.padStart=b4,l.parseInt=w4,l.random=f4,l.reduce=Rm,l.reduceRight=Pm,l.repeat=L4,l.replace=C4,l.result=e4,l.round=mb,l.runInContext=p,l.sample=Dm,l.size=Wm,l.snakeCase=x4,l.some=Um,l.sortedIndex=N5,l.sortedIndexBy=k5,l.sortedIndexOf=W5,l.sortedLastIndex=U5,l.sortedLastIndexBy=H5,l.sortedLastIndexOf=V5,l.startCase=T4,l.startsWith=$4,l.subtract=yb,l.sum=bb,l.sumBy=wb,l.template=S4,l.times=ib,l.toFinite=$t,l.toInteger=j,l.toLength=Cs,l.toLower=E4,l.toNumber=ot,l.toSafeInteger=Ey,l.toString=ue,l.toUpper=O4,l.trim=I4,l.trimEnd=F4,l.trimStart=M4,l.truncate=R4,l.unescape=P4,l.uniqueId=ab,l.upperCase=B4,l.upperFirst=zo,l.each=ss,l.eachRight=fs,l.first=os,Xo(l,function(){var e={};return gt(l,function(t,n){le.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=f,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),Qe(["drop","take"],function(e,t){ee.prototype[e]=function(n){n=n===i?1:Te(j(n),0);var o=this.__filtered__&&!t?new ee(this):this.clone();return o.__filtered__?o.__takeCount__=Ie(n,o.__takeCount__):o.__views__.push({size:Ie(n,Oe),type:e+(o.__dir__<0?"Right":"")}),o},ee.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Qe(["filter","map","takeWhile"],function(e,t){var n=t+1,o=n==Et||n==Kt;ee.prototype[e]=function(u){var s=this.clone();return s.__iteratees__.push({iteratee:U(u,3),type:n}),s.__filtered__=s.__filtered__||o,s}}),Qe(["head","last"],function(e,t){var n="take"+(t?"Right":"");ee.prototype[e]=function(){return this[n](1).value()[0]}}),Qe(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ee.prototype[e]=function(){return this.__filtered__?new ee(this):this[n](1)}}),ee.prototype.compact=function(){return this.filter(Ue)},ee.prototype.find=function(e){return this.filter(e).head()},ee.prototype.findLast=function(e){return this.reverse().find(e)},ee.prototype.invokeMap=Y(function(e,t){return typeof e=="function"?new ee(this):this.map(function(n){return Yn(n,e,t)})}),ee.prototype.reject=function(e){return this.filter(ri(U(e)))},ee.prototype.slice=function(e,t){e=j(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ee(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=j(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},ee.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ee.prototype.toArray=function(){return this.take(Oe)},gt(ee.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),u=l[o?"take"+(t=="last"?"Right":""):t],s=o||/^find/.test(t);!u||(l.prototype[t]=function(){var c=this.__wrapped__,d=o?[1]:arguments,g=c instanceof ee,A=d[0],T=g||z(c),$=function(Q){var te=u.apply(l,Ft([Q],d));return o&&O?te[0]:te};T&&n&&typeof A=="function"&&A.length!=1&&(g=T=!1);var O=this.__chain__,N=!!this.__actions__.length,V=s&&!O,X=g&&!N;if(!s&&T){c=X?c:new ee(this);var K=e.apply(c,d);return K.__actions__.push({func:Qr,args:[$],thisArg:i}),new tt(K,O)}return V&&X?e.apply(this,d):(K=this.thru($),V?o?K.value()[0]:K.value():K)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ar[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var u=arguments;if(o&&!this.__chain__){var s=this.value();return t.apply(z(s)?s:[],u)}return this[n](function(c){return t.apply(z(c)?c:[],u)})}}),gt(ee.prototype,function(e,t){var n=l[t];if(n){var o=n.name+"";le.call(An,o)||(An[o]=[]),An[o].push({name:t,func:n})}}),An[Zr(i,E).name]=[{name:"wrapper",func:i}],ee.prototype.clone=P_,ee.prototype.reverse=B_,ee.prototype.value=D_,l.prototype.at=hm,l.prototype.chain=dm,l.prototype.commit=pm,l.prototype.next=gm,l.prototype.plant=_m,l.prototype.reverse=mm,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=ym,l.prototype.first=l.prototype.head,Kn&&(l.prototype[Kn]=vm),l},Ln=p_();zt?((zt.exports=Ln)._=Ln,ji._=Ln):Se._=Ln}).call(mt)})(ln,ln.exports);function iv(r,a){const{imageUploadToServer:i,hidePreviewView:f,mode:_,maxlength:y,options:m,toolbarConfig:C,customToolbars:b,customHintReplaceFn:L,hintConfig:S,disableChangeEvent:x,modelValue:I,beforeShowHint:D}=h.toRefs(r),k=h.reactive(qa(J3)),H=h.ref(),F=h.ref(),E=h.ref(),B=h.ref(),W=h.ref(),G=h.ref(),q=h.ref([]);let P,ae=!1,se="",at=-1,je=-1,Be,cn=!1,hn;const Et=h.computed(()=>{const R=[];for(const ne in S==null?void 0:S.value)(typeof(S==null?void 0:S.value[ne])=="function"||(S==null?void 0:S.value[ne])&&typeof(S==null?void 0:S.value[ne].handler)=="function")&&R.push(ne);return R}),Nn=()=>P,Kt=()=>{if(P){const R=P.getScrollInfo(),ne=R.height-R.clientHeight,he=parseFloat(R.top)/ne,re=F.value.$el,_e=(re.scrollHeight-re.clientHeight)*he;re.scrollTop=_e}},ut=()=>{const R=F.value.$el,ne=R.scrollHeight-R.clientHeight,he=parseFloat(R.scrollTop)/ne,re=(P.getScrollInfo().height-P.getScrollInfo().clientHeight)*he;P.scrollTo(0,re)},qe=R=>{q.value=[],tv(R).forEach(he=>{he.outerHTML&&q.value.push(he.outerHTML)}),setTimeout(()=>{Kt()}),h.nextTick(()=>{a.emit("previewContentChange",R)})},kn=()=>{!ae||ut()},Ot=()=>{ae=!0},Oe=()=>{ae=!1},De=R=>{a.emit("checkedChange",R)};let yt;const Ei=()=>{yt=setTimeout(()=>{var R;B.value=((R=H.value)==null?void 0:R.parentNode.querySelector(".CodeMirror-cursor"))||void 0,E.value.updatePosition(),G.value=!0,cn=!0})},Xe=()=>{clearTimeout(yt),G.value=!1},dn=()=>{cn&&Xe(),Ei()},Oi=()=>{let R;typeof S.value[Be]=="function"?R=S.value[Be]:S.value[Be]&&typeof S.value[Be].handler=="function"&&(R=S.value[Be].handler),R&&R({prefix:Be,cursorHint:se,callback:he=>{const re=P.getCursor(),_e=at,me=je;P.getLine(re.line).length===re.ch?P.replaceRange(he+" ",{line:re.line,ch:me},{line:re.line,ch:_e}):(P.replaceRange(he,{line:re.line,ch:me},{line:re.line,ch:_e}),P.setCursor(re.line,P.getCursor().ch+1)),P.focus(),Xe()}})},Gt=()=>{const R=P.getCursor();let ne=Et.value.length;const he=P.getLine(R.line).replace(/\t/g," ");let re=!1;if(D!=null&&D.value&&(re=D.value(he)),re)return;const _e=P.getSelection(),me=/^\!\[\S+/;if(_e)return;let lt="",xe="";for(;ne>=1;){ne--,lt=Et.value[ne];const Ye=he.lastIndexOf(lt,R.ch),vn=he.indexOf(" ",R.ch)>-1?he.indexOf(" ",R.ch):he.length;if(xe=he.slice(Ye,R.ch),Ye<0||!xe.includes(lt)||xe.endsWith(" ")||me.test(xe))se="",je=-1,at=-1;else{Be=Et.value[ne],se=xe.slice(Be.length),je=Ye,at=vn;break}}if(je>-1&&xe[0]){if(he.lastIndexOf(" ",R.ch)>je)return;setTimeout(()=>{dn(),Oi()})}else Xe()},Zt=Gs(()=>{const R=P.getValue();x.value||(a.emit("update:modelValue",R),a.emit("contentChange",R)),ae||Kt()},x.value?500:10,!0),Ii=()=>{ae||Kt()},pn=()=>{var re;P=hn.fromTextArea(H.value,{mode:"markdown",lineNumbers:!1,lineWrapping:!0,...m.value}),y.value&&P.setOption("maxLength",y.value),P.setOption("readOnly",_.value==="readonly");const R={},ne=C.value.flat(),he={...k,...b==null?void 0:b.value};for(const _e of Object.keys(he)){const me=he[_e];me.shortKeyWithCode&&ne.includes(me.id)&&(R[me.shortKeyWithCode.replace(/\+/g,"-")]=(re=me.handler)==null?void 0:re.bind(null,P,me.params))}P.setOption("extraKeys",Object.assign({Esc:()=>{Xe()}}),R),P.on("beforeChange",rv),P.on("cursorActivity",ln.exports.throttle(Gt,S.value&&S.value.throttleTime||300)),P.setSize("auto","100%"),Ai(),a.emit("afterEditorInit",P),P.on("change",Zt),P.on("scroll",Ii),setTimeout(()=>{a.emit("contentChange",P.getValue())},100),W.value.addEventListener("keydown",_e=>{let me="";_e.ctrlKey&&(me+="Ctrl-"),_e.metaKey&&(me+="\u2318-"),_e.altKey&&(me+=`${Dn()}-`),_e.shiftKey&&(me+="Shift-"),me+=_e.keyCode,R[me]&&typeof R[me]=="function"&&(_e.preventDefault(),R[me]())})},gn=R=>{const ne=R.clipboardData;if(!!(ne&&ne.items)&&ne.items.length<=3)for(let he=0;he<ne.items.length;he++){const re=ne.items[he];if(re.kind==="file"&&re.type.indexOf("image")!==-1){const _e=re.getAsFile();if((_e==null?void 0:_e.size)===0)return;if(i.value){const me=({name:lt,imgUrl:xe,title:Ye})=>{P.focus(),P.replaceSelection(``)};a.emit("imageUpload",{file:_e,callback:me})}}}},Wn=R=>{var ne;G.value&&R.target!==W.value&&!((ne=W.value)!=null&&ne.contains(R.target))&&Xe()};return h.onMounted(async()=>{await import("codemirror/addon/display/placeholder.js"),await import("codemirror/mode/markdown/markdown.js"),hn=(await import("codemirror")).default,pn(),document.addEventListener("click",Wn)}),h.onBeforeUnmount(()=>{document.removeEventListener("click",Wn)}),h.watch(I,R=>{if(P){if(R===P.getValue())return;P.setValue(R)}}),h.watch(i,R=>{k.image.params&&(k.image.params.imageUploadToServer=R),k.image.params&&!k.image.params.imageUpload&&(k.image.params.imageUpload=ne=>{a.emit("imageUpload",ne)})},{immediate:!0}),h.watch(f,()=>{Ai()}),h.watch(_,R=>{setTimeout(()=>{P&&(Ai(),P.setOption("readOnly",R==="readonly"))})}),h.watch(y,R=>{P&&P.setOption("maxLength",R)}),{editorRef:H,overlayRef:E,cursorRef:B,renderRef:F,containerRef:W,toolbars:k,toolbarConfig:C,previewHtmlList:q,isHintShow:G,customToolbars:b,getEditorIns:Nn,onPaste:gn,previewContentChange:qe,onChecked:De,onPreviewScroll:kn,onPreviewMouseout:Oe,onPreviewMouseover:Ot}}function ov(r){const a=h.ref(!1);let i;const f=()=>{i&&(a.value=i.currentTheme.id.indexOf("dark")!==-1,r())};return h.onBeforeMount(()=>{i=window.devuiThemeService}),h.onMounted(()=>{f(),i&&i.eventBus&&i.eventBus.add("themeChanged",f)}),h.onBeforeUnmount(()=>{i&&i.eventBus&&i.eventBus.remove("themeChanged",f)}),{isDarkMode:a}}const Ya={baseUrl:{type:String,default:null},breaks:{type:Boolean,default:!0},customParse:{type:Function,default:null},renderParse:{type:Function,default:null},mdRules:{type:Object,default:()=>({})},customRendererRules:{type:Array,default:()=>[]},customXssRules:{type:Array,default:()=>[]},mdPlugins:{type:Array,default:()=>[]}},Ja={...Ya,modelValue:{type:String,default:""},options:{type:Object,default:()=>({})},mode:{type:String,default:"normal"},customThemeConfig:{type:Object},customToolbars:{type:Object},disableChangeEvent:{type:Boolean,default:!1},editorContainerHeight:{type:Number},imageUploadToServer:{type:Boolean,default:!1},hidePreviewView:{type:Boolean,default:!1},maxlength:{type:Number,default:null},placeholder:{type:String,default:""},toolbarConfig:{type:Array,default:()=>Q3},fullscreenZIndex:{type:Number,default:10},hintConfig:{type:Object,default:{}},customHintReplaceFn:{type:Function},beforeShowHint:{type:Function}},sn=Symbol("d-editor-md"),Qa={...Ya,content:{type:String,default:""},disableRender:{type:Boolean,default:!1}},eu={config:{type:Object,default:()=>({})}},av={visible:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeScope:{type:String,default:"all"},position:{type:Array,default:()=>["bottom","top","left","right"]},offset:{type:[Number,Object],default:4},shiftOffset:{type:Number},closeOnMouseLeaveMenu:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""},destroyOnHide:{type:Boolean,default:!0},teleport:{type:[String,Object],default:"body"}},Ti=Symbol("popper-trigger"),pt=new Map;function Vt(r,a,i){return r==null||r.addEventListener(a,i),()=>{r==null||r.removeEventListener(a,i)}}const uv=({id:r,isOpen:a,origin:i,dropdownRef:f,props:_,emit:y})=>{let m=!1,C=!1;const{trigger:b,closeScope:L,closeOnMouseLeaveMenu:S}=h.toRefs(_),x=D=>{a.value=D,y("toggle",a.value)},I=async(D,k)=>{await new Promise(H=>setTimeout(H,50)),!(D==="origin"&&m||D==="dropdown"&&C)&&(k&&[...pt.values()].reverse().forEach(H=>{setTimeout(()=>{var F;(F=H.toggle)==null||F.call(H)},0)}),x(!1))};h.watch([b,i,f],([D,k,H],F,E)=>{const B=Zs(k),W=[];setTimeout(()=>{W.push(Vt(document,"click",G=>{G.stopPropagation();const q=[...pt.values()];!a.value||L.value==="none"||(H==null?void 0:H.contains(G.target))&&L.value==="blank"||q.some(P=>{var ae;return(ae=P.toggleEl)==null?void 0:ae.contains(G.target)})&&q.some(P=>{var ae;return(ae=P.menuEl)==null?void 0:ae.contains(G.target)})||([...pt.values()].reverse().forEach(P=>{setTimeout(()=>{var ae,se;(ae=P.toggleEl)!=null&&ae.contains(G.target)||(se=P.toggle)==null||se.call(P)},0)}),m=!1)}))},0),D==="click"?W.push(Vt(B,"click",()=>x(!a.value)),Vt(H,"mouseleave",G=>{var q;S.value&&!((q=pt.get(r).child)!=null&&q.contains(G.relatedTarget))&&I("dropdown",!0)})):D==="hover"&&W.push(Vt(B,"mouseenter",()=>{C=!0,x(!0)}),Vt(B,"mouseleave",()=>{C=!1,I("origin")}),Vt(H,"mouseenter",()=>{m=!0,a.value=!0}),Vt(H,"mouseleave",G=>{var q;m=!1,!(G.relatedTarget&&((B==null?void 0:B.contains(G.relatedTarget))||((q=pt.get(r).child)==null?void 0:q.contains(G.relatedTarget))))&&I("dropdown",!0)})),E(()=>W.forEach(G=>G()))})};function lv(r,a,i,f,_,y){h.watch(a,(m,C)=>{C!==void 0&&(i.value=m,y("toggle",i.value))},{immediate:!0}),h.watch([i,_],([m,C])=>{var b;if(m){pt.set(r,{...pt.get(r),menuEl:C,toggle:()=>{i.value=!1,y("toggle",i.value)}});for(const L of pt.values())(b=L.menuEl)!=null&&b.contains(f.value)&&(L.child=C)}}),h.onMounted(()=>{pt.set(r,{toggleEl:f.value})}),h.onUnmounted(()=>{pt.delete(r)})}function sv(r,a,i){const{showAnimation:f,overlayClass:_,destroyOnHide:y}=h.toRefs(r),m=h.ref(!1),C=h.ref(!1),b=h.computed(()=>({transformOrigin:a.value==="top"?"0% 100%":"0% 0%",zIndex:"var(--devui-z-index-dropdown, 1052)"})),L=h.computed(()=>({"fade-in-bottom":f.value&&i.value&&a.value==="bottom","fade-in-top":f.value&&i.value&&a.value==="top",[`${_.value}`]:!0})),S=x=>{a.value=x.includes("top")||x.includes("right-end")||x.includes("left-end")?"top":"bottom"};return h.watch(i,x=>{m.value=y.value?x:!0,C.value=x}),{overlayModelValue:m,overlayShowValue:C,styles:b,classes:L,handlePositionChange:S}}const fv={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function cv(r,a){let i;const f=y=>{y.preventDefault(),a.emit("click",y),r.closeOnClickOverlay&&a.emit("update:modelValue",!1)},_=()=>{i==null||i()};return h.watch(()=>r.modelValue,y=>{y?r.lockScroll&&(i=zs()):_()}),h.onUnmounted(_),{onClick:f}}function gr(r,a,i){let f=r;return a&&(f+=`__${a}`),i&&(f+=`--${i}`),f}function fn(r,a=!1){const i=a?`.devui-${r}`:`devui-${r}`;return{b:()=>gr(i),e:C=>C?gr(i,C):"",m:C=>C?gr(i,"",C):"",em:(C,b)=>C&&b?gr(i,C,b):""}}var xb="";h.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:fv,emits:["update:modelValue","click"],setup(r,a){const{modelValue:i}=h.toRefs(r),f=fn("fixed-overlay"),{onClick:_}=cv(r,a);return()=>h.createVNode(h.Transition,{name:f.m("fade")},{default:()=>{var y,m;return[i.value&&h.createVNode("div",h.mergeProps({class:f.b()},a.attrs,{onClick:_}),[(m=(y=a.slots).default)==null?void 0:m.call(y)])]}})}});const hv={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0},clickEventBubble:{type:Boolean,default:!1},fitOriginWidth:{type:Boolean,default:!1}};function dv(r,a,i,f){let{x:_,y}=a;if(!r){const{width:m,height:C}=f;_&&i.includes("start")&&(_=12),_&&i.includes("end")&&(_=Math.round(m-24)),y&&i.includes("start")&&(y=10),y&&i.includes("end")&&(y=C-14)}return{x:_,y}}function pv(r,a){const{fitOriginWidth:i,position:f,showArrow:_}=h.toRefs(r),y=h.ref(),m=h.ref(),C=h.ref(0);let b;const L=h.computed(()=>i.value?{width:C.value+"px"}:{}),S=(F,E,B,W)=>{const{x:G,y:q}=dv(r.isArrowCenter,B,E,W.getBoundingClientRect()),P={top:"bottom",right:"left",bottom:"top",left:"right"}[E.split("-")[0]];Object.assign(F.style,{left:G?`${G}px`:"",top:q?`${q}px`:"",right:"",bottom:"",[P]:"-4px"})},x=async()=>{const F=r.origin,E=h.unref(y.value),B=h.unref(m.value),[W,...G]=f.value,q=[Fn.offset(r.offset)];q.push(G.length?Fn.flip({fallbackPlacements:G}):Fn.flip()),_.value&&q.push(Fn.arrow({element:m.value}));const{x:P,y:ae,placement:se,middlewareData:at}=await Fn.computePosition(F,E,{strategy:"fixed",placement:W,middleware:q});let je=P,Be=ae;a("positionChange",se),Object.assign(E.style,{top:`${Be}px`,left:`${je}px`}),r.showArrow&&S(B,se,at.arrow,E)},I=F=>{var B,W;const E=F.target;E!=null&&E.contains((W=(B=r.origin)==null?void 0:B.$el)!=null?W:r.origin)&&x()},D=F=>{C.value=F.getBoundingClientRect().width,x()},k=()=>{var F,E;if(i.value&&typeof window!="undefined"){const B=(E=(F=r.origin)==null?void 0:F.$el)!=null?E:r.origin;B&&(b=new window.ResizeObserver(()=>D(B)),b.observe(B))}},H=()=>{var E,B;const F=(B=(E=r.origin)==null?void 0:E.$el)!=null?B:r.origin;F&&(b==null||b.unobserve(F))};return h.watch(()=>r.modelValue,()=>{r.modelValue&&r.origin?(h.nextTick(x),window.addEventListener("scroll",I,!0),window.addEventListener("resize",x),k()):(window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",x),H())}),h.onUnmounted(()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",x),H()}),{arrowRef:m,overlayRef:y,styles:L,updatePosition:x}}var Ab="";const vr=h.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:hv,emits:["update:modelValue","positionChange"],setup(r,{slots:a,attrs:i,emit:f,expose:_}){const y=fn("flexible-overlay"),{clickEventBubble:m}=h.toRefs(r),{arrowRef:C,overlayRef:b,styles:L,updatePosition:S}=pv(r,f);return _({updatePosition:S}),()=>{var x;return r.modelValue&&h.createVNode("div",h.mergeProps({ref:b,class:y.b(),style:L.value},i,{onClick:h.withModifiers(()=>({}),[m.value?"":"stop"]),onPointerup:h.withModifiers(()=>({}),["stop"])}),[(x=a.default)==null?void 0:x.call(a),r.showArrow&&h.createVNode("div",{ref:C,class:y.e("arrow")},null)])}}});/**
|
|
136
|
+
}`;var X=Ms(function(){return oe(s,N+"return "+$).apply(i,c)});if(X.source=$,Vo(X))throw X;return X}function E4(e){return ue(e).toLowerCase()}function O4(e){return ue(e).toUpperCase()}function I4(e,t,n){if(e=ue(e),e&&(n||t===i))return Hu(e);if(!e||!(t=Ke(t)))return e;var o=st(e),u=st(t),s=Vu(o,u),c=Ku(o,u)+1;return Nt(o,s,c).join("")}function F4(e,t,n){if(e=ue(e),e&&(n||t===i))return e.slice(0,Zu(e)+1);if(!e||!(t=Ke(t)))return e;var o=st(e),u=Ku(o,st(t))+1;return Nt(o,0,u).join("")}function M4(e,t,n){if(e=ue(e),e&&(n||t===i))return e.replace(Hi,"");if(!e||!(t=Ke(t)))return e;var o=st(e),u=Vu(o,st(t));return Nt(o,u).join("")}function R4(e,t){var n=je,o=Be;if(ye(t)){var u="separator"in t?t.separator:u;n="length"in t?j(t.length):n,o="omission"in t?Ke(t.omission):o}e=ue(e);var s=e.length;if(bn(e)){var c=st(e);s=c.length}if(n>=s)return e;var d=n-wn(o);if(d<1)return o;var g=c?Nt(c,0,d).join(""):e.slice(0,d);if(u===i)return g+o;if(c&&(d+=g.length-d),Ko(u)){if(e.slice(d).search(u)){var A,T=g;for(u.global||(u=oo(u.source,ue(fu.exec(u))+"g")),u.lastIndex=0;A=u.exec(T);)var $=A.index;g=g.slice(0,$===i?d:$)}}else if(e.indexOf(Ke(u),d)!=d){var O=g.lastIndexOf(u);O>-1&&(g=g.slice(0,O))}return g+o}function P4(e){return e=ue(e),e&&Zv.test(e)?e.replace(uu,f_):e}var B4=Sn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),zo=Rl("toUpperCase");function Fs(e,t,n){return e=ue(e),t=n?i:t,t===i?o_(e)?d_(e):X2(e):e.match(t)||[]}var Ms=Y(function(e,t){try{return He(e,i,t)}catch(n){return Vo(n)?n:new Z(n)}}),D4=xt(function(e,t){return Qe(t,function(n){n=_t(n),Lt(e,n,Uo(e[n],e))}),e});function N4(e){var t=e==null?0:e.length,n=U();return e=t?ve(e,function(o){if(typeof o[1]!="function")throw new et(m);return[n(o[0]),o[1]]}):[],Y(function(o){for(var u=-1;++u<t;){var s=e[u];if(He(s[0],this,o))return He(s[1],this,o)}})}function k4(e){return f6(nt(e,x))}function jo(e){return function(){return e}}function W4(e,t){return e==null||e!==e?t:e}var U4=Bl(),H4=Bl(!0);function Ue(e){return e}function qo(e){return hl(typeof e=="function"?e:nt(e,x))}function V4(e){return pl(nt(e,x))}function K4(e,t){return gl(e,nt(t,x))}var G4=Y(function(e,t){return function(n){return Yn(n,e,t)}}),Z4=Y(function(e,t){return function(n){return Yn(e,n,t)}});function Xo(e,t,n){var o=$e(t),u=Ur(t,o);n==null&&!(ye(t)&&(u.length||!o.length))&&(n=t,t=e,e=this,u=Ur(t,$e(t)));var s=!(ye(n)&&"chain"in n)||!!n.chain,c=Tt(e);return Qe(u,function(d){var g=t[d];e[d]=g,c&&(e.prototype[d]=function(){var A=this.__chain__;if(s||A){var T=e(this.__wrapped__),$=T.__actions__=Ne(this.__actions__);return $.push({func:g,args:arguments,thisArg:e}),T.__chain__=A,T}return g.apply(e,Ft([this.value()],arguments))})}),e}function z4(){return Se._===this&&(Se._=y_),this}function Yo(){}function j4(e){return e=j(e),Y(function(t){return vl(t,e)})}var q4=So(ve),X4=So(Du),Y4=So(Ji);function Rs(e){return Po(e)?Qi(_t(e)):$6(e)}function J4(e){return function(t){return e==null?i:Jt(e,t)}}var Q4=Nl(),eb=Nl(!0);function Jo(){return[]}function Qo(){return!1}function tb(){return{}}function nb(){return""}function rb(){return!0}function ib(e,t){if(e=j(e),e<1||e>qe)return[];var n=Oe,o=Ie(e,Oe);t=U(t),e-=Oe;for(var u=no(o,t);++n<e;)t(n);return u}function ob(e){return z(e)?ve(e,_t):Ge(e)?[e]:Ne(es(ue(e)))}function ab(e){var t=++__;return ue(e)+t}var ub=zr(function(e,t){return e+t},0),lb=Eo("ceil"),sb=zr(function(e,t){return e/t},1),fb=Eo("floor");function cb(e){return e&&e.length?Wr(e,Ue,po):i}function hb(e,t){return e&&e.length?Wr(e,U(t,2),po):i}function db(e){return Wu(e,Ue)}function pb(e,t){return Wu(e,U(t,2))}function gb(e){return e&&e.length?Wr(e,Ue,mo):i}function vb(e,t){return e&&e.length?Wr(e,U(t,2),mo):i}var _b=zr(function(e,t){return e*t},1),mb=Eo("round"),yb=zr(function(e,t){return e-t},0);function bb(e){return e&&e.length?to(e,Ue):0}function wb(e,t){return e&&e.length?to(e,U(t,2)):0}return l.after=Vm,l.ary=cs,l.assign=Oy,l.assignIn=As,l.assignInWith=ai,l.assignWith=Iy,l.at=Fy,l.before=hs,l.bind=Uo,l.bindAll=D4,l.bindKey=ds,l.castArray=ty,l.chain=ls,l.chunk=f5,l.compact=c5,l.concat=h5,l.cond=N4,l.conforms=k4,l.constant=jo,l.countBy=bm,l.create=My,l.curry=ps,l.curryRight=gs,l.debounce=vs,l.defaults=Ry,l.defaultsDeep=Py,l.defer=Km,l.delay=Gm,l.difference=d5,l.differenceBy=p5,l.differenceWith=g5,l.drop=v5,l.dropRight=_5,l.dropRightWhile=m5,l.dropWhile=y5,l.fill=b5,l.filter=Lm,l.flatMap=Am,l.flatMapDeep=Tm,l.flatMapDepth=$m,l.flatten=is,l.flattenDeep=w5,l.flattenDepth=L5,l.flip=Zm,l.flow=U4,l.flowRight=H4,l.fromPairs=C5,l.functions=Hy,l.functionsIn=Vy,l.groupBy=Sm,l.initial=A5,l.intersection=T5,l.intersectionBy=$5,l.intersectionWith=S5,l.invert=Gy,l.invertBy=Zy,l.invokeMap=Om,l.iteratee=qo,l.keyBy=Im,l.keys=$e,l.keysIn=We,l.map=ei,l.mapKeys=jy,l.mapValues=qy,l.matches=V4,l.matchesProperty=K4,l.memoize=ni,l.merge=Xy,l.mergeWith=Ts,l.method=G4,l.methodOf=Z4,l.mixin=Xo,l.negate=ri,l.nthArg=j4,l.omit=Yy,l.omitBy=Jy,l.once=zm,l.orderBy=Fm,l.over=q4,l.overArgs=jm,l.overEvery=X4,l.overSome=Y4,l.partial=Ho,l.partialRight=_s,l.partition=Mm,l.pick=Qy,l.pickBy=$s,l.property=Rs,l.propertyOf=J4,l.pull=F5,l.pullAll=as,l.pullAllBy=M5,l.pullAllWith=R5,l.pullAt=P5,l.range=Q4,l.rangeRight=eb,l.rearg=qm,l.reject=Bm,l.remove=B5,l.rest=Xm,l.reverse=ko,l.sampleSize=Nm,l.set=t4,l.setWith=n4,l.shuffle=km,l.slice=D5,l.sortBy=Hm,l.sortedUniq=K5,l.sortedUniqBy=G5,l.split=A4,l.spread=Ym,l.tail=Z5,l.take=z5,l.takeRight=j5,l.takeRightWhile=q5,l.takeWhile=X5,l.tap=cm,l.throttle=Jm,l.thru=Qr,l.toArray=Ls,l.toPairs=Ss,l.toPairsIn=Es,l.toPath=ob,l.toPlainObject=xs,l.transform=r4,l.unary=Qm,l.union=Y5,l.unionBy=J5,l.unionWith=Q5,l.uniq=em,l.uniqBy=tm,l.uniqWith=nm,l.unset=i4,l.unzip=Wo,l.unzipWith=us,l.update=o4,l.updateWith=a4,l.values=In,l.valuesIn=u4,l.without=rm,l.words=Fs,l.wrap=ey,l.xor=im,l.xorBy=om,l.xorWith=am,l.zip=um,l.zipObject=lm,l.zipObjectDeep=sm,l.zipWith=fm,l.entries=Ss,l.entriesIn=Es,l.extend=As,l.extendWith=ai,Xo(l,l),l.add=ub,l.attempt=Ms,l.camelCase=c4,l.capitalize=Os,l.ceil=lb,l.clamp=l4,l.clone=ny,l.cloneDeep=iy,l.cloneDeepWith=oy,l.cloneWith=ry,l.conformsTo=ay,l.deburr=Is,l.defaultTo=W4,l.divide=sb,l.endsWith=h4,l.eq=ct,l.escape=d4,l.escapeRegExp=p4,l.every=wm,l.find=Cm,l.findIndex=ns,l.findKey=By,l.findLast=xm,l.findLastIndex=rs,l.findLastKey=Dy,l.floor=fb,l.forEach=ss,l.forEachRight=fs,l.forIn=Ny,l.forInRight=ky,l.forOwn=Wy,l.forOwnRight=Uy,l.get=Go,l.gt=uy,l.gte=ly,l.has=Ky,l.hasIn=Zo,l.head=os,l.identity=Ue,l.includes=Em,l.indexOf=x5,l.inRange=s4,l.invoke=zy,l.isArguments=tn,l.isArray=z,l.isArrayBuffer=sy,l.isArrayLike=ke,l.isArrayLikeObject=Le,l.isBoolean=fy,l.isBuffer=kt,l.isDate=cy,l.isElement=hy,l.isEmpty=dy,l.isEqual=py,l.isEqualWith=gy,l.isError=Vo,l.isFinite=vy,l.isFunction=Tt,l.isInteger=ms,l.isLength=ii,l.isMap=ys,l.isMatch=_y,l.isMatchWith=my,l.isNaN=yy,l.isNative=by,l.isNil=Ly,l.isNull=wy,l.isNumber=bs,l.isObject=ye,l.isObjectLike=be,l.isPlainObject=rr,l.isRegExp=Ko,l.isSafeInteger=Cy,l.isSet=ws,l.isString=oi,l.isSymbol=Ge,l.isTypedArray=On,l.isUndefined=xy,l.isWeakMap=Ay,l.isWeakSet=Ty,l.join=E5,l.kebabCase=g4,l.last=it,l.lastIndexOf=O5,l.lowerCase=v4,l.lowerFirst=_4,l.lt=$y,l.lte=Sy,l.max=cb,l.maxBy=hb,l.mean=db,l.meanBy=pb,l.min=gb,l.minBy=vb,l.stubArray=Jo,l.stubFalse=Qo,l.stubObject=tb,l.stubString=nb,l.stubTrue=rb,l.multiply=_b,l.nth=I5,l.noConflict=z4,l.noop=Yo,l.now=ti,l.pad=m4,l.padEnd=y4,l.padStart=b4,l.parseInt=w4,l.random=f4,l.reduce=Rm,l.reduceRight=Pm,l.repeat=L4,l.replace=C4,l.result=e4,l.round=mb,l.runInContext=p,l.sample=Dm,l.size=Wm,l.snakeCase=x4,l.some=Um,l.sortedIndex=N5,l.sortedIndexBy=k5,l.sortedIndexOf=W5,l.sortedLastIndex=U5,l.sortedLastIndexBy=H5,l.sortedLastIndexOf=V5,l.startCase=T4,l.startsWith=$4,l.subtract=yb,l.sum=bb,l.sumBy=wb,l.template=S4,l.times=ib,l.toFinite=$t,l.toInteger=j,l.toLength=Cs,l.toLower=E4,l.toNumber=ot,l.toSafeInteger=Ey,l.toString=ue,l.toUpper=O4,l.trim=I4,l.trimEnd=F4,l.trimStart=M4,l.truncate=R4,l.unescape=P4,l.uniqueId=ab,l.upperCase=B4,l.upperFirst=zo,l.each=ss,l.eachRight=fs,l.first=os,Xo(l,function(){var e={};return gt(l,function(t,n){le.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=f,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),Qe(["drop","take"],function(e,t){ee.prototype[e]=function(n){n=n===i?1:Te(j(n),0);var o=this.__filtered__&&!t?new ee(this):this.clone();return o.__filtered__?o.__takeCount__=Ie(n,o.__takeCount__):o.__views__.push({size:Ie(n,Oe),type:e+(o.__dir__<0?"Right":"")}),o},ee.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Qe(["filter","map","takeWhile"],function(e,t){var n=t+1,o=n==Et||n==Kt;ee.prototype[e]=function(u){var s=this.clone();return s.__iteratees__.push({iteratee:U(u,3),type:n}),s.__filtered__=s.__filtered__||o,s}}),Qe(["head","last"],function(e,t){var n="take"+(t?"Right":"");ee.prototype[e]=function(){return this[n](1).value()[0]}}),Qe(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ee.prototype[e]=function(){return this.__filtered__?new ee(this):this[n](1)}}),ee.prototype.compact=function(){return this.filter(Ue)},ee.prototype.find=function(e){return this.filter(e).head()},ee.prototype.findLast=function(e){return this.reverse().find(e)},ee.prototype.invokeMap=Y(function(e,t){return typeof e=="function"?new ee(this):this.map(function(n){return Yn(n,e,t)})}),ee.prototype.reject=function(e){return this.filter(ri(U(e)))},ee.prototype.slice=function(e,t){e=j(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ee(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=j(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},ee.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ee.prototype.toArray=function(){return this.take(Oe)},gt(ee.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),u=l[o?"take"+(t=="last"?"Right":""):t],s=o||/^find/.test(t);!u||(l.prototype[t]=function(){var c=this.__wrapped__,d=o?[1]:arguments,g=c instanceof ee,A=d[0],T=g||z(c),$=function(Q){var te=u.apply(l,Ft([Q],d));return o&&O?te[0]:te};T&&n&&typeof A=="function"&&A.length!=1&&(g=T=!1);var O=this.__chain__,N=!!this.__actions__.length,V=s&&!O,X=g&&!N;if(!s&&T){c=X?c:new ee(this);var K=e.apply(c,d);return K.__actions__.push({func:Qr,args:[$],thisArg:i}),new tt(K,O)}return V&&X?e.apply(this,d):(K=this.thru($),V?o?K.value()[0]:K.value():K)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ar[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var u=arguments;if(o&&!this.__chain__){var s=this.value();return t.apply(z(s)?s:[],u)}return this[n](function(c){return t.apply(z(c)?c:[],u)})}}),gt(ee.prototype,function(e,t){var n=l[t];if(n){var o=n.name+"";le.call(An,o)||(An[o]=[]),An[o].push({name:t,func:n})}}),An[Zr(i,E).name]=[{name:"wrapper",func:i}],ee.prototype.clone=P_,ee.prototype.reverse=B_,ee.prototype.value=D_,l.prototype.at=hm,l.prototype.chain=dm,l.prototype.commit=pm,l.prototype.next=gm,l.prototype.plant=_m,l.prototype.reverse=mm,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=ym,l.prototype.first=l.prototype.head,Kn&&(l.prototype[Kn]=vm),l},Ln=p_();zt?((zt.exports=Ln)._=Ln,ji._=Ln):Se._=Ln}).call(mt)})(ln,ln.exports);function iv(r,a){const{imageUploadToServer:i,hidePreviewView:f,mode:_,maxlength:y,options:m,toolbarConfig:C,customToolbars:b,customHintReplaceFn:L,hintConfig:S,disableChangeEvent:x,modelValue:I,beforeShowHint:D}=h.toRefs(r),k=h.reactive(qa(J3)),H=h.ref(),F=h.ref(),E=h.ref(),B=h.ref(),W=h.ref(),G=h.ref(),q=h.ref([]);let P,ae=!1,se="",at=-1,je=-1,Be,cn=!1,hn;const Et=h.computed(()=>{const R=[];for(const ne in S==null?void 0:S.value)(typeof(S==null?void 0:S.value[ne])=="function"||(S==null?void 0:S.value[ne])&&typeof(S==null?void 0:S.value[ne].handler)=="function")&&R.push(ne);return R}),Nn=()=>P,Kt=()=>{if(P){const R=P.getScrollInfo(),ne=R.height-R.clientHeight,he=parseFloat(R.top)/ne,re=F.value.$el,_e=(re.scrollHeight-re.clientHeight)*he;re.scrollTop=_e}},ut=()=>{const R=F.value.$el,ne=R.scrollHeight-R.clientHeight,he=parseFloat(R.scrollTop)/ne,re=(P.getScrollInfo().height-P.getScrollInfo().clientHeight)*he;P.scrollTo(0,re)},qe=R=>{q.value=[],tv(R).forEach(he=>{he.outerHTML&&q.value.push(he.outerHTML)}),setTimeout(()=>{Kt()}),h.nextTick(()=>{a.emit("previewContentChange",R)})},kn=()=>{!ae||ut()},Ot=()=>{ae=!0},Oe=()=>{ae=!1},De=R=>{a.emit("checkedChange",R)};let yt;const Ei=()=>{yt=setTimeout(()=>{var R;B.value=((R=H.value)==null?void 0:R.parentNode.querySelector(".CodeMirror-cursor"))||void 0,E.value.updatePosition(),G.value=!0,cn=!0})},Xe=()=>{clearTimeout(yt),G.value=!1},dn=()=>{cn&&Xe(),Ei()},Oi=()=>{let R;typeof S.value[Be]=="function"?R=S.value[Be]:S.value[Be]&&typeof S.value[Be].handler=="function"&&(R=S.value[Be].handler),R&&R({prefix:Be,cursorHint:se,callback:he=>{const re=P.getCursor(),_e=at,me=je;P.getLine(re.line).length===re.ch?P.replaceRange(he+" ",{line:re.line,ch:me},{line:re.line,ch:_e}):(P.replaceRange(he,{line:re.line,ch:me},{line:re.line,ch:_e}),P.setCursor(re.line,P.getCursor().ch+1)),P.focus(),Xe()}})},Gt=()=>{const R=P.getCursor();let ne=Et.value.length;const he=P.getLine(R.line).replace(/\t/g," ");let re=!1;if(D!=null&&D.value&&(re=D.value(he)),re)return;const _e=P.getSelection(),me=/^\!\[\S+/;if(_e)return;let lt="",xe="";for(;ne>=1;){ne--,lt=Et.value[ne];const Ye=he.lastIndexOf(lt,R.ch),vn=he.indexOf(" ",R.ch)>-1?he.indexOf(" ",R.ch):he.length;if(xe=he.slice(Ye,R.ch),Ye<0||!xe.includes(lt)||xe.endsWith(" ")||me.test(xe))se="",je=-1,at=-1;else{Be=Et.value[ne],se=xe.slice(Be.length),je=Ye,at=vn;break}}if(je>-1&&xe[0]){if(he.lastIndexOf(" ",R.ch)>je)return;setTimeout(()=>{dn(),Oi()})}else Xe()},Zt=Gs(()=>{const R=P.getValue();x.value||(a.emit("update:modelValue",R),a.emit("contentChange",R)),ae||Kt()},x.value?500:10,!0),Ii=()=>{ae||Kt()},pn=()=>{var re;P=hn.fromTextArea(H.value,{mode:"markdown",lineNumbers:!1,lineWrapping:!0,...m.value}),y.value&&P.setOption("maxLength",y.value),P.setOption("readOnly",_.value==="readonly");const R={},ne=C.value.flat(),he={...k,...b==null?void 0:b.value};for(const _e of Object.keys(he)){const me=he[_e];me.shortKeyWithCode&&ne.includes(me.id)&&(R[me.shortKeyWithCode.replace(/\+/g,"-")]=(re=me.handler)==null?void 0:re.bind(null,P,me.params))}P.setOption("extraKeys",Object.assign({Esc:()=>{Xe()}}),R),P.on("beforeChange",rv),P.on("cursorActivity",ln.exports.throttle(Gt,S.value&&S.value.throttleTime||300)),P.setSize("auto","100%"),Ai(),a.emit("afterEditorInit",P),P.on("change",Zt),P.on("scroll",Ii),setTimeout(()=>{a.emit("contentChange",P.getValue())},100),W.value.addEventListener("keydown",_e=>{let me="";_e.ctrlKey&&(me+="Ctrl-"),_e.metaKey&&(me+="\u2318-"),_e.altKey&&(me+=`${Dn()}-`),_e.shiftKey&&(me+="Shift-"),me+=_e.keyCode,R[me]&&typeof R[me]=="function"&&(_e.preventDefault(),R[me]())})},gn=R=>{const ne=R.clipboardData;if(!!(ne&&ne.items)&&ne.items.length<=3)for(let he=0;he<ne.items.length;he++){const re=ne.items[he];if(re.kind==="file"&&re.type.indexOf("image")!==-1){const _e=re.getAsFile();if((_e==null?void 0:_e.size)===0)return;if(i.value){const me=({name:lt,imgUrl:xe,title:Ye})=>{P.focus(),P.replaceSelection(``)};a.emit("imageUpload",{file:_e,callback:me})}}}},Wn=R=>{var ne;G.value&&R.target!==W.value&&!((ne=W.value)!=null&&ne.contains(R.target))&&Xe()};return h.onMounted(async()=>{await import("codemirror/addon/display/placeholder.js"),await import("codemirror/mode/markdown/markdown.js"),hn=(await import("codemirror")).default,pn(),document.addEventListener("click",Wn)}),h.onBeforeUnmount(()=>{document.removeEventListener("click",Wn)}),h.watch(I,R=>{if(P){if(R===P.getValue())return;P.setValue(R)}}),h.watch(i,R=>{k.image.params&&(k.image.params.imageUploadToServer=R),k.image.params&&!k.image.params.imageUpload&&(k.image.params.imageUpload=ne=>{a.emit("imageUpload",ne)})},{immediate:!0}),h.watch(f,()=>{Ai()}),h.watch(_,R=>{setTimeout(()=>{P&&(Ai(),P.setOption("readOnly",R==="readonly"))})}),h.watch(y,R=>{P&&P.setOption("maxLength",R)}),{editorRef:H,overlayRef:E,cursorRef:B,renderRef:F,containerRef:W,toolbars:k,toolbarConfig:C,previewHtmlList:q,isHintShow:G,customToolbars:b,getEditorIns:Nn,onPaste:gn,previewContentChange:qe,onChecked:De,onPreviewScroll:kn,onPreviewMouseout:Oe,onPreviewMouseover:Ot}}function ov(r){const a=h.ref(!1);let i;const f=()=>{i&&(a.value=i.currentTheme.id.indexOf("dark")!==-1,r())};return h.onBeforeMount(()=>{i=window.devuiThemeService}),h.onMounted(()=>{f(),i&&i.eventBus&&i.eventBus.add("themeChanged",f)}),h.onBeforeUnmount(()=>{i&&i.eventBus&&i.eventBus.remove("themeChanged",f)}),{isDarkMode:a}}const Ya={baseUrl:{type:String,default:null},breaks:{type:Boolean,default:!0},customParse:{type:Function,default:null},renderParse:{type:Function,default:null},mdRules:{type:Object,default:()=>({})},customRendererRules:{type:Array,default:()=>[]},customXssRules:{type:Array,default:()=>[]},mdPlugins:{type:Array,default:()=>[]}},Ja={...Ya,modelValue:{type:String,default:""},options:{type:Object,default:()=>({})},mode:{type:String,default:"normal"},customThemeConfig:{type:Object},customToolbars:{type:Object},disableChangeEvent:{type:Boolean,default:!1},editorContainerHeight:{type:Number},imageUploadToServer:{type:Boolean,default:!1},hidePreviewView:{type:Boolean,default:!1},maxlength:{type:Number,default:null},placeholder:{type:String,default:""},toolbarConfig:{type:Array,default:()=>Q3},fullscreenZIndex:{type:Number,default:10},hintConfig:{type:Object,default:{}},customHintReplaceFn:{type:Function},beforeShowHint:{type:Function}},sn=Symbol("d-editor-md"),Qa={...Ya,content:{type:String,default:""},disableRender:{type:Boolean,default:!1}},eu={config:{type:Object,default:()=>({})}},av={visible:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeScope:{type:String,default:"all"},position:{type:Array,default:()=>["bottom","top","left","right"]},offset:{type:[Number,Object],default:4},shiftOffset:{type:Number},closeOnMouseLeaveMenu:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""},destroyOnHide:{type:Boolean,default:!0},teleport:{type:[String,Object],default:"body"},appendToBody:{type:Boolean,default:!0}},Ti=Symbol("popper-trigger"),pt=new Map;function Vt(r,a,i){return r==null||r.addEventListener(a,i),()=>{r==null||r.removeEventListener(a,i)}}const uv=({id:r,isOpen:a,origin:i,dropdownRef:f,props:_,emit:y})=>{let m=!1,C=!1;const{trigger:b,closeScope:L,closeOnMouseLeaveMenu:S}=h.toRefs(_),x=D=>{a.value=D,y("toggle",a.value)},I=async(D,k)=>{await new Promise(H=>setTimeout(H,50)),!(D==="origin"&&m||D==="dropdown"&&C)&&(k&&[...pt.values()].reverse().forEach(H=>{setTimeout(()=>{var F;(F=H.toggle)==null||F.call(H)},0)}),x(!1))};h.watch([b,i,f],([D,k,H],F,E)=>{const B=Zs(k),W=[];setTimeout(()=>{W.push(Vt(document,"click",G=>{G.stopPropagation();const q=[...pt.values()];!a.value||L.value==="none"||(H==null?void 0:H.contains(G.target))&&L.value==="blank"||q.some(P=>{var ae;return(ae=P.toggleEl)==null?void 0:ae.contains(G.target)})&&q.some(P=>{var ae;return(ae=P.menuEl)==null?void 0:ae.contains(G.target)})||([...pt.values()].reverse().forEach(P=>{setTimeout(()=>{var ae,se;(ae=P.toggleEl)!=null&&ae.contains(G.target)||(se=P.toggle)==null||se.call(P)},0)}),m=!1)}))},0),D==="click"?W.push(Vt(B,"click",()=>x(!a.value)),Vt(H,"mouseleave",G=>{var q;S.value&&!((q=pt.get(r).child)!=null&&q.contains(G.relatedTarget))&&I("dropdown",!0)})):D==="hover"&&W.push(Vt(B,"mouseenter",()=>{C=!0,x(!0)}),Vt(B,"mouseleave",()=>{C=!1,I("origin")}),Vt(H,"mouseenter",()=>{m=!0,a.value=!0}),Vt(H,"mouseleave",G=>{var q;m=!1,!(G.relatedTarget&&((B==null?void 0:B.contains(G.relatedTarget))||((q=pt.get(r).child)==null?void 0:q.contains(G.relatedTarget))))&&I("dropdown",!0)})),E(()=>W.forEach(G=>G()))})};function lv(r,a,i,f,_,y){h.watch(a,(m,C)=>{C!==void 0&&(i.value=m,y("toggle",i.value))},{immediate:!0}),h.watch([i,_],([m,C])=>{var b;if(m){pt.set(r,{...pt.get(r),menuEl:C,toggle:()=>{i.value=!1,y("toggle",i.value)}});for(const L of pt.values())(b=L.menuEl)!=null&&b.contains(f.value)&&(L.child=C)}}),h.onMounted(()=>{pt.set(r,{toggleEl:f.value})}),h.onUnmounted(()=>{pt.delete(r)})}function sv(r,a,i){const{showAnimation:f,overlayClass:_,destroyOnHide:y}=h.toRefs(r),m=h.ref(!1),C=h.ref(!1),b=h.computed(()=>({transformOrigin:a.value==="top"?"0% 100%":"0% 0%",zIndex:"var(--devui-z-index-dropdown, 1052)"})),L=h.computed(()=>({"fade-in-bottom":f.value&&i.value&&a.value==="bottom","fade-in-top":f.value&&i.value&&a.value==="top",[`${_.value}`]:!0})),S=x=>{a.value=x.includes("top")||x.includes("right-end")||x.includes("left-end")?"top":"bottom"};return h.watch(i,x=>{m.value=y.value?x:!0,C.value=x}),{overlayModelValue:m,overlayShowValue:C,styles:b,classes:L,handlePositionChange:S}}const fv={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function cv(r,a){let i;const f=y=>{y.preventDefault(),a.emit("click",y),r.closeOnClickOverlay&&a.emit("update:modelValue",!1)},_=()=>{i==null||i()};return h.watch(()=>r.modelValue,y=>{y?r.lockScroll&&(i=zs()):_()}),h.onUnmounted(_),{onClick:f}}function gr(r,a,i){let f=r;return a&&(f+=`__${a}`),i&&(f+=`--${i}`),f}function fn(r,a=!1){const i=a?`.devui-${r}`:`devui-${r}`;return{b:()=>gr(i),e:C=>C?gr(i,C):"",m:C=>C?gr(i,"",C):"",em:(C,b)=>C&&b?gr(i,C,b):""}}var xb="";h.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:fv,emits:["update:modelValue","click"],setup(r,a){const{modelValue:i}=h.toRefs(r),f=fn("fixed-overlay"),{onClick:_}=cv(r,a);return()=>h.createVNode(h.Transition,{name:f.m("fade")},{default:()=>{var y,m;return[i.value&&h.createVNode("div",h.mergeProps({class:f.b()},a.attrs,{onClick:_}),[(m=(y=a.slots).default)==null?void 0:m.call(y)])]}})}});const hv={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0},clickEventBubble:{type:Boolean,default:!1},fitOriginWidth:{type:Boolean,default:!1}};function dv(r,a,i,f){let{x:_,y}=a;if(!r){const{width:m,height:C}=f;_&&i.includes("start")&&(_=12),_&&i.includes("end")&&(_=Math.round(m-24)),y&&i.includes("start")&&(y=10),y&&i.includes("end")&&(y=C-14)}return{x:_,y}}function pv(r,a){const{fitOriginWidth:i,position:f,showArrow:_}=h.toRefs(r),y=h.ref(),m=h.ref(),C=h.ref(0);let b;const L=h.computed(()=>i.value?{width:C.value+"px"}:{}),S=(F,E,B,W)=>{const{x:G,y:q}=dv(r.isArrowCenter,B,E,W.getBoundingClientRect()),P={top:"bottom",right:"left",bottom:"top",left:"right"}[E.split("-")[0]];Object.assign(F.style,{left:G?`${G}px`:"",top:q?`${q}px`:"",right:"",bottom:"",[P]:"-4px"})},x=async()=>{const F=r.origin,E=h.unref(y.value),B=h.unref(m.value),[W,...G]=f.value,q=[Fn.offset(r.offset)];q.push(G.length?Fn.flip({fallbackPlacements:G}):Fn.flip()),_.value&&q.push(Fn.arrow({element:m.value}));const{x:P,y:ae,placement:se,middlewareData:at}=await Fn.computePosition(F,E,{strategy:"fixed",placement:W,middleware:q});let je=P,Be=ae;a("positionChange",se),Object.assign(E.style,{top:`${Be}px`,left:`${je}px`}),r.showArrow&&S(B,se,at.arrow,E)},I=F=>{var B,W;const E=F.target;E!=null&&E.contains((W=(B=r.origin)==null?void 0:B.$el)!=null?W:r.origin)&&x()},D=F=>{C.value=F.getBoundingClientRect().width,x()},k=()=>{var F,E;if(i.value&&typeof window!="undefined"){const B=(E=(F=r.origin)==null?void 0:F.$el)!=null?E:r.origin;B&&(b=new window.ResizeObserver(()=>D(B)),b.observe(B))}},H=()=>{var E,B;const F=(B=(E=r.origin)==null?void 0:E.$el)!=null?B:r.origin;F&&(b==null||b.unobserve(F))};return h.watch(()=>r.modelValue,()=>{r.modelValue&&r.origin?(h.nextTick(x),window.addEventListener("scroll",I,!0),window.addEventListener("resize",x),k()):(window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",x),H())}),h.onUnmounted(()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",x),H()}),{arrowRef:m,overlayRef:y,styles:L,updatePosition:x}}var Ab="";const vr=h.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:hv,emits:["update:modelValue","positionChange"],setup(r,{slots:a,attrs:i,emit:f,expose:_}){const y=fn("flexible-overlay"),{clickEventBubble:m}=h.toRefs(r),{arrowRef:C,overlayRef:b,styles:L,updatePosition:S}=pv(r,f);return _({updatePosition:S}),()=>{var x;return r.modelValue&&h.createVNode("div",h.mergeProps({ref:b,class:y.b(),style:L.value},i,{onClick:h.withModifiers(()=>({}),[m.value?"":"stop"]),onPointerup:h.withModifiers(()=>({}),["stop"])}),[(x=a.default)==null?void 0:x.call(a),r.showArrow&&h.createVNode("div",{ref:C,class:y.e("arrow")},null)])}}});/**
|
|
137
137
|
* @vue/shared v3.5.22
|
|
138
138
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
139
139
|
* @license MIT
|
|
140
|
-
**/const gv=r=>r!==null&&typeof r=="object",vv=fn("popper-trigger");function tu(r){return h.h("span",{class:vv.b()},r)}function nu(r){for(const a of r){if(gv(a)){if(a.type===h.Comment)continue;return a.type==="svg"||a.type===h.Text?tu(a):a.type===h.Fragment?nu(a.children):a}return tu(a)}return null}var ru=h.defineComponent({name:"DPopperTrigger",setup(r,a){const{slots:i,attrs:f}=a;return()=>{var C;const _=(C=i.default)==null?void 0:C.call(i,f),y=h.inject(Ti);if(!_)return null;const m=nu(_);return m?h.withDirectives(h.cloneVNode(m,f),[[{mounted(b){y.value=b},updated(b){y.value=b},unmounted(){y.value=null}}]]):null}}}),Tb="";let _v=1;var mv=h.defineComponent({name:"DDropdown",inheritAttrs:!1,props:av,emits:["toggle"],setup(r,{slots:a,attrs:i,emit:f,expose:_}){const{visible:y,position:m,offset:C,destroyOnHide:b,shiftOffset:L,showAnimation:S,teleport:x}=h.toRefs(r),I=h.ref(),D=h.ref(),k=h.ref(),H=`dropdown_${_v++}`,F=h.ref(!1),E=h.ref("bottom"),B=fn("dropdown");h.provide(Ti,I),uv({id:H,isOpen:F,origin:I,dropdownRef:D,props:r,emit:f}),lv(H,y,F,I,D,f);const{overlayModelValue:W,overlayShowValue:G,styles:q,classes:P,handlePositionChange:ae}=sv(r,E,F);return h.watch(G,se=>{h.nextTick(()=>{!b.value&&se&&k.value.updatePosition()})}),_({updatePosition:()=>k.value.updatePosition()}),()=>h.createVNode(h.Fragment,null,[h.createVNode(ru,null,{default:()=>{var se;return[(se=a.default)==null?void 0:se.call(a)]}}),h.createVNode(h.Teleport,{to:x.value},{default:()=>[h.createVNode(h.Transition,{name:S.value?B.m(`fade-${E.value}`):""},{default:()=>[h.withDirectives(h.createVNode(vr,{modelValue:W.value,"onUpdate:modelValue":se=>W.value=se,ref:k,origin:I.value,position:m.value,offset:C.value,shiftOffset:L==null?void 0:L.value,onPositionChange:ae,"click-event-bubble":!0,class:P.value,style:q.value},{default:()=>{var se;return[h.createVNode("div",h.mergeProps({ref:D,class:B.e("menu-wrap")},i),[(se=a.menu)==null?void 0:se.call(a)])]}}),[[h.vShow,G.value]])]})]})])}});const yv={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},clickOutside:{type:Function,default:()=>!0},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""}};h.defineComponent({name:"DDropdownMenu",inheritAttrs:!1,props:yv,emits:["update:modelValue"],setup(r,{slots:a,attrs:i,emit:f}){const{modelValue:_,origin:y,position:m,align:C,offset:b,clickOutside:L,showAnimation:S,overlayClass:x}=h.toRefs(r),I=h.ref(null),D=fn("dropdown");Bs.onClickOutside(I,E=>{var B,W;((B=L.value)==null?void 0:B.call(L))&&!((W=y==null?void 0:y.value)!=null&&W.contains(E.target))&&f("update:modelValue",!1)});const k=h.ref("bottom"),H=E=>{k.value=E.split("-")[0]==="top"?"top":"bottom"},F=h.computed(()=>({transformOrigin:k.value==="top"?"0% 100%":"0% 0%"}));return()=>h.createVNode(h.Teleport,{to:"body"},{default:()=>[h.createVNode(h.Transition,{name:S.value?D.m(`fade-${k.value}`):""},{default:()=>[h.createVNode(vr,{modelValue:_.value,"onUpdate:modelValue":E=>_.value=E,origin:y==null?void 0:y.value,position:m.value,align:C.value,offset:b.value,onPositionChange:H,class:x.value,style:F.value},{default:()=>{var E;return[h.createVNode("div",h.mergeProps({ref:I,class:D.e("menu-wrap")},i),[(E=a.default)==null?void 0:E.call(a)])]}})]})]})}});const bv={content:{type:String,default:""},position:{type:[String,Array],default:()=>["top","right","bottom","left"]},showAnimation:{type:Boolean,default:!0},mouseEnterDelay:{type:Number,default:150},mouseLeaveDelay:{type:Number,default:100},enterable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},hideAfter:{type:Number,default:0},overlayClass:{type:String,default:""},teleport:{type:[String,Object],default:"body"}},wv={top:"50% calc(100% + 8px)",bottom:"50% -8px",left:"calc(100% + 8px)",right:"-8px 50%"};function Lv(r,a){const{position:i,mouseEnterDelay:f,mouseLeaveDelay:_,enterable:y,disabled:m,hideAfter:C}=h.toRefs(a),b=h.ref(!1),L=h.ref(!1),S=h.computed(()=>typeof i.value=="string"?[i.value]:i.value),x=h.ref(S.value[0]),I=h.computed(()=>({transformOrigin:wv[x.value]})),D=ln.exports.debounce(()=>{L.value&&(b.value=!0)},f.value),k=ln.exports.debounce(()=>{!L.value&&(b.value=!1)},_.value),H=()=>{m.value||(L.value=!0,D())},F=()=>{L.value=!1,k()},E=q=>{x.value=q},B=()=>{L.value=!1,b.value=!1},W=()=>{y.value?H():B()};h.onMounted(()=>{r.value.addEventListener("mouseenter",H),r.value.addEventListener("mouseleave",F)});let G;return h.watch(b,q=>{q&&C.value&&(G&&clearTimeout(G),G=setTimeout(B,C.value))}),{visible:b,placement:x,positionArr:S,overlayStyles:I,onPositionChange:E,onMouseenter:H,onMouseleave:F,onMouseenterOverlay:W}}var $b="",iu=h.defineComponent({name:"DTooltip",props:bv,setup(r,{slots:a}){const{showAnimation:i,content:f,overlayClass:_,teleport:y}=h.toRefs(r),m=h.ref(),C=h.ref(),{visible:b,placement:L,positionArr:S,overlayStyles:x,onPositionChange:I,onMouseleave:D,onMouseenterOverlay:k}=Lv(m,r),H=fn("tooltip"),F=h.computed(()=>({[H.b()]:!0,[H.m(L.value)]:!0,[H.m("with-content")]:a.content,[_.value]:!0}));return h.provide(Ti,m),()=>h.createVNode(h.Fragment,null,[h.createVNode(ru,null,{default:()=>{var E;return[(E=a.default)==null?void 0:E.call(a)]}}),h.createVNode(h.Teleport,{to:y.value},{default:()=>[h.createVNode(h.Transition,{name:i.value?H.m(`fade-${L.value}`):""},{default:()=>[h.createVNode(vr,{modelValue:b.value,"onUpdate:modelValue":E=>b.value=E,ref:C,class:F.value,origin:m.value,position:S.value,offset:6,"show-arrow":!0,style:x.value,onPositionChange:I,onMouseenter:k,onMouseleave:D},{default:()=>{var E;return[a.content?(E=a.content)==null?void 0:E.call(a):h.createVNode("span",null,[f.value])]}})]})]})])}}),Cv=h.defineComponent({name:"FontColor",setup(){const{getEditorIns:r,t:a}=h.inject(sn),i=(f,_)=>{const y=r(),m=y.getSelection(),C=f==="bg"?"background-color:":"color:";y.focus(),y.replaceSelection(`<span style="${C}${_};">${m}</span>`),setTimeout(()=>{if(m===""){const b=y.getCursor();y.setCursor(b.line,b.ch-7)}})};return()=>h.createVNode("div",{class:"dropdown-font-color"},[h.createVNode("div",{class:"color-wrap"},[h.createVNode("p",null,[a("color")]),h.createVNode("ul",{class:"color-picker"},[Xa.map((f,_)=>h.createVNode("li",{key:_,style:{backgroundColor:f},onClick:()=>i("ft",f)},null))])]),h.createVNode("div",{class:"color-wrap"},[h.createVNode("p",null,[a("background")]),h.createVNode("ul",{class:"color-picker"},[Xa.map((f,_)=>h.createVNode("li",{key:_,style:{backgroundColor:f},onClick:()=>i("bg",f)},null))])])])}}),xv=h.defineComponent({name:"FontSize",setup(){const{getEditorIns:r}=h.inject(sn),a=i=>{const f=r(),_=f.getSelection();f.focus(),f.replaceSelection(`<span style="font-size:${i}px;">${_}</span>`),setTimeout(()=>{if(_===""){const y=f.getCursor();f.setCursor(y.line,y.ch-7)}})};return()=>h.createVNode("ul",{class:"dropdown-font-size"},[ev.map((i,f)=>h.createVNode("li",{key:f,onClick:()=>a(i.value)},[i.name]))])}}),ou=h.defineComponent({name:"DMdToolbarItem",props:eu,setup(r){const a=h.reactive(r.config),{showFullscreen:i,getEditorIns:f,t:_}=h.inject(sn),y=(C,b)=>{var S;if(!C&&!b)return"";if(C==="fullscreen")return`<center>${i.value?_(a.exitName):_(C)}</center>`;let L;if(C!=null&&C.includes("&")){const x=C.split("&");L=_(x[0])+" & "+_(x[1])}return`<center>${(S=L!=null?L:_(C))!=null?S:""}<br>${b!=null?b:""}</center>`},m=()=>{var b;const C=f();if(a.id==="fullscreen"&&(i.value=!i.value,window)){const L=new Event("resize");window.dispatchEvent(L)}(b=a.handler)==null||b.call(a,C,a.params)};return()=>h.createVNode(h.Fragment,null,[a.type==="button"&&h.createVNode(iu,{position:["top","bottom"],"hide-after":1e3},{default:()=>h.createVNode("span",{class:"md-toolbar-item",onClick:m,innerHTML:a.id==="fullscreen"&&i.value?a.exitIcon:a.icon},null),content:()=>h.createVNode("span",{class:"md-toolbar-tip-content",innerHTML:y(a.name,a.shortKey)},null)}),a.type==="dropDown"&&h.createVNode(mv,{position:["bottom-start"],align:"start"},{default:()=>h.createVNode("span",null,[h.createVNode(iu,{position:i.value?["right"]:["top"],content:y(a.name),"hide-after":1e3},{default:()=>h.createVNode("span",{class:"md-toolbar-item",onClick:()=>{var C;return(C=a.handler)==null?void 0:C.call(a)},innerHTML:a.icon},null),content:()=>h.createVNode("span",{class:"md-toolbar-tip-content",innerHTML:y(a.name)},null)})]),menu:()=>h.createVNode(h.Fragment,null,[a.component==="FontSize"&&h.createVNode(xv,null,null),a.component==="FontColor"&&h.createVNode(Cv,null,null)])})])}});function Av(){const{toolbars:r,toolbarConfig:a,customToolbars:i}=h.inject(sn);return{toolbars:r,toolbarConfig:a,customToolbars:i}}var Sb="",Tv=h.defineComponent({name:"DMdToolbar",setup(){const{toolbars:r,toolbarConfig:a,customToolbars:i}=Av(),f={...r,...i==null?void 0:i.value};return()=>h.createVNode("div",{class:"md-toolbar-container"},[a.value.map((_,y)=>Array.isArray(_)?h.createVNode(h.Fragment,null,[_.map((m,C)=>h.createVNode(ou,{config:f[m],key:`${y}-${C}`},null)),h.createVNode("span",{class:"md-toolbar-span"},null)]):h.createVNode(ou,{config:f[_],key:y},null))])}});const $v={startOnLoad:!1,securityLevel:"strict",theme:"default",flowchart:{htmlLabels:!0,useMaxWidth:!1}};function Sv(r,a){try{return`<div class="mermaid" id="${a.id}">${r}</div>`}catch(i){return`<pre>${i.name}: ${i.message}</pre>`}}function Ev(r,a={}){ta.default.initialize(Object.assign($v,a));const i=r.renderer.rules.fence.bind(r.renderer.rules);r.renderer.rules.fence=(f,_,y,m,C)=>{const b=f[_],L=b.content.trim();return b.info.startsWith("mermaid")?Sv(L,a):i(f,_,y,m,C)}}function Ov(r=0){setTimeout(()=>{ta.default.init()},r)}const au="[toc]",Iv=/^\[toc\]/im,Fv=(r,a)=>new Array(a+1).join(r)+"*",$i=r=>r.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");let _r=null;function Mv(r,a){const i={maxLevel:6,...a};let f="";_r=qa(r);const _=b=>{const L={nodes:[]};return b.forEach(S=>{if(S.level>i.maxLevel)return;let x=L;for(let I=1;I<S.level;I++)x.nodes.length===0&&x.nodes.push({heading:{},nodes:[]}),x=x.nodes[x.nodes.length-1];x.nodes.push({heading:S,nodes:[]})}),L};r.core.ruler.push("init_toc",b=>{const L=b.tokens,S=[];let x=[];for(let F=0;F<L.length;F++)if(L[F].type==="heading_close"){const E=L[F-1],B=L[F];if(E.type==="inline"){let W;E.children&&E.children.length>0&&E.children[0].type==="link_open"?(W=E.children[1].content,E._tocAnchor=$i(W)):(W=E.content,E._tocAnchor=$i(E.children.reduce((G,q)=>G+q.content,""))),S.push({content:W,anchor:$i(W),level:Number(B.tag.substr(1,1))})}}const I=_(S),D=new Map,k=(F,E=0)=>F.map(B=>{let W=`${B.heading.content?Fv(" ",E):""}`;return B.heading.content?D.has(B.heading.anchor)?(D.set(B.heading.anchor,D.get(B.heading.anchor)+1),W+=` [${B.heading.content}](#${B.heading.anchor}-${D.get(B.heading.anchor)})
|
|
140
|
+
**/const gv=r=>r!==null&&typeof r=="object",vv=fn("popper-trigger");function tu(r){return h.h("span",{class:vv.b()},r)}function nu(r){for(const a of r){if(gv(a)){if(a.type===h.Comment)continue;return a.type==="svg"||a.type===h.Text?tu(a):a.type===h.Fragment?nu(a.children):a}return tu(a)}return null}var ru=h.defineComponent({name:"DPopperTrigger",setup(r,a){const{slots:i,attrs:f}=a;return()=>{var C;const _=(C=i.default)==null?void 0:C.call(i,f),y=h.inject(Ti);if(!_)return null;const m=nu(_);return m?h.withDirectives(h.cloneVNode(m,f),[[{mounted(b){y.value=b},updated(b){y.value=b},unmounted(){y.value=null}}]]):null}}}),Tb="";let _v=1;var mv=h.defineComponent({name:"DDropdown",inheritAttrs:!1,props:av,emits:["toggle"],setup(r,{slots:a,attrs:i,emit:f,expose:_}){const{visible:y,position:m,offset:C,destroyOnHide:b,shiftOffset:L,showAnimation:S,teleport:x}=h.toRefs(r),I=h.ref(),D=h.ref(),k=h.ref(),H=`dropdown_${_v++}`,F=h.ref(!1),E=h.ref("bottom"),B=fn("dropdown");h.provide(Ti,I),uv({id:H,isOpen:F,origin:I,dropdownRef:D,props:r,emit:f}),lv(H,y,F,I,D,f);const{overlayModelValue:W,overlayShowValue:G,styles:q,classes:P,handlePositionChange:ae}=sv(r,E,F);return h.watch(G,se=>{h.nextTick(()=>{!b.value&&se&&k.value.updatePosition()})}),_({updatePosition:()=>k.value.updatePosition()}),()=>h.createVNode(h.Fragment,null,[h.createVNode(ru,null,{default:()=>{var se;return[(se=a.default)==null?void 0:se.call(a)]}}),h.createVNode(h.Teleport,{to:x.value,disabled:!r.appendToBody},{default:()=>[h.createVNode(h.Transition,{name:S.value?B.m(`fade-${E.value}`):""},{default:()=>[h.withDirectives(h.createVNode(vr,{modelValue:W.value,"onUpdate:modelValue":se=>W.value=se,ref:k,origin:I.value,position:m.value,offset:C.value,shiftOffset:L==null?void 0:L.value,onPositionChange:ae,"click-event-bubble":!0,class:P.value,style:q.value},{default:()=>{var se;return[h.createVNode("div",h.mergeProps({ref:D,class:B.e("menu-wrap")},i),[(se=a.menu)==null?void 0:se.call(a)])]}}),[[h.vShow,G.value]])]})]})])}});const yv={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},clickOutside:{type:Function,default:()=>!0},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""}};h.defineComponent({name:"DDropdownMenu",inheritAttrs:!1,props:yv,emits:["update:modelValue"],setup(r,{slots:a,attrs:i,emit:f}){const{modelValue:_,origin:y,position:m,align:C,offset:b,clickOutside:L,showAnimation:S,overlayClass:x}=h.toRefs(r),I=h.ref(null),D=fn("dropdown");Bs.onClickOutside(I,E=>{var B,W;((B=L.value)==null?void 0:B.call(L))&&!((W=y==null?void 0:y.value)!=null&&W.contains(E.target))&&f("update:modelValue",!1)});const k=h.ref("bottom"),H=E=>{k.value=E.split("-")[0]==="top"?"top":"bottom"},F=h.computed(()=>({transformOrigin:k.value==="top"?"0% 100%":"0% 0%"}));return()=>h.createVNode(h.Teleport,{to:"body"},{default:()=>[h.createVNode(h.Transition,{name:S.value?D.m(`fade-${k.value}`):""},{default:()=>[h.createVNode(vr,{modelValue:_.value,"onUpdate:modelValue":E=>_.value=E,origin:y==null?void 0:y.value,position:m.value,align:C.value,offset:b.value,onPositionChange:H,class:x.value,style:F.value},{default:()=>{var E;return[h.createVNode("div",h.mergeProps({ref:I,class:D.e("menu-wrap")},i),[(E=a.default)==null?void 0:E.call(a)])]}})]})]})}});const bv={content:{type:String,default:""},position:{type:[String,Array],default:()=>["top","right","bottom","left"]},showAnimation:{type:Boolean,default:!0},mouseEnterDelay:{type:Number,default:150},mouseLeaveDelay:{type:Number,default:100},enterable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},hideAfter:{type:Number,default:0},overlayClass:{type:String,default:""},teleport:{type:[String,Object],default:"body"}},wv={top:"50% calc(100% + 8px)",bottom:"50% -8px",left:"calc(100% + 8px)",right:"-8px 50%"};function Lv(r,a){const{position:i,mouseEnterDelay:f,mouseLeaveDelay:_,enterable:y,disabled:m,hideAfter:C}=h.toRefs(a),b=h.ref(!1),L=h.ref(!1),S=h.computed(()=>typeof i.value=="string"?[i.value]:i.value),x=h.ref(S.value[0]),I=h.computed(()=>({transformOrigin:wv[x.value]})),D=ln.exports.debounce(()=>{L.value&&(b.value=!0)},f.value),k=ln.exports.debounce(()=>{!L.value&&(b.value=!1)},_.value),H=()=>{m.value||(L.value=!0,D())},F=()=>{L.value=!1,k()},E=q=>{x.value=q},B=()=>{L.value=!1,b.value=!1},W=()=>{y.value?H():B()};h.onMounted(()=>{r.value.addEventListener("mouseenter",H),r.value.addEventListener("mouseleave",F)});let G;return h.watch(b,q=>{q&&C.value&&(G&&clearTimeout(G),G=setTimeout(B,C.value))}),{visible:b,placement:x,positionArr:S,overlayStyles:I,onPositionChange:E,onMouseenter:H,onMouseleave:F,onMouseenterOverlay:W}}var $b="",iu=h.defineComponent({name:"DTooltip",props:bv,setup(r,{slots:a}){const{showAnimation:i,content:f,overlayClass:_,teleport:y}=h.toRefs(r),m=h.ref(),C=h.ref(),{visible:b,placement:L,positionArr:S,overlayStyles:x,onPositionChange:I,onMouseleave:D,onMouseenterOverlay:k}=Lv(m,r),H=fn("tooltip"),F=h.computed(()=>({[H.b()]:!0,[H.m(L.value)]:!0,[H.m("with-content")]:a.content,[_.value]:!0}));return h.provide(Ti,m),()=>h.createVNode(h.Fragment,null,[h.createVNode(ru,null,{default:()=>{var E;return[(E=a.default)==null?void 0:E.call(a)]}}),h.createVNode(h.Teleport,{to:y.value},{default:()=>[h.createVNode(h.Transition,{name:i.value?H.m(`fade-${L.value}`):""},{default:()=>[h.createVNode(vr,{modelValue:b.value,"onUpdate:modelValue":E=>b.value=E,ref:C,class:F.value,origin:m.value,position:S.value,offset:6,"show-arrow":!0,style:x.value,onPositionChange:I,onMouseenter:k,onMouseleave:D},{default:()=>{var E;return[a.content?(E=a.content)==null?void 0:E.call(a):h.createVNode("span",null,[f.value])]}})]})]})])}}),Cv=h.defineComponent({name:"FontColor",setup(){const{getEditorIns:r,t:a}=h.inject(sn),i=(f,_)=>{const y=r(),m=y.getSelection(),C=f==="bg"?"background-color:":"color:";y.focus(),y.replaceSelection(`<span style="${C}${_};">${m}</span>`),setTimeout(()=>{if(m===""){const b=y.getCursor();y.setCursor(b.line,b.ch-7)}})};return()=>h.createVNode("div",{class:"dropdown-font-color"},[h.createVNode("div",{class:"color-wrap"},[h.createVNode("p",null,[a("color")]),h.createVNode("ul",{class:"color-picker"},[Xa.map((f,_)=>h.createVNode("li",{key:_,style:{backgroundColor:f},onClick:()=>i("ft",f)},null))])]),h.createVNode("div",{class:"color-wrap"},[h.createVNode("p",null,[a("background")]),h.createVNode("ul",{class:"color-picker"},[Xa.map((f,_)=>h.createVNode("li",{key:_,style:{backgroundColor:f},onClick:()=>i("bg",f)},null))])])])}}),xv=h.defineComponent({name:"FontSize",setup(){const{getEditorIns:r}=h.inject(sn),a=i=>{const f=r(),_=f.getSelection();f.focus(),f.replaceSelection(`<span style="font-size:${i}px;">${_}</span>`),setTimeout(()=>{if(_===""){const y=f.getCursor();f.setCursor(y.line,y.ch-7)}})};return()=>h.createVNode("ul",{class:"dropdown-font-size"},[ev.map((i,f)=>h.createVNode("li",{key:f,onClick:()=>a(i.value)},[i.name]))])}}),ou=h.defineComponent({name:"DMdToolbarItem",props:eu,setup(r){const a=h.reactive(r.config),{showFullscreen:i,getEditorIns:f,t:_}=h.inject(sn),y=(C,b)=>{var S;if(!C&&!b)return"";if(C==="fullscreen")return`<center>${i.value?_(a.exitName):_(C)}</center>`;let L;if(C!=null&&C.includes("&")){const x=C.split("&");L=_(x[0])+" & "+_(x[1])}return`<center>${(S=L!=null?L:_(C))!=null?S:""}<br>${b!=null?b:""}</center>`},m=()=>{var b;const C=f();if(a.id==="fullscreen"&&(i.value=!i.value,window)){const L=new Event("resize");window.dispatchEvent(L)}(b=a.handler)==null||b.call(a,C,a.params)};return()=>h.createVNode(h.Fragment,null,[a.type==="button"&&h.createVNode(iu,{position:["top","bottom"],"hide-after":1e3},{default:()=>h.createVNode("span",{class:"md-toolbar-item",onClick:m,innerHTML:a.id==="fullscreen"&&i.value?a.exitIcon:a.icon},null),content:()=>h.createVNode("span",{class:"md-toolbar-tip-content",innerHTML:y(a.name,a.shortKey)},null)}),a.type==="dropDown"&&h.createVNode(mv,{position:["bottom-start"],align:"start"},{default:()=>h.createVNode("span",null,[h.createVNode(iu,{position:i.value?["right"]:["top"],content:y(a.name),"hide-after":1e3},{default:()=>h.createVNode("span",{class:"md-toolbar-item",onClick:()=>{var C;return(C=a.handler)==null?void 0:C.call(a)},innerHTML:a.icon},null),content:()=>h.createVNode("span",{class:"md-toolbar-tip-content",innerHTML:y(a.name)},null)})]),menu:()=>h.createVNode(h.Fragment,null,[a.component==="FontSize"&&h.createVNode(xv,null,null),a.component==="FontColor"&&h.createVNode(Cv,null,null)])})])}});function Av(){const{toolbars:r,toolbarConfig:a,customToolbars:i}=h.inject(sn);return{toolbars:r,toolbarConfig:a,customToolbars:i}}var Sb="",Tv=h.defineComponent({name:"DMdToolbar",setup(){const{toolbars:r,toolbarConfig:a,customToolbars:i}=Av(),f={...r,...i==null?void 0:i.value};return()=>h.createVNode("div",{class:"md-toolbar-container"},[a.value.map((_,y)=>Array.isArray(_)?h.createVNode(h.Fragment,null,[_.map((m,C)=>h.createVNode(ou,{config:f[m],key:`${y}-${C}`},null)),h.createVNode("span",{class:"md-toolbar-span"},null)]):h.createVNode(ou,{config:f[_],key:y},null))])}});const $v={startOnLoad:!1,securityLevel:"strict",theme:"default",flowchart:{htmlLabels:!0,useMaxWidth:!1}};function Sv(r,a){try{return`<div class="mermaid" id="${a.id}">${r}</div>`}catch(i){return`<pre>${i.name}: ${i.message}</pre>`}}function Ev(r,a={}){ta.default.initialize(Object.assign($v,a));const i=r.renderer.rules.fence.bind(r.renderer.rules);r.renderer.rules.fence=(f,_,y,m,C)=>{const b=f[_],L=b.content.trim();return b.info.startsWith("mermaid")?Sv(L,a):i(f,_,y,m,C)}}function Ov(r=0){setTimeout(()=>{ta.default.init()},r)}const au="[toc]",Iv=/^\[toc\]/im,Fv=(r,a)=>new Array(a+1).join(r)+"*",$i=r=>r.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");let _r=null;function Mv(r,a){const i={maxLevel:6,...a};let f="";_r=qa(r);const _=b=>{const L={nodes:[]};return b.forEach(S=>{if(S.level>i.maxLevel)return;let x=L;for(let I=1;I<S.level;I++)x.nodes.length===0&&x.nodes.push({heading:{},nodes:[]}),x=x.nodes[x.nodes.length-1];x.nodes.push({heading:S,nodes:[]})}),L};r.core.ruler.push("init_toc",b=>{const L=b.tokens,S=[];let x=[];for(let F=0;F<L.length;F++)if(L[F].type==="heading_close"){const E=L[F-1],B=L[F];if(E.type==="inline"){let W;E.children&&E.children.length>0&&E.children[0].type==="link_open"?(W=E.children[1].content,E._tocAnchor=$i(W)):(W=E.content,E._tocAnchor=$i(E.children.reduce((G,q)=>G+q.content,""))),S.push({content:W,anchor:$i(W),level:Number(B.tag.substr(1,1))})}}const I=_(S),D=new Map,k=(F,E=0)=>F.map(B=>{let W=`${B.heading.content?Fv(" ",E):""}`;return B.heading.content?D.has(B.heading.anchor)?(D.set(B.heading.anchor,D.get(B.heading.anchor)+1),W+=` [${B.heading.content}](#${B.heading.anchor}-${D.get(B.heading.anchor)})
|
|
141
141
|
`):(D.set(B.heading.anchor,0),W+=` [${B.heading.content}](#${B.heading.anchor})
|
|
142
142
|
`):W+=`
|
|
143
143
|
`,B.nodes.length&&(W+=B.heading.content?k(B.nodes,E+1):k(B.nodes,E)),W}).join(""),H=k(I.nodes);x=_r.parse(H,{}),f=_r.renderer.render(x,_r.options)}),r.inline.ruler.after("emphasis","toc",(b,L)=>{let S,x;return L||(x=Iv.exec(b.src),x=x?x.filter(I=>I):[],x.length<1)?!1:(S=b.push("toc_open","toc",1),S.markup=au,S=b.push("toc_body","",0),S=b.push("toc_close","toc",-1),b.pos=b.pos+au.length,!0)});const y=()=>({...new Wt.default("text","",0),content:" "}),m=(b,L,S,x)=>{const I=[];L.anchorClassName!==null&&L.anchorClassName!==void 0&&I.push(["class",L.anchorClassName]),I.push(["href",`#${b}`]);const D={...new Wt.default("link_open","a",1),attrs:I},k=new Wt.default("link_close","a",-1),H=()=>L.anchorLinkSymbolClassName?[{...new Wt.default("span_open","span",1),attrs:[["class",L.anchorLinkSymbolClassName]]},{...new Wt.default("text","",0),content:L.anchorLinkSymbol},new Wt.default("span_close","span",-1)]:[{...new Wt.default("text","",0),content:L.anchorLinkSymbol}];if(L.wrapHeadingTextInAnchor)S[x+1].children.unshift(D),S[x+1].children.push(k);else{const F=[D,...H(),k],E={false:"push",true:"unshift"};L.anchorLinkSpace&&F[E[L==null?void 0:L.anchorLinkBefore]](y()),S[x+1].children[E[L.anchorLinkBefore]](...F)}},C=r.renderer.rules.heading_open||function(...b){const[L,S,,,x]=b;return x.renderToken(L,S,a)};r.renderer.rules.heading_open=function(...b){const[L,S,,,]=b,x=L[S].attrs=L[S].attrs||[],I=L[S+1]._tocAnchor;return x.push(["id",I]),i.anchorLink&&m(I,i,L,S),C.apply(this,b)},r.renderer.rules.toc_open=()=>"",r.renderer.rules.toc_close=()=>"",r.renderer.rules.toc_body=()=>f}class Rv{constructor(){this.xssWhiteList=ui.getDefaultWhiteList(),this.cssWhiteList=ui.getDefaultCSSWhiteList(),this.mdt=new Us.default({linkify:!0,html:!0,highlight:function(a,i){if(i&&ea.default.getLanguage(i))try{return ea.default.highlight(a,{language:i}).value}catch{}return""}}),this.baseUrl="",this.breaks=!0,this.setDefaultXss(),this.mdt.use(Mv,{linkify:!1,anchorLink:!1}).use(Ev,{id:"devui-mermaid"})}setDefaultXss(){this.xssWhiteList.input=["type","checked","disabled","class"],this.xssWhiteList.label=["for"],this.xssWhiteList.ul=["class"],this.xssWhiteList.div=["class"],this.xssWhiteList.a=["href","class","target","name"],this.xssWhiteList.ol=["start"],this.xssWhiteList.p=["class"],this.xssWhiteList.span=["style","class","title","id"],this.xssWhiteList.svg=["style","class","width","height","viewbox","preserveaspectratio","id","fill","stroke"],this.xssWhiteList.path=["style","class","d","id","fill","stroke"],this.xssWhiteList.th=["style"],this.xssWhiteList.td=["style"]}setBaseUrl(a){this.baseUrl=a}setBreaks(a){this.breaks=a}setRenderParse(a){this.renderParse=a}getXssWhiteList(){return this.xssWhiteList}setXssWhiteList(a){this.xssWhiteList=a}setCustomXssRules(a){a&&a.forEach(i=>{i.value===null?delete this.xssWhiteList[i.key]:this.xssWhiteList[i.key]=i.value})}setCustomRendererRules(a){a&&a.forEach(i=>{this.mdt.renderer.rules[i.key]=i.value})}setOptions(a={}){this.mdt.set(a)}setPlugins(a){a.forEach(i=>{const{plugin:f,opts:_}=i;this.mdt.use(f,_)})}onIgnoreTagAttr(a,i,f,_){if(!_&&(i==="id"||a==="span"&&i==="style"||a==="a"&&i==="href"))return i+"="+f}onTagAttr(a,i,f,_){if(_&&a==="a"&&i==="href")return i+"="+f}replaceInternalUrl(a){return a.replace(/(<a[^>]+?href=["']?)#([^"']+)(["']?[^>]*)>/gi,`$1${this.baseUrl}#$2$3>`)}handleHeaderId(a){const i=new Map,f=/<(h[1-6]) id="(.*?)">/gi;return a.replace(f,(_,y,m,C,b)=>i.has(m)?(i.set(m,i.get(m)+1),`<${y} id="${m}-${i.get(m)}">`):(i.set(m,0),`<${y} id="${m}">`))}generateHTML(a){this.mdt.set({breaks:this.breaks});let i=this.mdt.render(a);return i=this.handleHeaderId(i),this.renderParse&&(i=this.renderParse(i)),i=ui.filterXSS(i,{whiteList:this.xssWhiteList,onIgnoreTagAttr:this.onIgnoreTagAttr,onTagAttr:this.onTagAttr,css:{whiteList:Object.assign({},this.cssWhiteList,{top:!0,left:!0,bottom:!0,right:!0})}}),setTimeout(()=>{Ov()},0),this.replaceInternalUrl(i)}setRules(a){a&&Object.keys(a).forEach(i=>{this.mdt[i].set(a[i])})}}function Pv(r,a){const{content:i,customParse:f,disableRender:_}=h.toRefs(r),y=new Rv,m=h.ref();let C=null;const b=()=>{C&&clearTimeout(C),C=setTimeout(()=>{if(i.value===void 0)return;let x=y.generateHTML(i.value);(f==null?void 0:f.value)&&f.value instanceof Function&&(x=f.value(x)),!_.value&&m.value&&(m.value.innerHTML=x),a.emit("mdRenderChange",x)},300)},L=(x,I)=>{const D=/\[(X|\s|\_|\-)\]\s(.*)/gi;let k=0;return i.value.replace(D,F=>{const E=F.split("<br>");let B=0;for(;B<E.length;)E[B].match(/\[(X|\s|\_|\-)\]/i)&&k++,k===I+1&&(E[B]=E[B].replace(/\[(X|\s|\_|\-)\]/i,`${x?"[x]":"[ ]"}`)),B++;return E.join("<br>")})};return{previewRef:m,renderService:y,onPreviewClick:x=>{var I;if(((I=x.target)==null?void 0:I.tagName)==="INPUT"&&x.target.type==="checkbox"){const k=[...m.value.querySelectorAll("input")].filter(F=>F.type==="checkbox").findIndex(F=>F===x.target),H=L(x.target.checked,k);a.emit("checkedChange",H)}},setContainerContent:b}}function Bv(r,a,i){const{mdRules:f,content:_,customParse:y,renderParse:m,customXssRules:C,customRendererRules:b,baseUrl:L,breaks:S,mdPlugins:x}=h.toRefs(r);h.watch(f,()=>{a.setRules(f==null?void 0:f.value)},{immediate:!0}),h.watch(_,i,{immediate:!0}),h.watch(y,i,{immediate:!0}),h.watch(m,()=>{a.setRenderParse(m==null?void 0:m.value),i()},{immediate:!0}),h.watch(C,()=>{a.setCustomXssRules(C.value),i()},{immediate:!0}),h.watch(b,()=>{a.setCustomRendererRules(b==null?void 0:b.value),i()},{immediate:!0}),h.watch(L,()=>{a.setBaseUrl(L==null?void 0:L.value),i()},{immediate:!0}),h.watch(S,()=>{a.setBreaks(S==null?void 0:S.value),i()},{immediate:!0}),h.watch(x,I=>{I&&I.length&&(a.setPlugins(I),i())},{immediate:!0})}var mr=h.defineComponent({name:"DMdRender",props:Qa,emits:["mdRenderChange","checkedChange"],setup(r,a){const{previewRef:i,renderService:f,onPreviewClick:_,setContainerContent:y}=Pv(r,a);return Bv(r,f,y),()=>{var m,C;return h.createVNode("div",{ref:i,class:"dp-editor-md-preview-container dp-md-view",onClick:_},[(C=(m=a.slots).default)==null?void 0:C.call(m)])}}}),Eb="";function Dv(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!h.isVNode(r)}var Si=h.defineComponent({name:"DEditorMd",props:Ja,emits:["update:modelValue","checkedChange","selectHint","afterEditorInit","contentChange","previewContentChange","imageUpload"],setup(r,a){const{mode:i,toolbarConfig:f,customToolbars:_,editorContainerHeight:y,hidePreviewView:m,placeholder:C,maxlength:b,modelValue:L,baseUrl:S,breaks:x,customParse:I,renderParse:D,mdRules:k,customRendererRules:H,customXssRules:F,mdPlugins:E,fullscreenZIndex:B}=h.toRefs(r),W=h.ref(!1),G=h.computed(()=>typeof b.value=="number"?L.value.substring(0,b.value):L.value),{editorRef:q,overlayRef:P,cursorRef:ae,renderRef:se,containerRef:at,isHintShow:je,toolbars:Be,previewHtmlList:cn,onPaste:hn,getEditorIns:Et,previewContentChange:Nn,onChecked:Kt,onPreviewScroll:ut,onPreviewMouseout:qe,onPreviewMouseover:kn}=iv(r,a),{isDarkMode:Ot}=ov(()=>{});return h.provide(sn,{showFullscreen:W,toolbars:Be,toolbarConfig:f,customToolbars:_,getEditorIns:Et,t:nv}),()=>{let Oe;return h.createVNode(nf,{modelValue:W.value,"onUpdate:modelValue":De=>W.value=De,"z-index":B.value},{default:()=>[h.createVNode("div",{ref:at,class:["dp-md-container",{"dp-md-readonly":i.value==="readonly","dp-md-editonly":i.value==="editonly","dp-md-dark":Ot.value}],onPaste:hn},[h.createVNode("div",{class:"dp-md-toolbar-container"},[h.createVNode(Tv,null,null)]),h.createVNode("div",{class:["dp-md-content-container",{"hide-preview":m.value}],style:{height:(y==null?void 0:y.value)+"px"}},[h.createVNode("div",{class:"dp-md-editor"},[h.createVNode("textarea",{ref:q,placeholder:C.value},[G.value]),h.createVNode(vr,{ref:P,modelValue:je.value,"onUpdate:modelValue":De=>je.value=De,origin:ae.value||void 0,align:"start",position:["bottom-start"],onClick:h.withModifiers(()=>{},["stop"])},{default:()=>{var De,yt;return[(yt=(De=a.slots)==null?void 0:De.hintTemplate)==null?void 0:yt.call(De)]}}),Boolean(b==null?void 0:b.value)&&h.createVNode("div",{class:"dp-md-count"},[G.value.length||0,h.createTextVNode("/"),b.value])]),h.createVNode(mr,{ref:se,"base-url":S.value,breaks:x.value,content:G.value,"custom-parse":I.value,"render-parse":D.value,"md-rules":k.value,"custom-renderer-rules":H.value,"custom-xss-rules":F.value,"disable-render":!0,"md-plugins":E.value,onMdRenderChange:Nn,onCheckedChange:Kt,onScroll:ut,onMouseover:kn,onMouseout:qe},Dv(Oe=cn.value.map((De,yt)=>h.createVNode("div",{innerHTML:De,key:yt},null)))?Oe:{default:()=>[Oe]})])])]})}}});const Nv=function(r,a){let i;const f=r.utils.arrayReplaceAt;i=0;const _={divWrap:!1,divClass:"checkbox",idPrefix:"checkbox"};a=ln.exports.extend(_,a);const y=/\[(X|\s|\_|\-)\]\s(.*)/i,m=function(b,L,S){let x;const I=[];a.divWrap&&(x=new S("checkbox_open","div",1),x.attrs=[["class","checkbox"]],I.push(x));const D=a.idPrefix+i;return i+=1,x=new S("checkbox_input","input",0),x.attrs=[["type","checkbox"],["id",D]],a.disabled&&x.attrs.push(["disabled",!0]),b===!0&&x.attrs.push(["checked","true"]),I.push(x),x=new S("label_open","label",1),x.attrs=[["for",D]],I.push(x),x=new S("text","",0),x.content=L,I.push(x),I.push(new S("label_close","label",-1)),a.divWrap&&I.push(new S("checkbox_close","div",-1)),I},C=function(b,L){let S;const I=b.content.match(y);if(I===null)return b;S=!1;const D=I[1],k=I[2];return(D==="X"||D==="x")&&(S=!0),m(S,k,L)};return function(b){let L,S,x,I;const D=b.tokens;S=0;const k=D.length;for(;S<k;){if(D[S].type!=="inline"){S++;continue}for(I=D[S].children,L=I.length-1;L>=0;)x=I[L],x.type==="text"&&y.test(x.content)&&(D[S].children=I=f(I,L,C(x,b.Token))),L--;S++}}};function kv(r,a){r.core.ruler.push("checkbox",Nv(r,a))}var Wv={title:"Markdown MD\u7F16\u8F91\u5668",category:"\u6F14\u8FDB\u4E2D",status:"100%",install(r){r.component(Si.name,Si),r.component(mr.name,mr)}};we.EditorMd=Si,we.EditorMdInjectionKey=sn,we.MdRender=mr,we.checkbox=kv,we.default=Wv,we.editorMdProps=Ja,we.mdRenderProps=Qa,we.mdToolbarItemProps=eu,Object.defineProperties(we,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/pagination/index.es.js
CHANGED
|
@@ -8354,6 +8354,10 @@ const selectProps = {
|
|
|
8354
8354
|
},
|
|
8355
8355
|
maxLength: {
|
|
8356
8356
|
type: Number
|
|
8357
|
+
},
|
|
8358
|
+
appendToBody: {
|
|
8359
|
+
type: Boolean,
|
|
8360
|
+
default: true
|
|
8357
8361
|
}
|
|
8358
8362
|
};
|
|
8359
8363
|
const optionProps = {
|
|
@@ -9924,7 +9928,8 @@ var Select = defineComponent({
|
|
|
9924
9928
|
}, [createVNode(SelectContent, {
|
|
9925
9929
|
"ref": selectRef
|
|
9926
9930
|
}, null), createVNode(Teleport, {
|
|
9927
|
-
"to": "body"
|
|
9931
|
+
"to": "body",
|
|
9932
|
+
"disabled": !props.appendToBody
|
|
9928
9933
|
}, {
|
|
9929
9934
|
default: () => [createVNode(Transition, {
|
|
9930
9935
|
"name": `fade-${currentPosition.value}`
|
|
@@ -10573,6 +10578,10 @@ const dropdownProps = {
|
|
|
10573
10578
|
teleport: {
|
|
10574
10579
|
type: [String, Object],
|
|
10575
10580
|
default: "body"
|
|
10581
|
+
},
|
|
10582
|
+
appendToBody: {
|
|
10583
|
+
type: Boolean,
|
|
10584
|
+
default: true
|
|
10576
10585
|
}
|
|
10577
10586
|
};
|
|
10578
10587
|
const dropdownMap = /* @__PURE__ */ new Map();
|
|
@@ -10792,7 +10801,8 @@ var Dropdown = defineComponent({
|
|
|
10792
10801
|
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
10793
10802
|
}
|
|
10794
10803
|
}), createVNode(Teleport, {
|
|
10795
|
-
"to": teleport.value
|
|
10804
|
+
"to": teleport.value,
|
|
10805
|
+
"disabled": !props.appendToBody
|
|
10796
10806
|
}, {
|
|
10797
10807
|
default: () => [createVNode(Transition, {
|
|
10798
10808
|
"name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
|