@ixon-cdk/simulator 1.15.0 → 1.16.0-next.0

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.
@@ -1,49 +0,0 @@
1
- import{cloneDeep_default,isEqual_default,merge_default}from"./chunk-N5TLZNK7.js";import{__commonJS,__export,__objRest,__publicField,__spreadProps,__spreadValues,__toESM}from"./chunk-LA6QQXNS.js";var require_diff=__commonJS({"node_modules/fast-diff/diff.js"(exports,module){var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;function diff_main(text1,text2,cursor_pos,cleanup,_fix_unicode){if(text1===text2)return text1?[[DIFF_EQUAL,text1]]:[];if(cursor_pos!=null){var editdiff=find_cursor_edit_diff(text1,text2,cursor_pos);if(editdiff)return editdiff}var commonlength=diff_commonPrefix(text1,text2),commonprefix=text1.substring(0,commonlength);text1=text1.substring(commonlength),text2=text2.substring(commonlength),commonlength=diff_commonSuffix(text1,text2);var commonsuffix=text1.substring(text1.length-commonlength);text1=text1.substring(0,text1.length-commonlength),text2=text2.substring(0,text2.length-commonlength);var diffs=diff_compute_(text1,text2);return commonprefix&&diffs.unshift([DIFF_EQUAL,commonprefix]),commonsuffix&&diffs.push([DIFF_EQUAL,commonsuffix]),diff_cleanupMerge(diffs,_fix_unicode),cleanup&&diff_cleanupSemantic(diffs),diffs}function diff_compute_(text1,text2){var diffs;if(!text1)return[[DIFF_INSERT,text2]];if(!text2)return[[DIFF_DELETE,text1]];var longtext=text1.length>text2.length?text1:text2,shorttext=text1.length>text2.length?text2:text1,i=longtext.indexOf(shorttext);if(i!==-1)return diffs=[[DIFF_INSERT,longtext.substring(0,i)],[DIFF_EQUAL,shorttext],[DIFF_INSERT,longtext.substring(i+shorttext.length)]],text1.length>text2.length&&(diffs[0][0]=diffs[2][0]=DIFF_DELETE),diffs;if(shorttext.length===1)return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]];var hm=diff_halfMatch_(text1,text2);if(hm){var text1_a=hm[0],text1_b=hm[1],text2_a=hm[2],text2_b=hm[3],mid_common=hm[4],diffs_a=diff_main(text1_a,text2_a),diffs_b=diff_main(text1_b,text2_b);return diffs_a.concat([[DIFF_EQUAL,mid_common]],diffs_b)}return diff_bisect_(text1,text2)}function diff_bisect_(text1,text2){for(var text1_length=text1.length,text2_length=text2.length,max_d=Math.ceil((text1_length+text2_length)/2),v_offset=max_d,v_length=2*max_d,v1=new Array(v_length),v2=new Array(v_length),x=0;x<v_length;x++)v1[x]=-1,v2[x]=-1;v1[v_offset+1]=0,v2[v_offset+1]=0;for(var delta=text1_length-text2_length,front=delta%2!==0,k1start=0,k1end=0,k2start=0,k2end=0,d=0;d<max_d;d++){for(var k1=-d+k1start;k1<=d-k1end;k1+=2){var k1_offset=v_offset+k1,x1;k1===-d||k1!==d&&v1[k1_offset-1]<v1[k1_offset+1]?x1=v1[k1_offset+1]:x1=v1[k1_offset-1]+1;for(var y1=x1-k1;x1<text1_length&&y1<text2_length&&text1.charAt(x1)===text2.charAt(y1);)x1++,y1++;if(v1[k1_offset]=x1,x1>text1_length)k1end+=2;else if(y1>text2_length)k1start+=2;else if(front){var k2_offset=v_offset+delta-k1;if(k2_offset>=0&&k2_offset<v_length&&v2[k2_offset]!==-1){var x2=text1_length-v2[k2_offset];if(x1>=x2)return diff_bisectSplit_(text1,text2,x1,y1)}}}for(var k2=-d+k2start;k2<=d-k2end;k2+=2){var k2_offset=v_offset+k2,x2;k2===-d||k2!==d&&v2[k2_offset-1]<v2[k2_offset+1]?x2=v2[k2_offset+1]:x2=v2[k2_offset-1]+1;for(var y2=x2-k2;x2<text1_length&&y2<text2_length&&text1.charAt(text1_length-x2-1)===text2.charAt(text2_length-y2-1);)x2++,y2++;if(v2[k2_offset]=x2,x2>text1_length)k2end+=2;else if(y2>text2_length)k2start+=2;else if(!front){var k1_offset=v_offset+delta-k2;if(k1_offset>=0&&k1_offset<v_length&&v1[k1_offset]!==-1){var x1=v1[k1_offset],y1=v_offset+x1-k1_offset;if(x2=text1_length-x2,x1>=x2)return diff_bisectSplit_(text1,text2,x1,y1)}}}}return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]]}function diff_bisectSplit_(text1,text2,x,y){var text1a=text1.substring(0,x),text2a=text2.substring(0,y),text1b=text1.substring(x),text2b=text2.substring(y),diffs=diff_main(text1a,text2a),diffsb=diff_main(text1b,text2b);return diffs.concat(diffsb)}function diff_commonPrefix(text1,text2){if(!text1||!text2||text1.charAt(0)!==text2.charAt(0))return 0;for(var pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerstart=0;pointermin<pointermid;)text1.substring(pointerstart,pointermid)==text2.substring(pointerstart,pointermid)?(pointermin=pointermid,pointerstart=pointermin):pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return is_surrogate_pair_start(text1.charCodeAt(pointermid-1))&&pointermid--,pointermid}function diff_commonOverlap_(text1,text2){var text1_length=text1.length,text2_length=text2.length;if(text1_length==0||text2_length==0)return 0;text1_length>text2_length?text1=text1.substring(text1_length-text2_length):text1_length<text2_length&&(text2=text2.substring(0,text1_length));var text_length=Math.min(text1_length,text2_length);if(text1==text2)return text_length;for(var best=0,length=1;;){var pattern=text1.substring(text_length-length),found=text2.indexOf(pattern);if(found==-1)return best;length+=found,(found==0||text1.substring(text_length-length)==text2.substring(0,length))&&(best=length,length++)}}function diff_commonSuffix(text1,text2){if(!text1||!text2||text1.slice(-1)!==text2.slice(-1))return 0;for(var pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerend=0;pointermin<pointermid;)text1.substring(text1.length-pointermid,text1.length-pointerend)==text2.substring(text2.length-pointermid,text2.length-pointerend)?(pointermin=pointermid,pointerend=pointermin):pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return is_surrogate_pair_end(text1.charCodeAt(text1.length-pointermid))&&pointermid--,pointermid}function diff_halfMatch_(text1,text2){var longtext=text1.length>text2.length?text1:text2,shorttext=text1.length>text2.length?text2:text1;if(longtext.length<4||shorttext.length*2<longtext.length)return null;function diff_halfMatchI_(longtext2,shorttext2,i){for(var seed=longtext2.substring(i,i+Math.floor(longtext2.length/4)),j=-1,best_common="",best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b;(j=shorttext2.indexOf(seed,j+1))!==-1;){var prefixLength=diff_commonPrefix(longtext2.substring(i),shorttext2.substring(j)),suffixLength=diff_commonSuffix(longtext2.substring(0,i),shorttext2.substring(0,j));best_common.length<suffixLength+prefixLength&&(best_common=shorttext2.substring(j-suffixLength,j)+shorttext2.substring(j,j+prefixLength),best_longtext_a=longtext2.substring(0,i-suffixLength),best_longtext_b=longtext2.substring(i+prefixLength),best_shorttext_a=shorttext2.substring(0,j-suffixLength),best_shorttext_b=shorttext2.substring(j+prefixLength))}return best_common.length*2>=longtext2.length?[best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b,best_common]:null}var hm1=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/4)),hm2=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/2)),hm;if(!hm1&&!hm2)return null;hm2?hm1?hm=hm1[4].length>hm2[4].length?hm1:hm2:hm=hm2:hm=hm1;var text1_a,text1_b,text2_a,text2_b;text1.length>text2.length?(text1_a=hm[0],text1_b=hm[1],text2_a=hm[2],text2_b=hm[3]):(text2_a=hm[0],text2_b=hm[1],text1_a=hm[2],text1_b=hm[3]);var mid_common=hm[4];return[text1_a,text1_b,text2_a,text2_b,mid_common]}function diff_cleanupSemantic(diffs){for(var changes=!1,equalities=[],equalitiesLength=0,lastequality=null,pointer=0,length_insertions1=0,length_deletions1=0,length_insertions2=0,length_deletions2=0;pointer<diffs.length;)diffs[pointer][0]==DIFF_EQUAL?(equalities[equalitiesLength++]=pointer,length_insertions1=length_insertions2,length_deletions1=length_deletions2,length_insertions2=0,length_deletions2=0,lastequality=diffs[pointer][1]):(diffs[pointer][0]==DIFF_INSERT?length_insertions2+=diffs[pointer][1].length:length_deletions2+=diffs[pointer][1].length,lastequality&&lastequality.length<=Math.max(length_insertions1,length_deletions1)&&lastequality.length<=Math.max(length_insertions2,length_deletions2)&&(diffs.splice(equalities[equalitiesLength-1],0,[DIFF_DELETE,lastequality]),diffs[equalities[equalitiesLength-1]+1][0]=DIFF_INSERT,equalitiesLength--,equalitiesLength--,pointer=equalitiesLength>0?equalities[equalitiesLength-1]:-1,length_insertions1=0,length_deletions1=0,length_insertions2=0,length_deletions2=0,lastequality=null,changes=!0)),pointer++;for(changes&&diff_cleanupMerge(diffs),diff_cleanupSemanticLossless(diffs),pointer=1;pointer<diffs.length;){if(diffs[pointer-1][0]==DIFF_DELETE&&diffs[pointer][0]==DIFF_INSERT){var deletion=diffs[pointer-1][1],insertion=diffs[pointer][1],overlap_length1=diff_commonOverlap_(deletion,insertion),overlap_length2=diff_commonOverlap_(insertion,deletion);overlap_length1>=overlap_length2?(overlap_length1>=deletion.length/2||overlap_length1>=insertion.length/2)&&(diffs.splice(pointer,0,[DIFF_EQUAL,insertion.substring(0,overlap_length1)]),diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlap_length1),diffs[pointer+1][1]=insertion.substring(overlap_length1),pointer++):(overlap_length2>=deletion.length/2||overlap_length2>=insertion.length/2)&&(diffs.splice(pointer,0,[DIFF_EQUAL,deletion.substring(0,overlap_length2)]),diffs[pointer-1][0]=DIFF_INSERT,diffs[pointer-1][1]=insertion.substring(0,insertion.length-overlap_length2),diffs[pointer+1][0]=DIFF_DELETE,diffs[pointer+1][1]=deletion.substring(overlap_length2),pointer++),pointer++}pointer++}}var nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,whitespaceRegex_=/\s/,linebreakRegex_=/[\r\n]/,blanklineEndRegex_=/\n\r?\n$/,blanklineStartRegex_=/^\r?\n\r?\n/;function diff_cleanupSemanticLossless(diffs){function diff_cleanupSemanticScore_(one,two){if(!one||!two)return 6;var char1=one.charAt(one.length-1),char2=two.charAt(0),nonAlphaNumeric1=char1.match(nonAlphaNumericRegex_),nonAlphaNumeric2=char2.match(nonAlphaNumericRegex_),whitespace1=nonAlphaNumeric1&&char1.match(whitespaceRegex_),whitespace2=nonAlphaNumeric2&&char2.match(whitespaceRegex_),lineBreak1=whitespace1&&char1.match(linebreakRegex_),lineBreak2=whitespace2&&char2.match(linebreakRegex_),blankLine1=lineBreak1&&one.match(blanklineEndRegex_),blankLine2=lineBreak2&&two.match(blanklineStartRegex_);return blankLine1||blankLine2?5:lineBreak1||lineBreak2?4:nonAlphaNumeric1&&!whitespace1&&whitespace2?3:whitespace1||whitespace2?2:nonAlphaNumeric1||nonAlphaNumeric2?1:0}for(var pointer=1;pointer<diffs.length-1;){if(diffs[pointer-1][0]==DIFF_EQUAL&&diffs[pointer+1][0]==DIFF_EQUAL){var equality1=diffs[pointer-1][1],edit=diffs[pointer][1],equality2=diffs[pointer+1][1],commonOffset=diff_commonSuffix(equality1,edit);if(commonOffset){var commonString=edit.substring(edit.length-commonOffset);equality1=equality1.substring(0,equality1.length-commonOffset),edit=commonString+edit.substring(0,edit.length-commonOffset),equality2=commonString+equality2}for(var bestEquality1=equality1,bestEdit=edit,bestEquality2=equality2,bestScore=diff_cleanupSemanticScore_(equality1,edit)+diff_cleanupSemanticScore_(edit,equality2);edit.charAt(0)===equality2.charAt(0);){equality1+=edit.charAt(0),edit=edit.substring(1)+equality2.charAt(0),equality2=equality2.substring(1);var score=diff_cleanupSemanticScore_(equality1,edit)+diff_cleanupSemanticScore_(edit,equality2);score>=bestScore&&(bestScore=score,bestEquality1=equality1,bestEdit=edit,bestEquality2=equality2)}diffs[pointer-1][1]!=bestEquality1&&(bestEquality1?diffs[pointer-1][1]=bestEquality1:(diffs.splice(pointer-1,1),pointer--),diffs[pointer][1]=bestEdit,bestEquality2?diffs[pointer+1][1]=bestEquality2:(diffs.splice(pointer+1,1),pointer--))}pointer++}}function diff_cleanupMerge(diffs,fix_unicode){diffs.push([DIFF_EQUAL,""]);for(var pointer=0,count_delete=0,count_insert=0,text_delete="",text_insert="",commonlength;pointer<diffs.length;){if(pointer<diffs.length-1&&!diffs[pointer][1]){diffs.splice(pointer,1);continue}switch(diffs[pointer][0]){case DIFF_INSERT:count_insert++,text_insert+=diffs[pointer][1],pointer++;break;case DIFF_DELETE:count_delete++,text_delete+=diffs[pointer][1],pointer++;break;case DIFF_EQUAL:var previous_equality=pointer-count_insert-count_delete-1;if(fix_unicode){if(previous_equality>=0&&ends_with_pair_start(diffs[previous_equality][1])){var stray=diffs[previous_equality][1].slice(-1);if(diffs[previous_equality][1]=diffs[previous_equality][1].slice(0,-1),text_delete=stray+text_delete,text_insert=stray+text_insert,!diffs[previous_equality][1]){diffs.splice(previous_equality,1),pointer--;var k=previous_equality-1;diffs[k]&&diffs[k][0]===DIFF_INSERT&&(count_insert++,text_insert=diffs[k][1]+text_insert,k--),diffs[k]&&diffs[k][0]===DIFF_DELETE&&(count_delete++,text_delete=diffs[k][1]+text_delete,k--),previous_equality=k}}if(starts_with_pair_end(diffs[pointer][1])){var stray=diffs[pointer][1].charAt(0);diffs[pointer][1]=diffs[pointer][1].slice(1),text_delete+=stray,text_insert+=stray}}if(pointer<diffs.length-1&&!diffs[pointer][1]){diffs.splice(pointer,1);break}if(text_delete.length>0||text_insert.length>0){text_delete.length>0&&text_insert.length>0&&(commonlength=diff_commonPrefix(text_insert,text_delete),commonlength!==0&&(previous_equality>=0?diffs[previous_equality][1]+=text_insert.substring(0,commonlength):(diffs.splice(0,0,[DIFF_EQUAL,text_insert.substring(0,commonlength)]),pointer++),text_insert=text_insert.substring(commonlength),text_delete=text_delete.substring(commonlength)),commonlength=diff_commonSuffix(text_insert,text_delete),commonlength!==0&&(diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1],text_insert=text_insert.substring(0,text_insert.length-commonlength),text_delete=text_delete.substring(0,text_delete.length-commonlength)));var n=count_insert+count_delete;text_delete.length===0&&text_insert.length===0?(diffs.splice(pointer-n,n),pointer=pointer-n):text_delete.length===0?(diffs.splice(pointer-n,n,[DIFF_INSERT,text_insert]),pointer=pointer-n+1):text_insert.length===0?(diffs.splice(pointer-n,n,[DIFF_DELETE,text_delete]),pointer=pointer-n+1):(diffs.splice(pointer-n,n,[DIFF_DELETE,text_delete],[DIFF_INSERT,text_insert]),pointer=pointer-n+2)}pointer!==0&&diffs[pointer-1][0]===DIFF_EQUAL?(diffs[pointer-1][1]+=diffs[pointer][1],diffs.splice(pointer,1)):pointer++,count_insert=0,count_delete=0,text_delete="",text_insert="";break}}diffs[diffs.length-1][1]===""&&diffs.pop();var changes=!1;for(pointer=1;pointer<diffs.length-1;)diffs[pointer-1][0]===DIFF_EQUAL&&diffs[pointer+1][0]===DIFF_EQUAL&&(diffs[pointer][1].substring(diffs[pointer][1].length-diffs[pointer-1][1].length)===diffs[pointer-1][1]?(diffs[pointer][1]=diffs[pointer-1][1]+diffs[pointer][1].substring(0,diffs[pointer][1].length-diffs[pointer-1][1].length),diffs[pointer+1][1]=diffs[pointer-1][1]+diffs[pointer+1][1],diffs.splice(pointer-1,1),changes=!0):diffs[pointer][1].substring(0,diffs[pointer+1][1].length)==diffs[pointer+1][1]&&(diffs[pointer-1][1]+=diffs[pointer+1][1],diffs[pointer][1]=diffs[pointer][1].substring(diffs[pointer+1][1].length)+diffs[pointer+1][1],diffs.splice(pointer+1,1),changes=!0)),pointer++;changes&&diff_cleanupMerge(diffs,fix_unicode)}function is_surrogate_pair_start(charCode){return charCode>=55296&&charCode<=56319}function is_surrogate_pair_end(charCode){return charCode>=56320&&charCode<=57343}function starts_with_pair_end(str){return is_surrogate_pair_end(str.charCodeAt(0))}function ends_with_pair_start(str){return is_surrogate_pair_start(str.charCodeAt(str.length-1))}function remove_empty_tuples(tuples){for(var ret=[],i=0;i<tuples.length;i++)tuples[i][1].length>0&&ret.push(tuples[i]);return ret}function make_edit_splice(before,oldMiddle,newMiddle,after){return ends_with_pair_start(before)||starts_with_pair_end(after)?null:remove_empty_tuples([[DIFF_EQUAL,before],[DIFF_DELETE,oldMiddle],[DIFF_INSERT,newMiddle],[DIFF_EQUAL,after]])}function find_cursor_edit_diff(oldText,newText,cursor_pos){var oldRange=typeof cursor_pos=="number"?{index:cursor_pos,length:0}:cursor_pos.oldRange,newRange=typeof cursor_pos=="number"?null:cursor_pos.newRange,oldLength=oldText.length,newLength=newText.length;if(oldRange.length===0&&(newRange===null||newRange.length===0)){var oldCursor=oldRange.index,oldBefore=oldText.slice(0,oldCursor),oldAfter=oldText.slice(oldCursor),maybeNewCursor=newRange?newRange.index:null;editBefore:{var newCursor=oldCursor+newLength-oldLength;if(maybeNewCursor!==null&&maybeNewCursor!==newCursor||newCursor<0||newCursor>newLength)break editBefore;var newBefore=newText.slice(0,newCursor),newAfter=newText.slice(newCursor);if(newAfter!==oldAfter)break editBefore;var prefixLength=Math.min(oldCursor,newCursor),oldPrefix=oldBefore.slice(0,prefixLength),newPrefix=newBefore.slice(0,prefixLength);if(oldPrefix!==newPrefix)break editBefore;var oldMiddle=oldBefore.slice(prefixLength),newMiddle=newBefore.slice(prefixLength);return make_edit_splice(oldPrefix,oldMiddle,newMiddle,oldAfter)}editAfter:{if(maybeNewCursor!==null&&maybeNewCursor!==oldCursor)break editAfter;var cursor=oldCursor,newBefore=newText.slice(0,cursor),newAfter=newText.slice(cursor);if(newBefore!==oldBefore)break editAfter;var suffixLength=Math.min(oldLength-cursor,newLength-cursor),oldSuffix=oldAfter.slice(oldAfter.length-suffixLength),newSuffix=newAfter.slice(newAfter.length-suffixLength);if(oldSuffix!==newSuffix)break editAfter;var oldMiddle=oldAfter.slice(0,oldAfter.length-suffixLength),newMiddle=newAfter.slice(0,newAfter.length-suffixLength);return make_edit_splice(oldBefore,oldMiddle,newMiddle,oldSuffix)}}if(oldRange.length>0&&newRange&&newRange.length===0)replaceRange:{var oldPrefix=oldText.slice(0,oldRange.index),oldSuffix=oldText.slice(oldRange.index+oldRange.length),prefixLength=oldPrefix.length,suffixLength=oldSuffix.length;if(newLength<prefixLength+suffixLength)break replaceRange;var newPrefix=newText.slice(0,prefixLength),newSuffix=newText.slice(newLength-suffixLength);if(oldPrefix!==newPrefix||oldSuffix!==newSuffix)break replaceRange;var oldMiddle=oldText.slice(prefixLength,oldLength-suffixLength),newMiddle=newText.slice(prefixLength,newLength-suffixLength);return make_edit_splice(oldPrefix,oldMiddle,newMiddle,oldSuffix)}return null}function diff(text1,text2,cursor_pos,cleanup){return diff_main(text1,text2,cursor_pos,cleanup,!0)}diff.INSERT=DIFF_INSERT;diff.DELETE=DIFF_DELETE;diff.EQUAL=DIFF_EQUAL;module.exports=diff}});var require_lodash=__commonJS({"node_modules/lodash.clonedeep/index.js"(exports,module){var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",promiseTag="[object Promise]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reFlags=/\w*$/,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports;function addMapEntry(map,pair){return map.set(pair[0],pair[1]),map}function addSetEntry(set,value){return set.add(value),set}function arrayEach(array,iteratee){for(var index=-1,length=array?array.length:0;++index<length&&iteratee(array[index],index,array)!==!1;);return array}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array?array.length:0;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function getValue(object,key){return object?.[key]}function isHostObject(value){var result=!1;if(value!=null&&typeof value.toString!="function")try{result=!!(value+"")}catch{}return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array=root.Uint8Array,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeKeys=overArg(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise2=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap2=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise2),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap2),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==void 0:hasOwnProperty.call(data,key)}function hashSet(key,value){var data=this.__data__;return data[key]=nativeCreate&&value===void 0?HASH_UNDEFINED:value,this}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0)return!1;var lastIndex=data.length-1;return index==lastIndex?data.pop():splice.call(data,index,1),!0}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function Stack(entries){this.__data__=new ListCache(entries)}function stackClear(){this.__data__=new ListCache}function stackDelete(key){return this.__data__.delete(key)}function stackGet(key){return this.__data__.get(key)}function stackHas(key){return this.__data__.has(key)}function stackSet(key,value){var cache=this.__data__;if(cache instanceof ListCache){var pairs=cache.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1)return pairs.push([key,value]),this;cache=this.__data__=new MapCache(pairs)}return cache.set(key,value),this}Stack.prototype.clear=stackClear;Stack.prototype.delete=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(value,inherited){var result=isArray(value)||isArguments(value)?baseTimes(value.length,String):[],length=result.length,skipIndexes=!!length;for(var key in value)(inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(key=="length"||isIndex(key,length)))&&result.push(key);return result}function assignValue(object,key,value){var objValue=object[key];(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===void 0&&!(key in object))&&(object[key]=value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseAssign(object,source){return object&&copyObject(source,keys(source),object)}function baseClone(value,isDeep,isFull,customizer,key,object,stack){var result;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==void 0)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(isHostObject(value))return object?value:{};if(result=initCloneObject(isFunc?{}:value),!isDeep)return copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,baseClone,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),!isArr)var props=isFull?getAllKeys(value):keys(value);return arrayEach(props||value,function(subValue,key2){props&&(key2=subValue,subValue=value[key2]),assignValue(result,key2,baseClone(subValue,isDeep,isFull,customizer,key2,value,stack))}),result}function baseCreate(proto){return isObject(proto)?objectCreate(proto):{}}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return objectToString.call(value)}function baseIsNative(value){if(!isObject(value)||isMasked(value))return!1;var pattern=isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value))}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&key!="constructor"&&result.push(key);return result}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var result=new buffer.constructor(buffer.length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneMap(map,isDeep,cloneFunc){var array=isDeep?cloneFunc(mapToArray(map),!0):mapToArray(map);return arrayReduce(array,addMapEntry,new map.constructor)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSet(set,isDeep,cloneFunc){var array=isDeep?cloneFunc(setToArray(set),!0):setToArray(set);return arrayReduce(array,addSetEntry,new set.constructor)}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):void 0;assignValue(object,key,newValue===void 0?source[key]:newValue)}return object}function copySymbols(source,object){return copyObject(source,getSymbols(source),object)}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}var getSymbols=nativeGetSymbols?overArg(nativeGetSymbols,Object):stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise2&&getTag(Promise2.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap2&&getTag(new WeakMap2)!=weakMapTag)&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});function initCloneArray(array){var length=array.length,result=array.constructor(length);return length&&typeof array[0]=="string"&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result}function initCloneObject(object){return typeof object.constructor=="function"&&!isPrototype(object)?baseCreate(getPrototype(object)):{}}function initCloneByTag(object,tag,cloneFunc,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return cloneMap(object,isDeep,cloneFunc);case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return cloneSet(object,isDeep,cloneFunc);case symbolTag:return cloneSymbol(object)}}function isIndex(value,length){return length=length??MAX_SAFE_INTEGER,!!length&&(typeof value=="number"||reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isKeyable(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto;return value===proto}function toSource(func){if(func!=null){try{return funcToString.call(func)}catch{}try{return func+""}catch{}}return""}function cloneDeep(value){return baseClone(value,!0,!0)}function eq(value,other){return value===other||value!==value&&other!==other}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}var isArray=Array.isArray;function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}var isBuffer=nativeIsBuffer||stubFalse;function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isObjectLike(value){return!!value&&typeof value=="object"}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function stubArray(){return[]}function stubFalse(){return!1}module.exports=cloneDeep}});var require_lodash2=__commonJS({"node_modules/lodash.isequal/index.js"(exports,module){var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function arrayFilter(array,predicate){for(var index=-1,length=array==null?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arraySome(array,predicate){for(var index=-1,length=array==null?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function baseUnary(func){return function(value){return func(value)}}function cacheHas(cache,key){return cache.has(key)}function getValue(object,key){return object?.[key]}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=Symbol?Symbol.toStringTag:void 0,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeKeys=overArg(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise2=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap2=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise2),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap2),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function Hash(entries){var index=-1,length=entries==null?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==void 0:hasOwnProperty.call(data,key)}function hashSet(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&value===void 0?HASH_UNDEFINED:value,this}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(entries){var index=-1,length=entries==null?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[],this.size=0}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0)return!1;var lastIndex=data.length-1;return index==lastIndex?data.pop():splice.call(data,index,1),--this.size,!0}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(entries){var index=-1,length=entries==null?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function SetCache(values){var index=-1,length=values==null?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result}function stackGet(key){return this.__data__.get(key)}function stackHas(key){return this.__data__.has(key)}function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this}Stack.prototype.clear=stackClear;Stack.prototype.delete=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)(inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(key=="length"||isBuff&&(key=="offset"||key=="parent")||isType&&(key=="buffer"||key=="byteLength"||key=="byteOffset")||isIndex(key,length)))&&result.push(key);return result}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return value==null?value===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other?!0:value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)?value!==value&&other!==other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack)}function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag,othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return isSameTag?(stack||(stack=new Stack),equalObjects(object,other,bitmask,customizer,equalFunc,stack)):!1}function baseIsNative(value){if(!isObject(value)||isMasked(value))return!1;var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value))}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&key!="constructor"&&result.push(key);return result}function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(compared!==void 0){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=!1;break}}return stack.delete(array),stack.delete(other),result}function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&COMPARE_PARTIAL_FLAG;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=COMPARE_UNORDERED_FLAG,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(compared===void 0?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor=key=="constructor")}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)&&(result=!1)}return stack.delete(object),stack.delete(other),result}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=void 0;var unmasked=!0}catch{}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]),result}var getSymbols=nativeGetSymbols?function(object){return object==null?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise2&&getTag(Promise2.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap2&&getTag(new WeakMap2)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});function isIndex(value,length){return length=length??MAX_SAFE_INTEGER,!!length&&(typeof value=="number"||reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isKeyable(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto;return value===proto}function objectToString(value){return nativeObjectToString.call(value)}function toSource(func){if(func!=null){try{return funcToString.call(func)}catch{}try{return func+""}catch{}}return""}function eq(value,other){return value===other||value!==value&&other!==other}var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray;function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value)}var isBuffer=nativeIsBuffer||stubFalse;function isEqual2(value,other){return baseIsEqual(value,other)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return value!=null&&(type=="object"||type=="function")}function isObjectLike(value){return value!=null&&typeof value=="object"}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function stubArray(){return[]}function stubFalse(){return!1}module.exports=isEqual2}});var require_AttributeMap=__commonJS({"node_modules/quill-delta/dist/AttributeMap.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var cloneDeep=require_lodash(),isEqual2=require_lodash2(),AttributeMap5;(function(AttributeMap6){function compose(a={},b={},keepNull=!1){typeof a!="object"&&(a={}),typeof b!="object"&&(b={});let attributes=cloneDeep(b);keepNull||(attributes=Object.keys(attributes).reduce((copy,key)=>(attributes[key]!=null&&(copy[key]=attributes[key]),copy),{}));for(let key in a)a[key]!==void 0&&b[key]===void 0&&(attributes[key]=a[key]);return Object.keys(attributes).length>0?attributes:void 0}AttributeMap6.compose=compose;function diff(a={},b={}){typeof a!="object"&&(a={}),typeof b!="object"&&(b={});let attributes=Object.keys(a).concat(Object.keys(b)).reduce((attrs,key)=>(isEqual2(a[key],b[key])||(attrs[key]=b[key]===void 0?null:b[key]),attrs),{});return Object.keys(attributes).length>0?attributes:void 0}AttributeMap6.diff=diff;function invert(attr={},base={}){attr=attr||{};let baseInverted=Object.keys(base).reduce((memo,key)=>(base[key]!==attr[key]&&attr[key]!==void 0&&(memo[key]=base[key]),memo),{});return Object.keys(attr).reduce((memo,key)=>(attr[key]!==base[key]&&base[key]===void 0&&(memo[key]=null),memo),baseInverted)}AttributeMap6.invert=invert;function transform(a,b,priority=!1){if(typeof a!="object")return b;if(typeof b!="object")return;if(!priority)return b;let attributes=Object.keys(b).reduce((attrs,key)=>(a[key]===void 0&&(attrs[key]=b[key]),attrs),{});return Object.keys(attributes).length>0?attributes:void 0}AttributeMap6.transform=transform})(AttributeMap5||(AttributeMap5={}));exports.default=AttributeMap5}});var require_Op=__commonJS({"node_modules/quill-delta/dist/Op.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Op4;(function(Op5){function length(op){return typeof op.delete=="number"?op.delete:typeof op.retain=="number"?op.retain:typeof op.retain=="object"&&op.retain!==null?1:typeof op.insert=="string"?op.insert.length:1}Op5.length=length})(Op4||(Op4={}));exports.default=Op4}});var require_OpIterator=__commonJS({"node_modules/quill-delta/dist/OpIterator.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Op_1=require_Op(),Iterator=class{constructor(ops){this.ops=ops,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(length){length||(length=1/0);let nextOp=this.ops[this.index];if(nextOp){let offset=this.offset,opLength=Op_1.default.length(nextOp);if(length>=opLength-offset?(length=opLength-offset,this.index+=1,this.offset=0):this.offset+=length,typeof nextOp.delete=="number")return{delete:length};{let retOp={};return nextOp.attributes&&(retOp.attributes=nextOp.attributes),typeof nextOp.retain=="number"?retOp.retain=length:typeof nextOp.retain=="object"&&nextOp.retain!==null?retOp.retain=nextOp.retain:typeof nextOp.insert=="string"?retOp.insert=nextOp.insert.substr(offset,length):retOp.insert=nextOp.insert,retOp}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Op_1.default.length(this.ops[this.index])-this.offset:1/0}peekType(){let op=this.ops[this.index];return op?typeof op.delete=="number"?"delete":typeof op.retain=="number"||typeof op.retain=="object"&&op.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{let offset=this.offset,index=this.index,next=this.next(),rest=this.ops.slice(this.index);return this.offset=offset,this.index=index,[next].concat(rest)}}else return[]}};exports.default=Iterator}});var require_Delta=__commonJS({"node_modules/quill-delta/dist/Delta.js"(exports,module){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.AttributeMap=exports.OpIterator=exports.Op=void 0;var diff=require_diff(),cloneDeep=require_lodash(),isEqual2=require_lodash2(),AttributeMap_1=require_AttributeMap();exports.AttributeMap=AttributeMap_1.default;var Op_1=require_Op();exports.Op=Op_1.default;var OpIterator_1=require_OpIterator();exports.OpIterator=OpIterator_1.default;var NULL_CHARACTER="\0",getEmbedTypeAndData=(a,b)=>{if(typeof a!="object"||a===null)throw new Error(`cannot retain a ${typeof a}`);if(typeof b!="object"||b===null)throw new Error(`cannot retain a ${typeof b}`);let embedType=Object.keys(a)[0];if(!embedType||embedType!==Object.keys(b)[0])throw new Error(`embed types not matched: ${embedType} != ${Object.keys(b)[0]}`);return[embedType,a[embedType],b[embedType]]},Delta13=class _Delta{constructor(ops){Array.isArray(ops)?this.ops=ops:ops!=null&&Array.isArray(ops.ops)?this.ops=ops.ops:this.ops=[]}static registerEmbed(embedType,handler){this.handlers[embedType]=handler}static unregisterEmbed(embedType){delete this.handlers[embedType]}static getHandler(embedType){let handler=this.handlers[embedType];if(!handler)throw new Error(`no handlers for embed type "${embedType}"`);return handler}insert(arg,attributes){let newOp={};return typeof arg=="string"&&arg.length===0?this:(newOp.insert=arg,attributes!=null&&typeof attributes=="object"&&Object.keys(attributes).length>0&&(newOp.attributes=attributes),this.push(newOp))}delete(length){return length<=0?this:this.push({delete:length})}retain(length,attributes){if(typeof length=="number"&&length<=0)return this;let newOp={retain:length};return attributes!=null&&typeof attributes=="object"&&Object.keys(attributes).length>0&&(newOp.attributes=attributes),this.push(newOp)}push(newOp){let index=this.ops.length,lastOp=this.ops[index-1];if(newOp=cloneDeep(newOp),typeof lastOp=="object"){if(typeof newOp.delete=="number"&&typeof lastOp.delete=="number")return this.ops[index-1]={delete:lastOp.delete+newOp.delete},this;if(typeof lastOp.delete=="number"&&newOp.insert!=null&&(index-=1,lastOp=this.ops[index-1],typeof lastOp!="object"))return this.ops.unshift(newOp),this;if(isEqual2(newOp.attributes,lastOp.attributes)){if(typeof newOp.insert=="string"&&typeof lastOp.insert=="string")return this.ops[index-1]={insert:lastOp.insert+newOp.insert},typeof newOp.attributes=="object"&&(this.ops[index-1].attributes=newOp.attributes),this;if(typeof newOp.retain=="number"&&typeof lastOp.retain=="number")return this.ops[index-1]={retain:lastOp.retain+newOp.retain},typeof newOp.attributes=="object"&&(this.ops[index-1].attributes=newOp.attributes),this}}return index===this.ops.length?this.ops.push(newOp):this.ops.splice(index,0,newOp),this}chop(){let lastOp=this.ops[this.ops.length-1];return lastOp&&typeof lastOp.retain=="number"&&!lastOp.attributes&&this.ops.pop(),this}filter(predicate){return this.ops.filter(predicate)}forEach(predicate){this.ops.forEach(predicate)}map(predicate){return this.ops.map(predicate)}partition(predicate){let passed=[],failed=[];return this.forEach(op=>{(predicate(op)?passed:failed).push(op)}),[passed,failed]}reduce(predicate,initialValue){return this.ops.reduce(predicate,initialValue)}changeLength(){return this.reduce((length,elem)=>elem.insert?length+Op_1.default.length(elem):elem.delete?length-elem.delete:length,0)}length(){return this.reduce((length,elem)=>length+Op_1.default.length(elem),0)}slice(start=0,end=1/0){let ops=[],iter=new OpIterator_1.default(this.ops),index=0;for(;index<end&&iter.hasNext();){let nextOp;index<start?nextOp=iter.next(start-index):(nextOp=iter.next(end-index),ops.push(nextOp)),index+=Op_1.default.length(nextOp)}return new _Delta(ops)}compose(other){let thisIter=new OpIterator_1.default(this.ops),otherIter=new OpIterator_1.default(other.ops),ops=[],firstOther=otherIter.peek();if(firstOther!=null&&typeof firstOther.retain=="number"&&firstOther.attributes==null){let firstLeft=firstOther.retain;for(;thisIter.peekType()==="insert"&&thisIter.peekLength()<=firstLeft;)firstLeft-=thisIter.peekLength(),ops.push(thisIter.next());firstOther.retain-firstLeft>0&&otherIter.next(firstOther.retain-firstLeft)}let delta=new _Delta(ops);for(;thisIter.hasNext()||otherIter.hasNext();)if(otherIter.peekType()==="insert")delta.push(otherIter.next());else if(thisIter.peekType()==="delete")delta.push(thisIter.next());else{let length=Math.min(thisIter.peekLength(),otherIter.peekLength()),thisOp=thisIter.next(length),otherOp=otherIter.next(length);if(otherOp.retain){let newOp={};if(typeof thisOp.retain=="number")newOp.retain=typeof otherOp.retain=="number"?length:otherOp.retain;else if(typeof otherOp.retain=="number")thisOp.retain==null?newOp.insert=thisOp.insert:newOp.retain=thisOp.retain;else{let action=thisOp.retain==null?"insert":"retain",[embedType,thisData,otherData]=getEmbedTypeAndData(thisOp[action],otherOp.retain),handler=_Delta.getHandler(embedType);newOp[action]={[embedType]:handler.compose(thisData,otherData,action==="retain")}}let attributes=AttributeMap_1.default.compose(thisOp.attributes,otherOp.attributes,typeof thisOp.retain=="number");if(attributes&&(newOp.attributes=attributes),delta.push(newOp),!otherIter.hasNext()&&isEqual2(delta.ops[delta.ops.length-1],newOp)){let rest=new _Delta(thisIter.rest());return delta.concat(rest).chop()}}else typeof otherOp.delete=="number"&&(typeof thisOp.retain=="number"||typeof thisOp.retain=="object"&&thisOp.retain!==null)&&delta.push(otherOp)}return delta.chop()}concat(other){let delta=new _Delta(this.ops.slice());return other.ops.length>0&&(delta.push(other.ops[0]),delta.ops=delta.ops.concat(other.ops.slice(1))),delta}diff(other,cursor){if(this.ops===other.ops)return new _Delta;let strings=[this,other].map(delta=>delta.map(op=>{if(op.insert!=null)return typeof op.insert=="string"?op.insert:NULL_CHARACTER;let prep=delta===other?"on":"with";throw new Error("diff() called "+prep+" non-document")}).join("")),retDelta=new _Delta,diffResult=diff(strings[0],strings[1],cursor,!0),thisIter=new OpIterator_1.default(this.ops),otherIter=new OpIterator_1.default(other.ops);return diffResult.forEach(component=>{let length=component[1].length;for(;length>0;){let opLength=0;switch(component[0]){case diff.INSERT:opLength=Math.min(otherIter.peekLength(),length),retDelta.push(otherIter.next(opLength));break;case diff.DELETE:opLength=Math.min(length,thisIter.peekLength()),thisIter.next(opLength),retDelta.delete(opLength);break;case diff.EQUAL:opLength=Math.min(thisIter.peekLength(),otherIter.peekLength(),length);let thisOp=thisIter.next(opLength),otherOp=otherIter.next(opLength);isEqual2(thisOp.insert,otherOp.insert)?retDelta.retain(opLength,AttributeMap_1.default.diff(thisOp.attributes,otherOp.attributes)):retDelta.push(otherOp).delete(opLength);break}length-=opLength}}),retDelta.chop()}eachLine(predicate,newline=`
2
- `){let iter=new OpIterator_1.default(this.ops),line=new _Delta,i=0;for(;iter.hasNext();){if(iter.peekType()!=="insert")return;let thisOp=iter.peek(),start=Op_1.default.length(thisOp)-iter.peekLength(),index=typeof thisOp.insert=="string"?thisOp.insert.indexOf(newline,start)-start:-1;if(index<0)line.push(iter.next());else if(index>0)line.push(iter.next(index));else{if(predicate(line,iter.next(1).attributes||{},i)===!1)return;i+=1,line=new _Delta}}line.length()>0&&predicate(line,{},i)}invert(base){let inverted=new _Delta;return this.reduce((baseIndex,op)=>{if(op.insert)inverted.delete(Op_1.default.length(op));else{if(typeof op.retain=="number"&&op.attributes==null)return inverted.retain(op.retain),baseIndex+op.retain;if(op.delete||typeof op.retain=="number"){let length=op.delete||op.retain;return base.slice(baseIndex,baseIndex+length).forEach(baseOp=>{op.delete?inverted.push(baseOp):op.retain&&op.attributes&&inverted.retain(Op_1.default.length(baseOp),AttributeMap_1.default.invert(op.attributes,baseOp.attributes))}),baseIndex+length}else if(typeof op.retain=="object"&&op.retain!==null){let slice=base.slice(baseIndex,baseIndex+1),baseOp=new OpIterator_1.default(slice.ops).next(),[embedType,opData,baseOpData]=getEmbedTypeAndData(op.retain,baseOp.insert),handler=_Delta.getHandler(embedType);return inverted.retain({[embedType]:handler.invert(opData,baseOpData)},AttributeMap_1.default.invert(op.attributes,baseOp.attributes)),baseIndex+1}}return baseIndex},0),inverted.chop()}transform(arg,priority=!1){if(priority=!!priority,typeof arg=="number")return this.transformPosition(arg,priority);let other=arg,thisIter=new OpIterator_1.default(this.ops),otherIter=new OpIterator_1.default(other.ops),delta=new _Delta;for(;thisIter.hasNext()||otherIter.hasNext();)if(thisIter.peekType()==="insert"&&(priority||otherIter.peekType()!=="insert"))delta.retain(Op_1.default.length(thisIter.next()));else if(otherIter.peekType()==="insert")delta.push(otherIter.next());else{let length=Math.min(thisIter.peekLength(),otherIter.peekLength()),thisOp=thisIter.next(length),otherOp=otherIter.next(length);if(thisOp.delete)continue;if(otherOp.delete)delta.push(otherOp);else{let thisData=thisOp.retain,otherData=otherOp.retain,transformedData=typeof otherData=="object"&&otherData!==null?otherData:length;if(typeof thisData=="object"&&thisData!==null&&typeof otherData=="object"&&otherData!==null){let embedType=Object.keys(thisData)[0];if(embedType===Object.keys(otherData)[0]){let handler=_Delta.getHandler(embedType);handler&&(transformedData={[embedType]:handler.transform(thisData[embedType],otherData[embedType],priority)})}}delta.retain(transformedData,AttributeMap_1.default.transform(thisOp.attributes,otherOp.attributes,priority))}}return delta.chop()}transformPosition(index,priority=!1){priority=!!priority;let thisIter=new OpIterator_1.default(this.ops),offset=0;for(;thisIter.hasNext()&&offset<=index;){let length=thisIter.peekLength(),nextType=thisIter.peekType();if(thisIter.next(),nextType==="delete"){index-=Math.min(length,index-offset);continue}else nextType==="insert"&&(offset<index||!priority)&&(index+=length);offset+=length}return index}};Delta13.Op=Op_1.default;Delta13.OpIterator=OpIterator_1.default;Delta13.AttributeMap=AttributeMap_1.default;Delta13.handlers={};exports.default=Delta13;typeof module=="object"&&(module.exports=Delta13,module.exports.default=Delta13)}});var require_eventemitter3=__commonJS({"node_modules/quill/node_modules/eventemitter3/index.js"(exports,module){"use strict";var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(prefix=!1));function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if(typeof fn!="function")throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){--emitter._eventsCount===0?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter2(){this._events=new Events,this._eventsCount=0}EventEmitter2.prototype.eventNames=function(){var names=[],events,name;if(this._eventsCount===0)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names};EventEmitter2.prototype.listeners=function(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++)ee[i]=handlers[i].fn;return ee};EventEmitter2.prototype.listenerCount=function(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];return listeners?listeners.fn?1:listeners.length:0};EventEmitter2.prototype.emit=function(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var listeners=this._events[evt],len=arguments.length,args,i;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var length=listeners.length,j;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0};EventEmitter2.prototype.on=function(event,fn,context){return addListener(this,event,fn,context,!1)};EventEmitter2.prototype.once=function(event,fn,context){return addListener(this,event,fn,context,!0)};EventEmitter2.prototype.removeListener=function(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return clearEvent(this,evt),this;var listeners=this._events[evt];if(listeners.fn)listeners.fn===fn&&(!once||listeners.once)&&(!context||listeners.context===context)&&clearEvent(this,evt);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=events.length===1?events[0]:events:clearEvent(this,evt)}return this};EventEmitter2.prototype.removeAllListeners=function(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&clearEvent(this,evt)):(this._events=new Events,this._eventsCount=0),this};EventEmitter2.prototype.off=EventEmitter2.prototype.removeListener;EventEmitter2.prototype.addListener=EventEmitter2.prototype.on;EventEmitter2.prefixed=prefix;EventEmitter2.EventEmitter=EventEmitter2;typeof module<"u"&&(module.exports=EventEmitter2)}});var parchment_exports={};__export(parchment_exports,{Attributor:()=>Attributor,AttributorStore:()=>AttributorStore$1,BlockBlot:()=>BlockBlot$1,ClassAttributor:()=>ClassAttributor$1,ContainerBlot:()=>ContainerBlot$1,EmbedBlot:()=>EmbedBlot$1,InlineBlot:()=>InlineBlot$1,LeafBlot:()=>LeafBlot$1,ParentBlot:()=>ParentBlot$1,Registry:()=>Registry,Scope:()=>Scope,ScrollBlot:()=>ScrollBlot$1,StyleAttributor:()=>StyleAttributor$1,TextBlot:()=>TextBlot$1});var Scope=(Scope2=>(Scope2[Scope2.TYPE=3]="TYPE",Scope2[Scope2.LEVEL=12]="LEVEL",Scope2[Scope2.ATTRIBUTE=13]="ATTRIBUTE",Scope2[Scope2.BLOT=14]="BLOT",Scope2[Scope2.INLINE=7]="INLINE",Scope2[Scope2.BLOCK=11]="BLOCK",Scope2[Scope2.BLOCK_BLOT=10]="BLOCK_BLOT",Scope2[Scope2.INLINE_BLOT=6]="INLINE_BLOT",Scope2[Scope2.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",Scope2[Scope2.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",Scope2[Scope2.ANY=15]="ANY",Scope2))(Scope||{}),Attributor=class{constructor(attrName,keyName,options={}){this.attrName=attrName,this.keyName=keyName;let attributeBit=Scope.TYPE&Scope.ATTRIBUTE;this.scope=options.scope!=null?options.scope&Scope.LEVEL|attributeBit:Scope.ATTRIBUTE,options.whitelist!=null&&(this.whitelist=options.whitelist)}static keys(node){return Array.from(node.attributes).map(item=>item.name)}add(node,value){return this.canAdd(node,value)?(node.setAttribute(this.keyName,value),!0):!1}canAdd(_node,value){return this.whitelist==null?!0:typeof value=="string"?this.whitelist.indexOf(value.replace(/["']/g,""))>-1:this.whitelist.indexOf(value)>-1}remove(node){node.removeAttribute(this.keyName)}value(node){let value=node.getAttribute(this.keyName);return this.canAdd(node,value)&&value?value:""}},ParchmentError=class extends Error{constructor(message){message="[Parchment] "+message,super(message),this.message=message,this.name=this.constructor.name}},_Registry=(()=>{let _Registry2=class _Registry3{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(node,bubble=!1){if(node==null)return null;if(this.blots.has(node))return this.blots.get(node)||null;if(bubble){let parentNode=null;try{parentNode=node.parentNode}catch{return null}return this.find(parentNode,bubble)}return null}create(scroll,input,value){let match2=this.query(input);if(match2==null)throw new ParchmentError(`Unable to create ${input} blot`);let blotClass=match2,node=input instanceof Node||input.nodeType===Node.TEXT_NODE?input:blotClass.create(value),blot=new blotClass(scroll,node,value);return _Registry3.blots.set(blot.domNode,blot),blot}find(node,bubble=!1){return _Registry3.find(node,bubble)}query(query,scope=Scope.ANY){let match2;return typeof query=="string"?match2=this.types[query]||this.attributes[query]:query instanceof Text||query.nodeType===Node.TEXT_NODE?match2=this.types.text:typeof query=="number"?query&Scope.LEVEL&Scope.BLOCK?match2=this.types.block:query&Scope.LEVEL&Scope.INLINE&&(match2=this.types.inline):query instanceof Element&&((query.getAttribute("class")||"").split(/\s+/).some(name=>(match2=this.classes[name],!!match2)),match2=match2||this.tags[query.tagName]),match2==null?null:"scope"in match2&&scope&Scope.LEVEL&match2.scope&&scope&Scope.TYPE&match2.scope?match2:null}register(...definitions){return definitions.map(definition=>{let isBlot="blotName"in definition,isAttr="attrName"in definition;if(!isBlot&&!isAttr)throw new ParchmentError("Invalid definition");if(isBlot&&definition.blotName==="abstract")throw new ParchmentError("Cannot register abstract class");let key=isBlot?definition.blotName:isAttr?definition.attrName:void 0;return this.types[key]=definition,isAttr?typeof definition.keyName=="string"&&(this.attributes[definition.keyName]=definition):isBlot&&(definition.className&&(this.classes[definition.className]=definition),definition.tagName&&(Array.isArray(definition.tagName)?definition.tagName=definition.tagName.map(tagName=>tagName.toUpperCase()):definition.tagName=definition.tagName.toUpperCase(),(Array.isArray(definition.tagName)?definition.tagName:[definition.tagName]).forEach(tag=>{(this.tags[tag]==null||definition.className==null)&&(this.tags[tag]=definition)}))),definition})}};return _Registry2.blots=new WeakMap,_Registry2})(),Registry=_Registry;function match(node,prefix){return(node.getAttribute("class")||"").split(/\s+/).filter(name=>name.indexOf(`${prefix}-`)===0)}var ClassAttributor=class extends Attributor{static keys(node){return(node.getAttribute("class")||"").split(/\s+/).map(name=>name.split("-").slice(0,-1).join("-"))}add(node,value){return this.canAdd(node,value)?(this.remove(node),node.classList.add(`${this.keyName}-${value}`),!0):!1}remove(node){match(node,this.keyName).forEach(name=>{node.classList.remove(name)}),node.classList.length===0&&node.removeAttribute("class")}value(node){let value=(match(node,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(node,value)?value:""}},ClassAttributor$1=ClassAttributor;function camelize(name){let parts=name.split("-"),rest=parts.slice(1).map(part=>part[0].toUpperCase()+part.slice(1)).join("");return parts[0]+rest}var StyleAttributor=class extends Attributor{static keys(node){return(node.getAttribute("style")||"").split(";").map(value=>value.split(":")[0].trim())}add(node,value){return this.canAdd(node,value)?(node.style[camelize(this.keyName)]=value,!0):!1}remove(node){node.style[camelize(this.keyName)]="",node.getAttribute("style")||node.removeAttribute("style")}value(node){let value=node.style[camelize(this.keyName)];return this.canAdd(node,value)?value:""}},StyleAttributor$1=StyleAttributor,AttributorStore=class{constructor(domNode){this.attributes={},this.domNode=domNode,this.build()}attribute(attribute,value){value?attribute.add(this.domNode,value)&&(attribute.value(this.domNode)!=null?this.attributes[attribute.attrName]=attribute:delete this.attributes[attribute.attrName]):(attribute.remove(this.domNode),delete this.attributes[attribute.attrName])}build(){this.attributes={};let blot=Registry.find(this.domNode);if(blot==null)return;let attributes=Attributor.keys(this.domNode),classes=ClassAttributor$1.keys(this.domNode),styles=StyleAttributor$1.keys(this.domNode);attributes.concat(classes).concat(styles).forEach(name=>{let attr=blot.scroll.query(name,Scope.ATTRIBUTE);attr instanceof Attributor&&(this.attributes[attr.attrName]=attr)})}copy(target){Object.keys(this.attributes).forEach(key=>{let value=this.attributes[key].value(this.domNode);target.format(key,value)})}move(target){this.copy(target),Object.keys(this.attributes).forEach(key=>{this.attributes[key].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((attributes,name)=>(attributes[name]=this.attributes[name].value(this.domNode),attributes),{})}},AttributorStore$1=AttributorStore,_ShadowBlot=class{constructor(scroll,domNode){this.scroll=scroll,this.domNode=domNode,Registry.blots.set(domNode,this),this.prev=null,this.next=null}static create(rawValue){if(this.tagName==null)throw new ParchmentError("Blot definition missing tagName");let node,value;return Array.isArray(this.tagName)?(typeof rawValue=="string"?(value=rawValue.toUpperCase(),parseInt(value,10).toString()===value&&(value=parseInt(value,10))):typeof rawValue=="number"&&(value=rawValue),typeof value=="number"?node=document.createElement(this.tagName[value-1]):value&&this.tagName.indexOf(value)>-1?node=document.createElement(value):node=document.createElement(this.tagName[0])):node=document.createElement(this.tagName),this.className&&node.classList.add(this.className),node}get statics(){return this.constructor}attach(){}clone(){let domNode=this.domNode.cloneNode(!1);return this.scroll.create(domNode)}detach(){this.parent!=null&&this.parent.removeChild(this),Registry.blots.delete(this.domNode)}deleteAt(index,length){this.isolate(index,length).remove()}formatAt(index,length,name,value){let blot=this.isolate(index,length);if(this.scroll.query(name,Scope.BLOT)!=null&&value)blot.wrap(name,value);else if(this.scroll.query(name,Scope.ATTRIBUTE)!=null){let parent=this.scroll.create(this.statics.scope);blot.wrap(parent),parent.format(name,value)}}insertAt(index,value,def){let blot=def==null?this.scroll.create("text",value):this.scroll.create(value,def),ref=this.split(index);this.parent.insertBefore(blot,ref||void 0)}isolate(index,length){let target=this.split(index);if(target==null)throw new Error("Attempt to isolate at end");return target.split(length),target}length(){return 1}offset(root=this.parent){return this.parent==null||this===root?0:this.parent.children.offset(this)+this.parent.offset(root)}optimize(_context){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(name,value){let replacement=typeof name=="string"?this.scroll.create(name,value):name;return this.parent!=null&&(this.parent.insertBefore(replacement,this.next||void 0),this.remove()),replacement}split(index,_force){return index===0?this:this.next}update(_mutations,_context){}wrap(name,value){let wrapper=typeof name=="string"?this.scroll.create(name,value):name;if(this.parent!=null&&this.parent.insertBefore(wrapper,this.next||void 0),typeof wrapper.appendChild!="function")throw new ParchmentError(`Cannot wrap ${name}`);return wrapper.appendChild(this),wrapper}};_ShadowBlot.blotName="abstract";var ShadowBlot=_ShadowBlot,_LeafBlot=class extends ShadowBlot{static value(_domNode){return!0}index(node,offset){return this.domNode===node||this.domNode.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(offset,1):-1}position(index,_inclusive){let offset=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return index>0&&(offset+=1),[this.parent.domNode,offset]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};_LeafBlot.scope=Scope.INLINE_BLOT;var LeafBlot=_LeafBlot,LeafBlot$1=LeafBlot,LinkedList=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...nodes){if(this.insertBefore(nodes[0],null),nodes.length>1){let rest=nodes.slice(1);this.append(...rest)}}at(index){let next=this.iterator(),cur=next();for(;cur&&index>0;)index-=1,cur=next();return cur}contains(node){let next=this.iterator(),cur=next();for(;cur;){if(cur===node)return!0;cur=next()}return!1}indexOf(node){let next=this.iterator(),cur=next(),index=0;for(;cur;){if(cur===node)return index;index+=1,cur=next()}return-1}insertBefore(node,refNode){node!=null&&(this.remove(node),node.next=refNode,refNode!=null?(node.prev=refNode.prev,refNode.prev!=null&&(refNode.prev.next=node),refNode.prev=node,refNode===this.head&&(this.head=node)):this.tail!=null?(this.tail.next=node,node.prev=this.tail,this.tail=node):(node.prev=null,this.head=this.tail=node),this.length+=1)}offset(target){let index=0,cur=this.head;for(;cur!=null;){if(cur===target)return index;index+=cur.length(),cur=cur.next}return-1}remove(node){this.contains(node)&&(node.prev!=null&&(node.prev.next=node.next),node.next!=null&&(node.next.prev=node.prev),node===this.head&&(this.head=node.next),node===this.tail&&(this.tail=node.prev),this.length-=1)}iterator(curNode=this.head){return()=>{let ret=curNode;return curNode!=null&&(curNode=curNode.next),ret}}find(index,inclusive=!1){let next=this.iterator(),cur=next();for(;cur;){let length=cur.length();if(index<length||inclusive&&index===length&&(cur.next==null||cur.next.length()!==0))return[cur,index];index-=length,cur=next()}return[null,0]}forEach(callback){let next=this.iterator(),cur=next();for(;cur;)callback(cur),cur=next()}forEachAt(index,length,callback){if(length<=0)return;let[startNode,offset]=this.find(index),curIndex=index-offset,next=this.iterator(startNode),cur=next();for(;cur&&curIndex<index+length;){let curLength=cur.length();index>curIndex?callback(cur,index-curIndex,Math.min(length,curIndex+curLength-index)):callback(cur,0,Math.min(curLength,index+length-curIndex)),curIndex+=curLength,cur=next()}}map(callback){return this.reduce((memo,cur)=>(memo.push(callback(cur)),memo),[])}reduce(callback,memo){let next=this.iterator(),cur=next();for(;cur;)memo=callback(memo,cur),cur=next();return memo}};function makeAttachedBlot(node,scroll){let found=scroll.find(node);if(found)return found;try{return scroll.create(node)}catch{let blot=scroll.create(Scope.INLINE);return Array.from(node.childNodes).forEach(child=>{blot.domNode.appendChild(child)}),node.parentNode&&node.parentNode.replaceChild(blot.domNode,node),blot.attach(),blot}}var _ParentBlot=(()=>{let _ParentBlot2=class _ParentBlot3 extends ShadowBlot{constructor(scroll,domNode){super(scroll,domNode),this.uiNode=null,this.build()}appendChild(other){this.insertBefore(other)}attach(){super.attach(),this.children.forEach(child=>{child.attach()})}attachUI(node){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=node,_ParentBlot3.uiClass&&this.uiNode.classList.add(_ParentBlot3.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new LinkedList,Array.from(this.domNode.childNodes).filter(node=>node!==this.uiNode).reverse().forEach(node=>{try{let child=makeAttachedBlot(node,this.scroll);this.insertBefore(child,this.children.head||void 0)}catch(err){if(err instanceof ParchmentError)return;throw err}})}deleteAt(index,length){if(index===0&&length===this.length())return this.remove();this.children.forEachAt(index,length,(child,offset,childLength)=>{child.deleteAt(offset,childLength)})}descendant(criteria,index=0){let[child,offset]=this.children.find(index);return criteria.blotName==null&&criteria(child)||criteria.blotName!=null&&child instanceof criteria?[child,offset]:child instanceof _ParentBlot3?child.descendant(criteria,offset):[null,-1]}descendants(criteria,index=0,length=Number.MAX_VALUE){let descendants=[],lengthLeft=length;return this.children.forEachAt(index,length,(child,childIndex,childLength)=>{(criteria.blotName==null&&criteria(child)||criteria.blotName!=null&&child instanceof criteria)&&descendants.push(child),child instanceof _ParentBlot3&&(descendants=descendants.concat(child.descendants(criteria,childIndex,lengthLeft))),lengthLeft-=childLength}),descendants}detach(){this.children.forEach(child=>{child.detach()}),super.detach()}enforceAllowedChildren(){let done=!1;this.children.forEach(child=>{done||this.statics.allowedChildren.some(def=>child instanceof def)||(child.statics.scope===Scope.BLOCK_BLOT?(child.next!=null&&this.splitAfter(child),child.prev!=null&&this.splitAfter(child.prev),child.parent.unwrap(),done=!0):child instanceof _ParentBlot3?child.unwrap():child.remove())})}formatAt(index,length,name,value){this.children.forEachAt(index,length,(child,offset,childLength)=>{child.formatAt(offset,childLength,name,value)})}insertAt(index,value,def){let[child,offset]=this.children.find(index);if(child)child.insertAt(offset,value,def);else{let blot=def==null?this.scroll.create("text",value):this.scroll.create(value,def);this.appendChild(blot)}}insertBefore(childBlot,refBlot){childBlot.parent!=null&&childBlot.parent.children.remove(childBlot);let refDomNode=null;this.children.insertBefore(childBlot,refBlot||null),childBlot.parent=this,refBlot!=null&&(refDomNode=refBlot.domNode),(this.domNode.parentNode!==childBlot.domNode||this.domNode.nextSibling!==refDomNode)&&this.domNode.insertBefore(childBlot.domNode,refDomNode),childBlot.attach()}length(){return this.children.reduce((memo,child)=>memo+child.length(),0)}moveChildren(targetParent,refNode){this.children.forEach(child=>{targetParent.insertBefore(child,refNode)})}optimize(context){if(super.optimize(context),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){let child=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(child)}else this.remove()}path(index,inclusive=!1){let[child,offset]=this.children.find(index,inclusive),position=[[this,index]];return child instanceof _ParentBlot3?position.concat(child.path(offset,inclusive)):(child!=null&&position.push([child,offset]),position)}removeChild(child){this.children.remove(child)}replaceWith(name,value){let replacement=typeof name=="string"?this.scroll.create(name,value):name;return replacement instanceof _ParentBlot3&&this.moveChildren(replacement),super.replaceWith(replacement)}split(index,force=!1){if(!force){if(index===0)return this;if(index===this.length())return this.next}let after=this.clone();return this.parent&&this.parent.insertBefore(after,this.next||void 0),this.children.forEachAt(index,this.length(),(child,offset,_length)=>{let split=child.split(offset,force);split!=null&&after.appendChild(split)}),after}splitAfter(child){let after=this.clone();for(;child.next!=null;)after.appendChild(child.next);return this.parent&&this.parent.insertBefore(after,this.next||void 0),after}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(mutations,_context){let addedNodes=[],removedNodes=[];mutations.forEach(mutation=>{mutation.target===this.domNode&&mutation.type==="childList"&&(addedNodes.push(...mutation.addedNodes),removedNodes.push(...mutation.removedNodes))}),removedNodes.forEach(node=>{if(node.parentNode!=null&&node.tagName!=="IFRAME"&&document.body.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;let blot=this.scroll.find(node);blot!=null&&(blot.domNode.parentNode==null||blot.domNode.parentNode===this.domNode)&&blot.detach()}),addedNodes.filter(node=>node.parentNode===this.domNode&&node!==this.uiNode).sort((a,b)=>a===b?0:a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(node=>{let refBlot=null;node.nextSibling!=null&&(refBlot=this.scroll.find(node.nextSibling));let blot=makeAttachedBlot(node,this.scroll);(blot.next!==refBlot||blot.next==null)&&(blot.parent!=null&&blot.parent.removeChild(this),this.insertBefore(blot,refBlot||void 0))}),this.enforceAllowedChildren()}};return _ParentBlot2.uiClass="",_ParentBlot2})(),ParentBlot=_ParentBlot,ParentBlot$1=ParentBlot;function isEqual(obj1,obj2){if(Object.keys(obj1).length!==Object.keys(obj2).length)return!1;for(let prop in obj1)if(obj1[prop]!==obj2[prop])return!1;return!0}var _InlineBlot=class _InlineBlot2 extends ParentBlot$1{static create(value){return super.create(value)}static formats(domNode,scroll){let match2=scroll.query(_InlineBlot2.blotName);if(!(match2!=null&&domNode.tagName===match2.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return domNode.tagName.toLowerCase()}}constructor(scroll,domNode){super(scroll,domNode),this.attributes=new AttributorStore$1(this.domNode)}format(name,value){if(name===this.statics.blotName&&!value)this.children.forEach(child=>{child instanceof _InlineBlot2||(child=child.wrap(_InlineBlot2.blotName,!0)),this.attributes.copy(child)}),this.unwrap();else{let format=this.scroll.query(name,Scope.INLINE);if(format==null)return;format instanceof Attributor?this.attributes.attribute(format,value):value&&(name!==this.statics.blotName||this.formats()[name]!==value)&&this.replaceWith(name,value)}}formats(){let formats=this.attributes.values(),format=this.statics.formats(this.domNode,this.scroll);return format!=null&&(formats[this.statics.blotName]=format),formats}formatAt(index,length,name,value){this.formats()[name]!=null||this.scroll.query(name,Scope.ATTRIBUTE)?this.isolate(index,length).format(name,value):super.formatAt(index,length,name,value)}optimize(context){super.optimize(context);let formats=this.formats();if(Object.keys(formats).length===0)return this.unwrap();let next=this.next;next instanceof _InlineBlot2&&next.prev===this&&isEqual(formats,next.formats())&&(next.moveChildren(this),next.remove())}replaceWith(name,value){let replacement=super.replaceWith(name,value);return this.attributes.copy(replacement),replacement}update(mutations,context){super.update(mutations,context),mutations.some(mutation=>mutation.target===this.domNode&&mutation.type==="attributes")&&this.attributes.build()}wrap(name,value){let wrapper=super.wrap(name,value);return wrapper instanceof _InlineBlot2&&this.attributes.move(wrapper),wrapper}};_InlineBlot.allowedChildren=[_InlineBlot,LeafBlot$1],_InlineBlot.blotName="inline",_InlineBlot.scope=Scope.INLINE_BLOT,_InlineBlot.tagName="SPAN";var InlineBlot=_InlineBlot,InlineBlot$1=InlineBlot,_BlockBlot=class _BlockBlot2 extends ParentBlot$1{static create(value){return super.create(value)}static formats(domNode,scroll){let match2=scroll.query(_BlockBlot2.blotName);if(!(match2!=null&&domNode.tagName===match2.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return domNode.tagName.toLowerCase()}}constructor(scroll,domNode){super(scroll,domNode),this.attributes=new AttributorStore$1(this.domNode)}format(name,value){let format=this.scroll.query(name,Scope.BLOCK);format!=null&&(format instanceof Attributor?this.attributes.attribute(format,value):name===this.statics.blotName&&!value?this.replaceWith(_BlockBlot2.blotName):value&&(name!==this.statics.blotName||this.formats()[name]!==value)&&this.replaceWith(name,value))}formats(){let formats=this.attributes.values(),format=this.statics.formats(this.domNode,this.scroll);return format!=null&&(formats[this.statics.blotName]=format),formats}formatAt(index,length,name,value){this.scroll.query(name,Scope.BLOCK)!=null?this.format(name,value):super.formatAt(index,length,name,value)}insertAt(index,value,def){if(def==null||this.scroll.query(value,Scope.INLINE)!=null)super.insertAt(index,value,def);else{let after=this.split(index);if(after!=null){let blot=this.scroll.create(value,def);after.parent.insertBefore(blot,after)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(name,value){let replacement=super.replaceWith(name,value);return this.attributes.copy(replacement),replacement}update(mutations,context){super.update(mutations,context),mutations.some(mutation=>mutation.target===this.domNode&&mutation.type==="attributes")&&this.attributes.build()}};_BlockBlot.blotName="block",_BlockBlot.scope=Scope.BLOCK_BLOT,_BlockBlot.tagName="P",_BlockBlot.allowedChildren=[InlineBlot$1,_BlockBlot,LeafBlot$1];var BlockBlot=_BlockBlot,BlockBlot$1=BlockBlot,_ContainerBlot=class extends ParentBlot$1{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(index,length){super.deleteAt(index,length),this.enforceAllowedChildren()}formatAt(index,length,name,value){super.formatAt(index,length,name,value),this.enforceAllowedChildren()}insertAt(index,value,def){super.insertAt(index,value,def),this.enforceAllowedChildren()}optimize(context){super.optimize(context),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};_ContainerBlot.blotName="container",_ContainerBlot.scope=Scope.BLOCK_BLOT;var ContainerBlot=_ContainerBlot,ContainerBlot$1=ContainerBlot,EmbedBlot=class extends LeafBlot$1{static formats(_domNode,_scroll){}format(name,value){super.formatAt(0,this.length(),name,value)}formatAt(index,length,name,value){index===0&&length===this.length()?this.format(name,value):super.formatAt(index,length,name,value)}formats(){return this.statics.formats(this.domNode,this.scroll)}},EmbedBlot$1=EmbedBlot,OBSERVER_CONFIG={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},MAX_OPTIMIZE_ITERATIONS=100,_ScrollBlot=class extends ParentBlot$1{constructor(registry,node){super(null,node),this.registry=registry,this.scroll=this,this.build(),this.observer=new MutationObserver(mutations=>{this.update(mutations)}),this.observer.observe(this.domNode,OBSERVER_CONFIG),this.attach()}create(input,value){return this.registry.create(this,input,value)}find(node,bubble=!1){let blot=this.registry.find(node,bubble);return blot?blot.scroll===this?blot:bubble?this.find(blot.scroll.domNode.parentNode,!0):null:null}query(query,scope=Scope.ANY){return this.registry.query(query,scope)}register(...definitions){return this.registry.register(...definitions)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(index,length){this.update(),index===0&&length===this.length()?this.children.forEach(child=>{child.remove()}):super.deleteAt(index,length)}formatAt(index,length,name,value){this.update(),super.formatAt(index,length,name,value)}insertAt(index,value,def){this.update(),super.insertAt(index,value,def)}optimize(mutations=[],context={}){super.optimize(context);let mutationsMap=context.mutationsMap||new WeakMap,records=Array.from(this.observer.takeRecords());for(;records.length>0;)mutations.push(records.pop());let mark=(blot,markParent=!0)=>{blot==null||blot===this||blot.domNode.parentNode!=null&&(mutationsMap.has(blot.domNode)||mutationsMap.set(blot.domNode,[]),markParent&&mark(blot.parent))},optimize=blot=>{mutationsMap.has(blot.domNode)&&(blot instanceof ParentBlot$1&&blot.children.forEach(optimize),mutationsMap.delete(blot.domNode),blot.optimize(context))},remaining=mutations;for(let i=0;remaining.length>0;i+=1){if(i>=MAX_OPTIMIZE_ITERATIONS)throw new Error("[Parchment] Maximum optimize iterations reached");for(remaining.forEach(mutation=>{let blot=this.find(mutation.target,!0);blot!=null&&(blot.domNode===mutation.target&&(mutation.type==="childList"?(mark(this.find(mutation.previousSibling,!1)),Array.from(mutation.addedNodes).forEach(node=>{let child=this.find(node,!1);mark(child,!1),child instanceof ParentBlot$1&&child.children.forEach(grandChild=>{mark(grandChild,!1)})})):mutation.type==="attributes"&&mark(blot.prev)),mark(blot))}),this.children.forEach(optimize),remaining=Array.from(this.observer.takeRecords()),records=remaining.slice();records.length>0;)mutations.push(records.pop())}}update(mutations,context={}){mutations=mutations||this.observer.takeRecords();let mutationsMap=new WeakMap;mutations.map(mutation=>{let blot=this.find(mutation.target,!0);return blot==null?null:mutationsMap.has(blot.domNode)?(mutationsMap.get(blot.domNode).push(mutation),null):(mutationsMap.set(blot.domNode,[mutation]),blot)}).forEach(blot=>{blot!=null&&blot!==this&&mutationsMap.has(blot.domNode)&&blot.update(mutationsMap.get(blot.domNode)||[],context)}),context.mutationsMap=mutationsMap,mutationsMap.has(this.domNode)&&super.update(mutationsMap.get(this.domNode),context),this.optimize(mutations,context)}};_ScrollBlot.blotName="scroll",_ScrollBlot.defaultChild=BlockBlot$1,_ScrollBlot.allowedChildren=[BlockBlot$1,ContainerBlot$1],_ScrollBlot.scope=Scope.BLOCK_BLOT,_ScrollBlot.tagName="DIV";var ScrollBlot=_ScrollBlot,ScrollBlot$1=ScrollBlot,_TextBlot=class _TextBlot2 extends LeafBlot$1{static create(value){return document.createTextNode(value)}static value(domNode){return domNode.data}constructor(scroll,node){super(scroll,node),this.text=this.statics.value(this.domNode)}deleteAt(index,length){this.domNode.data=this.text=this.text.slice(0,index)+this.text.slice(index+length)}index(node,offset){return this.domNode===node?offset:-1}insertAt(index,value,def){def==null?(this.text=this.text.slice(0,index)+value+this.text.slice(index),this.domNode.data=this.text):super.insertAt(index,value,def)}length(){return this.text.length}optimize(context){super.optimize(context),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof _TextBlot2&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(index,_inclusive=!1){return[this.domNode,index]}split(index,force=!1){if(!force){if(index===0)return this;if(index===this.length())return this.next}let after=this.scroll.create(this.domNode.splitText(index));return this.parent.insertBefore(after,this.next||void 0),this.text=this.statics.value(this.domNode),after}update(mutations,_context){mutations.some(mutation=>mutation.type==="characterData"&&mutation.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};_TextBlot.blotName="text",_TextBlot.scope=Scope.INLINE_BLOT;var TextBlot=_TextBlot,TextBlot$1=TextBlot;var import_quill_delta3=__toESM(require_Delta(),1);var import_quill_delta2=__toESM(require_Delta(),1);var import_quill_delta=__toESM(require_Delta(),1);var Break=(()=>{class Break2 extends EmbedBlot$1{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}return Break2.blotName="break",Break2.tagName="BR",Break2})(),break_default=Break;var Text2=class extends TextBlot$1{};function escapeText(text){return text.replace(/[&<>"']/g,s=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[s])}var Inline=(()=>{let _Inline=class _Inline extends InlineBlot$1{static compare(self2,other){let selfIndex=_Inline.order.indexOf(self2),otherIndex=_Inline.order.indexOf(other);return selfIndex>=0||otherIndex>=0?selfIndex-otherIndex:self2===other?0:self2<other?-1:1}formatAt(index,length,name,value){if(_Inline.compare(this.statics.blotName,name)<0&&this.scroll.query(name,Scope.BLOT)){let blot=this.isolate(index,length);value&&blot.wrap(name,value)}else super.formatAt(index,length,name,value)}optimize(context){if(super.optimize(context),this.parent instanceof _Inline&&_Inline.compare(this.statics.blotName,this.parent.statics.blotName)>0){let parent=this.parent.isolate(this.offset(),this.length());this.moveChildren(parent),parent.wrap(this)}}};__publicField(_Inline,"allowedChildren",[_Inline,break_default,EmbedBlot$1,Text2]),__publicField(_Inline,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Inline2=_Inline;return Inline2})(),inline_default=Inline;var NEWLINE_LENGTH=1,Block=(()=>{class Block2 extends BlockBlot$1{constructor(){super(...arguments);__publicField(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=blockDelta(this)),this.cache.delta}deleteAt(index,length){super.deleteAt(index,length),this.cache={}}formatAt(index,length,name,value){length<=0||(this.scroll.query(name,Scope.BLOCK)?index+length===this.length()&&this.format(name,value):super.formatAt(index,Math.min(length,this.length()-index-1),name,value),this.cache={})}insertAt(index,value,def){if(def!=null){super.insertAt(index,value,def),this.cache={};return}if(value.length===0)return;let lines=value.split(`
3
- `),text=lines.shift();text.length>0&&(index<this.length()-1||this.children.tail==null?super.insertAt(Math.min(index,this.length()-1),text):this.children.tail.insertAt(this.children.tail.length(),text),this.cache={});let block=this;lines.reduce((lineIndex,line)=>(block=block.split(lineIndex,!0),block.insertAt(0,line),line.length),index+text.length)}insertBefore(blot,ref){let{head}=this.children;super.insertBefore(blot,ref),head instanceof break_default&&head.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+NEWLINE_LENGTH),this.cache.length}moveChildren(target,ref){super.moveChildren(target,ref),this.cache={}}optimize(context){super.optimize(context),this.cache={}}path(index){return super.path(index,!0)}removeChild(child){super.removeChild(child),this.cache={}}split(index){let force=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(force&&(index===0||index>=this.length()-NEWLINE_LENGTH)){let clone=this.clone();return index===0?(this.parent.insertBefore(clone,this),this):(this.parent.insertBefore(clone,this.next),clone)}let next=super.split(index,force);return this.cache={},next}}return Block2.blotName="block",Block2.tagName="P",Block2.defaultChild=break_default,Block2.allowedChildren=[break_default,inline_default,EmbedBlot$1,Text2],Block2})(),BlockEmbed=class extends EmbedBlot$1{attach(){super.attach(),this.attributes=new AttributorStore$1(this.domNode)}delta(){return new import_quill_delta.default().insert(this.value(),__spreadValues(__spreadValues({},this.formats()),this.attributes.values()))}format(name,value){let attribute=this.scroll.query(name,Scope.BLOCK_ATTRIBUTE);attribute!=null&&this.attributes.attribute(attribute,value)}formatAt(index,length,name,value){this.format(name,value)}insertAt(index,value,def){if(def!=null){super.insertAt(index,value,def);return}let lines=value.split(`
4
- `),text=lines.pop(),blocks=lines.map(line=>{let block=this.scroll.create(Block.blotName);return block.insertAt(0,line),block}),ref=this.split(index);blocks.forEach(block=>{this.parent.insertBefore(block,ref)}),text&&this.parent.insertBefore(this.scroll.create("text",text),ref)}};BlockEmbed.scope=Scope.BLOCK_BLOT;function blockDelta(blot){let filter=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return blot.descendants(LeafBlot$1).reduce((delta,leaf)=>leaf.length()===0?delta:delta.insert(leaf.value(),bubbleFormats(leaf,{},filter)),new import_quill_delta.default).insert(`
5
- `,bubbleFormats(blot))}function bubbleFormats(blot){let formats=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},filter=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return blot==null||("formats"in blot&&typeof blot.formats=="function"&&(formats=__spreadValues(__spreadValues({},formats),blot.formats()),filter&&delete formats["code-token"]),blot.parent==null||blot.parent.statics.blotName==="scroll"||blot.parent.statics.scope!==blot.statics.scope)?formats:bubbleFormats(blot.parent,formats,filter)}var Cursor=(()=>{let _Cursor=class _Cursor extends EmbedBlot$1{static value(){}constructor(scroll,domNode,selection){super(scroll,domNode),this.selection=selection,this.textNode=document.createTextNode(_Cursor.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(name,value){if(this.savedLength!==0){super.format(name,value);return}let target=this,index=0;for(;target!=null&&target.statics.scope!==Scope.BLOCK_BLOT;)index+=target.offset(target.parent),target=target.parent;target!=null&&(this.savedLength=_Cursor.CONTENTS.length,target.optimize(),target.formatAt(index,_Cursor.CONTENTS.length,name,value),this.savedLength=0)}index(node,offset){return node===this.textNode?0:super.index(node,offset)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let range=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let prevTextBlot=this.prev instanceof Text2?this.prev:null,prevTextLength=prevTextBlot?prevTextBlot.length():0,nextTextBlot=this.next instanceof Text2?this.next:null,nextText=nextTextBlot?nextTextBlot.text:"",{textNode}=this,newText=textNode.data.split(_Cursor.CONTENTS).join("");textNode.data=_Cursor.CONTENTS;let mergedTextBlot;if(prevTextBlot)mergedTextBlot=prevTextBlot,(newText||nextTextBlot)&&(prevTextBlot.insertAt(prevTextBlot.length(),newText+nextText),nextTextBlot&&nextTextBlot.remove());else if(nextTextBlot)mergedTextBlot=nextTextBlot,nextTextBlot.insertAt(0,newText);else{let newTextNode=document.createTextNode(newText);mergedTextBlot=this.scroll.create(newTextNode),this.parent.insertBefore(mergedTextBlot,this)}if(this.remove(),range){let remapOffset=(node,offset)=>prevTextBlot&&node===prevTextBlot.domNode?offset:node===textNode?prevTextLength+offset-1:nextTextBlot&&node===nextTextBlot.domNode?prevTextLength+newText.length+offset:null,start=remapOffset(range.start.node,range.start.offset),end=remapOffset(range.end.node,range.end.offset);if(start!==null&&end!==null)return{startNode:mergedTextBlot.domNode,startOffset:start,endNode:mergedTextBlot.domNode,endOffset:end}}return null}update(mutations,context){if(mutations.some(mutation=>mutation.type==="characterData"&&mutation.target===this.textNode)){let range=this.restore();range&&(context.range=range)}}optimize(context){super.optimize(context);let{parent}=this;for(;parent;){if(parent.domNode.tagName==="A"){this.savedLength=_Cursor.CONTENTS.length,parent.isolate(this.offset(parent),this.length()).unwrap(),this.savedLength=0;break}parent=parent.parent}}value(){return""}};__publicField(_Cursor,"blotName","cursor"),__publicField(_Cursor,"className","ql-cursor"),__publicField(_Cursor,"tagName","span"),__publicField(_Cursor,"CONTENTS","\uFEFF");let Cursor2=_Cursor;return Cursor2})(),cursor_default=Cursor;var import_index=__toESM(require_eventemitter3(),1);var instances_default=new WeakMap;var levels=["error","warn","log","info"],level="warn";function debug(method){if(level&&levels.indexOf(method)<=levels.indexOf(level)){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];console[method](...args)}}function namespace(ns){return levels.reduce((logger,method)=>(logger[method]=debug.bind(console,method,ns),logger),{})}namespace.level=newLevel=>{level=newLevel};debug.level=namespace.level;var logger_default=namespace;var debug2=logger_default("quill:events"),EVENTS=["selectionchange","mousedown","mouseup","click"];EVENTS.forEach(eventName=>{document.addEventListener(eventName,function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];Array.from(document.querySelectorAll(".ql-container")).forEach(node=>{let quill=instances_default.get(node);quill&&quill.emitter&&quill.emitter.handleDOM(...args)})})});var Emitter=(()=>{class Emitter2 extends import_index.default{constructor(){super(),this.domListeners={},this.on("error",debug2.error)}emit(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return debug2.log.call(debug2,...args),super.emit(...args)}handleDOM(event){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];(this.domListeners[event.type]||[]).forEach(_ref=>{let{node,handler}=_ref;(event.target===node||node.contains(event.target))&&handler(event,...args)})}listenDOM(eventName,node,handler){this.domListeners[eventName]||(this.domListeners[eventName]=[]),this.domListeners[eventName].push({node,handler})}}return __publicField(Emitter2,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),__publicField(Emitter2,"sources",{API:"api",SILENT:"silent",USER:"user"}),Emitter2})(),emitter_default=Emitter;var debug3=logger_default("quill:selection"),Range=class{constructor(index){let length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=index,this.length=length}},Selection=class{constructor(scroll,emitter){this.emitter=emitter,this.scroll=scroll,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Range(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,emitter_default.sources.USER),1)}),this.emitter.on(emitter_default.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;let native=this.getNativeRange();native!=null&&native.start.node!==this.cursor.textNode&&this.emitter.once(emitter_default.events.SCROLL_UPDATE,(source,mutations)=>{try{this.root.contains(native.start.node)&&this.root.contains(native.end.node)&&this.setNativeRange(native.start.node,native.start.offset,native.end.node,native.end.offset);let triggeredByTyping=mutations.some(mutation=>mutation.type==="characterData"||mutation.type==="childList"||mutation.type==="attributes"&&mutation.target===this.root);this.update(triggeredByTyping?emitter_default.sources.SILENT:source)}catch{}})}),this.emitter.on(emitter_default.events.SCROLL_OPTIMIZE,(mutations,context)=>{if(context.range){let{startNode,startOffset,endNode,endOffset}=context.range;this.setNativeRange(startNode,startOffset,endNode,endOffset),this.update(emitter_default.sources.SILENT)}}),this.update(emitter_default.sources.SILENT)}handleComposition(){this.emitter.on(emitter_default.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(emitter_default.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){let range=this.cursor.restore();if(!range)return;setTimeout(()=>{this.setNativeRange(range.startNode,range.startOffset,range.endNode,range.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(emitter_default.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(format,value){this.scroll.update();let nativeRange=this.getNativeRange();if(!(nativeRange==null||!nativeRange.native.collapsed||this.scroll.query(format,Scope.BLOCK))){if(nativeRange.start.node!==this.cursor.textNode){let blot=this.scroll.find(nativeRange.start.node,!1);if(blot==null)return;if(blot instanceof LeafBlot$1){let after=blot.split(nativeRange.start.offset);blot.parent.insertBefore(this.cursor,after)}else blot.insertBefore(this.cursor,nativeRange.start.node);this.cursor.attach()}this.cursor.format(format,value),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(index){let length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,scrollLength=this.scroll.length();index=Math.min(index,scrollLength-1),length=Math.min(index+length,scrollLength-1)-index;let node,[leaf,offset]=this.scroll.leaf(index);if(leaf==null)return null;if(length>0&&offset===leaf.length()){let[next]=this.scroll.leaf(index+1);if(next){let[line]=this.scroll.line(index),[nextLine]=this.scroll.line(index+1);line===nextLine&&(leaf=next,offset=0)}}[node,offset]=leaf.position(offset,!0);let range=document.createRange();if(length>0)return range.setStart(node,offset),[leaf,offset]=this.scroll.leaf(index+length),leaf==null?null:([node,offset]=leaf.position(offset,!0),range.setEnd(node,offset),range.getBoundingClientRect());let side="left",rect;if(node instanceof Text){if(!node.data.length)return null;offset<node.data.length?(range.setStart(node,offset),range.setEnd(node,offset+1)):(range.setStart(node,offset-1),range.setEnd(node,offset),side="right"),rect=range.getBoundingClientRect()}else{if(!(leaf.domNode instanceof Element))return null;rect=leaf.domNode.getBoundingClientRect(),offset>0&&(side="right")}return{bottom:rect.top+rect.height,height:rect.height,left:rect[side],right:rect[side],top:rect.top,width:0}}getNativeRange(){let selection=document.getSelection();if(selection==null||selection.rangeCount<=0)return null;let nativeRange=selection.getRangeAt(0);if(nativeRange==null)return null;let range=this.normalizeNative(nativeRange);return debug3.info("getNativeRange",range),range}getRange(){let root=this.scroll.domNode;if("isConnected"in root&&!root.isConnected)return[null,null];let normalized=this.getNativeRange();return normalized==null?[null,null]:[this.normalizedToRange(normalized),normalized]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&contains(this.root,document.activeElement)}normalizedToRange(range){let positions=[[range.start.node,range.start.offset]];range.native.collapsed||positions.push([range.end.node,range.end.offset]);let indexes=positions.map(position=>{let[node,offset]=position,blot=this.scroll.find(node,!0),index=blot.offset(this.scroll);return offset===0?index:blot instanceof LeafBlot$1?index+blot.index(node,offset):index+blot.length()}),end=Math.min(Math.max(...indexes),this.scroll.length()-1),start=Math.min(end,...indexes);return new Range(start,end-start)}normalizeNative(nativeRange){if(!contains(this.root,nativeRange.startContainer)||!nativeRange.collapsed&&!contains(this.root,nativeRange.endContainer))return null;let range={start:{node:nativeRange.startContainer,offset:nativeRange.startOffset},end:{node:nativeRange.endContainer,offset:nativeRange.endOffset},native:nativeRange};return[range.start,range.end].forEach(position=>{let{node,offset}=position;for(;!(node instanceof Text)&&node.childNodes.length>0;)if(node.childNodes.length>offset)node=node.childNodes[offset],offset=0;else if(node.childNodes.length===offset)node=node.lastChild,node instanceof Text?offset=node.data.length:node.childNodes.length>0?offset=node.childNodes.length:offset=node.childNodes.length+1;else break;position.node=node,position.offset=offset}),range}rangeToNative(range){let scrollLength=this.scroll.length(),getPosition=(index,inclusive)=>{index=Math.min(scrollLength-1,index);let[leaf,leafOffset]=this.scroll.leaf(index);return leaf?leaf.position(leafOffset,inclusive):[null,-1]};return[...getPosition(range.index,!1),...getPosition(range.index+range.length,!0)]}setNativeRange(startNode,startOffset){let endNode=arguments.length>2&&arguments[2]!==void 0?arguments[2]:startNode,endOffset=arguments.length>3&&arguments[3]!==void 0?arguments[3]:startOffset,force=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(debug3.info("setNativeRange",startNode,startOffset,endNode,endOffset),startNode!=null&&(this.root.parentNode==null||startNode.parentNode==null||endNode.parentNode==null))return;let selection=document.getSelection();if(selection!=null)if(startNode!=null){this.hasFocus()||this.root.focus({preventScroll:!0});let{native}=this.getNativeRange()||{};if(native==null||force||startNode!==native.startContainer||startOffset!==native.startOffset||endNode!==native.endContainer||endOffset!==native.endOffset){startNode instanceof Element&&startNode.tagName==="BR"&&(startOffset=Array.from(startNode.parentNode.childNodes).indexOf(startNode),startNode=startNode.parentNode),endNode instanceof Element&&endNode.tagName==="BR"&&(endOffset=Array.from(endNode.parentNode.childNodes).indexOf(endNode),endNode=endNode.parentNode);let range=document.createRange();range.setStart(startNode,startOffset),range.setEnd(endNode,endOffset),selection.removeAllRanges(),selection.addRange(range)}}else selection.removeAllRanges(),this.root.blur()}setRange(range){let force=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,source=arguments.length>2&&arguments[2]!==void 0?arguments[2]:emitter_default.sources.API;if(typeof force=="string"&&(source=force,force=!1),debug3.info("setRange",range),range!=null){let args=this.rangeToNative(range);this.setNativeRange(...args,force)}else this.setNativeRange(null);this.update(source)}update(){let source=arguments.length>0&&arguments[0]!==void 0?arguments[0]:emitter_default.sources.USER,oldRange=this.lastRange,[lastRange,nativeRange]=this.getRange();if(this.lastRange=lastRange,this.lastNative=nativeRange,this.lastRange!=null&&(this.savedRange=this.lastRange),!isEqual_default(oldRange,this.lastRange)){if(!this.composing&&nativeRange!=null&&nativeRange.native.collapsed&&nativeRange.start.node!==this.cursor.textNode){let range=this.cursor.restore();range&&this.setNativeRange(range.startNode,range.startOffset,range.endNode,range.endOffset)}let args=[emitter_default.events.SELECTION_CHANGE,cloneDeep_default(this.lastRange),cloneDeep_default(oldRange),source];this.emitter.emit(emitter_default.events.EDITOR_CHANGE,...args),source!==emitter_default.sources.SILENT&&this.emitter.emit(...args)}}};function contains(parent,descendant){try{descendant.parentNode}catch{return!1}return parent.contains(descendant)}var selection_default=Selection;var ASCII=/^[ -~]*$/,Editor=class{constructor(scroll){this.scroll=scroll,this.delta=this.getDelta()}applyDelta(delta){this.scroll.update();let scrollLength=this.scroll.length();this.scroll.batchStart();let normalizedDelta=normalizeDelta(delta),deleteDelta=new import_quill_delta2.default;return splitOpLines(normalizedDelta.ops.slice()).reduce((index,op)=>{let length=import_quill_delta2.Op.length(op),attributes=op.attributes||{},isImplicitNewlinePrepended=!1,isImplicitNewlineAppended=!1;if(op.insert!=null){if(deleteDelta.retain(length),typeof op.insert=="string"){let text=op.insert;isImplicitNewlineAppended=!text.endsWith(`
6
- `)&&(scrollLength<=index||!!this.scroll.descendant(BlockEmbed,index)[0]),this.scroll.insertAt(index,text);let[line,offset]=this.scroll.line(index),formats=merge_default({},bubbleFormats(line));if(line instanceof Block){let[leaf]=line.descendant(LeafBlot$1,offset);leaf&&(formats=merge_default(formats,bubbleFormats(leaf)))}attributes=import_quill_delta2.AttributeMap.diff(formats,attributes)||{}}else if(typeof op.insert=="object"){let key=Object.keys(op.insert)[0];if(key==null)return index;let isInlineEmbed=this.scroll.query(key,Scope.INLINE)!=null;if(isInlineEmbed)(scrollLength<=index||this.scroll.descendant(BlockEmbed,index)[0])&&(isImplicitNewlineAppended=!0);else if(index>0){let[leaf,offset]=this.scroll.descendant(LeafBlot$1,index-1);leaf instanceof Text2?leaf.value()[offset]!==`
7
- `&&(isImplicitNewlinePrepended=!0):leaf instanceof EmbedBlot$1&&leaf.statics.scope===Scope.INLINE_BLOT&&(isImplicitNewlinePrepended=!0)}if(this.scroll.insertAt(index,key,op.insert[key]),isInlineEmbed){let[leaf]=this.scroll.descendant(LeafBlot$1,index);if(leaf){let formats=merge_default({},bubbleFormats(leaf));attributes=import_quill_delta2.AttributeMap.diff(formats,attributes)||{}}}}scrollLength+=length}else if(deleteDelta.push(op),op.retain!==null&&typeof op.retain=="object"){let key=Object.keys(op.retain)[0];if(key==null)return index;this.scroll.updateEmbedAt(index,key,op.retain[key])}Object.keys(attributes).forEach(name=>{this.scroll.formatAt(index,length,name,attributes[name])});let prependedLength=isImplicitNewlinePrepended?1:0,addedLength=isImplicitNewlineAppended?1:0;return scrollLength+=prependedLength+addedLength,deleteDelta.retain(prependedLength),deleteDelta.delete(addedLength),index+length+prependedLength+addedLength},0),deleteDelta.reduce((index,op)=>typeof op.delete=="number"?(this.scroll.deleteAt(index,op.delete),index):index+import_quill_delta2.Op.length(op),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(normalizedDelta)}deleteText(index,length){return this.scroll.deleteAt(index,length),this.update(new import_quill_delta2.default().retain(index).delete(length))}formatLine(index,length){let formats=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(formats).forEach(format=>{this.scroll.lines(index,Math.max(length,1)).forEach(line=>{line.format(format,formats[format])})}),this.scroll.optimize();let delta=new import_quill_delta2.default().retain(index).retain(length,cloneDeep_default(formats));return this.update(delta)}formatText(index,length){let formats=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(formats).forEach(format=>{this.scroll.formatAt(index,length,format,formats[format])});let delta=new import_quill_delta2.default().retain(index).retain(length,cloneDeep_default(formats));return this.update(delta)}getContents(index,length){return this.delta.slice(index,index+length)}getDelta(){return this.scroll.lines().reduce((delta,line)=>delta.concat(line.delta()),new import_quill_delta2.default)}getFormat(index){let length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,lines=[],leaves=[];length===0?this.scroll.path(index).forEach(path=>{let[blot]=path;blot instanceof Block?lines.push(blot):blot instanceof LeafBlot$1&&leaves.push(blot)}):(lines=this.scroll.lines(index,length),leaves=this.scroll.descendants(LeafBlot$1,index,length));let[lineFormats,leafFormats]=[lines,leaves].map(blots=>{let blot=blots.shift();if(blot==null)return{};let formats=bubbleFormats(blot);for(;Object.keys(formats).length>0;){let blot2=blots.shift();if(blot2==null)return formats;formats=combineFormats(bubbleFormats(blot2),formats)}return formats});return __spreadValues(__spreadValues({},lineFormats),leafFormats)}getHTML(index,length){let[line,lineOffset]=this.scroll.line(index);if(line){let lineLength=line.length();return line.length()>=lineOffset+length&&!(lineOffset===0&&length===lineLength)?convertHTML(line,lineOffset,length,!0):convertHTML(this.scroll,index,length,!0)}return""}getText(index,length){return this.getContents(index,length).filter(op=>typeof op.insert=="string").map(op=>op.insert).join("")}insertContents(index,contents){let normalizedDelta=normalizeDelta(contents),change=new import_quill_delta2.default().retain(index).concat(normalizedDelta);return this.scroll.insertContents(index,normalizedDelta),this.update(change)}insertEmbed(index,embed,value){return this.scroll.insertAt(index,embed,value),this.update(new import_quill_delta2.default().retain(index).insert({[embed]:value}))}insertText(index,text){let formats=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return text=text.replace(/\r\n/g,`
8
- `).replace(/\r/g,`
9
- `),this.scroll.insertAt(index,text),Object.keys(formats).forEach(format=>{this.scroll.formatAt(index,text.length,format,formats[format])}),this.update(new import_quill_delta2.default().retain(index).insert(text,cloneDeep_default(formats)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let blot=this.scroll.children.head;if(blot?.statics.blotName!==Block.blotName)return!1;let block=blot;return block.children.length>1?!1:block.children.head instanceof break_default}removeFormat(index,length){let text=this.getText(index,length),[line,offset]=this.scroll.line(index+length),suffixLength=0,suffix=new import_quill_delta2.default;line!=null&&(suffixLength=line.length()-offset,suffix=line.delta().slice(offset,offset+suffixLength-1).insert(`
10
- `));let diff=this.getContents(index,length+suffixLength).diff(new import_quill_delta2.default().insert(text).concat(suffix)),delta=new import_quill_delta2.default().retain(index).concat(diff);return this.applyDelta(delta)}update(change){let mutations=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],selectionInfo=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,oldDelta=this.delta;if(mutations.length===1&&mutations[0].type==="characterData"&&mutations[0].target.data.match(ASCII)&&this.scroll.find(mutations[0].target)){let textBlot=this.scroll.find(mutations[0].target),formats=bubbleFormats(textBlot),index=textBlot.offset(this.scroll),oldValue=mutations[0].oldValue.replace(cursor_default.CONTENTS,""),oldText=new import_quill_delta2.default().insert(oldValue),newText=new import_quill_delta2.default().insert(textBlot.value()),relativeSelectionInfo=selectionInfo&&{oldRange:shiftRange(selectionInfo.oldRange,-index),newRange:shiftRange(selectionInfo.newRange,-index)};change=new import_quill_delta2.default().retain(index).concat(oldText.diff(newText,relativeSelectionInfo)).reduce((delta,op)=>op.insert?delta.insert(op.insert,formats):delta.push(op),new import_quill_delta2.default),this.delta=oldDelta.compose(change)}else this.delta=this.getDelta(),(!change||!isEqual_default(oldDelta.compose(change),this.delta))&&(change=oldDelta.diff(this.delta,selectionInfo));return change}};function convertListHTML(items,lastIndent,types){if(items.length===0){let[endTag2]=getListType(types.pop());return lastIndent<=0?`</li></${endTag2}>`:`</li></${endTag2}>${convertListHTML([],lastIndent-1,types)}`}let[{child,offset,length,indent,type},...rest]=items,[tag,attribute]=getListType(type);if(indent>lastIndent)return types.push(type),indent===lastIndent+1?`<${tag}><li${attribute}>${convertHTML(child,offset,length)}${convertListHTML(rest,indent,types)}`:`<${tag}><li>${convertListHTML(items,lastIndent+1,types)}`;let previousType=types[types.length-1];if(indent===lastIndent&&type===previousType)return`</li><li${attribute}>${convertHTML(child,offset,length)}${convertListHTML(rest,indent,types)}`;let[endTag]=getListType(types.pop());return`</li></${endTag}>${convertListHTML(items,lastIndent-1,types)}`}function convertHTML(blot,index,length){let isRoot=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in blot&&typeof blot.html=="function")return blot.html(index,length);if(blot instanceof Text2)return escapeText(blot.value().slice(index,index+length));if(blot instanceof ParentBlot$1){if(blot.statics.blotName==="list-container"){let items=[];return blot.children.forEachAt(index,length,(child,offset,childLength)=>{let formats="formats"in child&&typeof child.formats=="function"?child.formats():{};items.push({child,offset,length:childLength,indent:formats.indent||0,type:formats.list})}),convertListHTML(items,-1,[])}let parts=[];if(blot.children.forEachAt(index,length,(child,offset,childLength)=>{parts.push(convertHTML(child,offset,childLength))}),isRoot||blot.statics.blotName==="list")return parts.join("");let{outerHTML,innerHTML}=blot.domNode,[start,end]=outerHTML.split(`>${innerHTML}<`);return start==="<table"?`<table style="border: 1px solid #000;">${parts.join("")}<${end}`:`${start}>${parts.join("")}<${end}`}return blot.domNode instanceof Element?blot.domNode.outerHTML:""}function combineFormats(formats,combined){return Object.keys(combined).reduce((merged,name)=>{if(formats[name]==null)return merged;let combinedValue=combined[name];return combinedValue===formats[name]?merged[name]=combinedValue:Array.isArray(combinedValue)?combinedValue.indexOf(formats[name])<0?merged[name]=combinedValue.concat([formats[name]]):merged[name]=combinedValue:merged[name]=[combinedValue,formats[name]],merged},{})}function getListType(type){let tag=type==="ordered"?"ol":"ul";switch(type){case"checked":return[tag,' data-list="checked"'];case"unchecked":return[tag,' data-list="unchecked"'];default:return[tag,""]}}function normalizeDelta(delta){return delta.reduce((normalizedDelta,op)=>{if(typeof op.insert=="string"){let text=op.insert.replace(/\r\n/g,`
11
- `).replace(/\r/g,`
12
- `);return normalizedDelta.insert(text,op.attributes)}return normalizedDelta.push(op)},new import_quill_delta2.default)}function shiftRange(_ref,amount){let{index,length}=_ref;return new Range(index+amount,length)}function splitOpLines(ops){let split=[];return ops.forEach(op=>{typeof op.insert=="string"?op.insert.split(`
13
- `).forEach((line,index)=>{index&&split.push({insert:`
14
- `,attributes:op.attributes}),line&&split.push({insert:line,attributes:op.attributes})}):split.push(op)}),split}var editor_default=Editor;var Module=(()=>{class Module2{constructor(quill){let options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=quill,this.options=options}}return __publicField(Module2,"DEFAULTS",{}),Module2})(),module_default=Module;var GUARD_TEXT="\uFEFF",Embed=class extends EmbedBlot$1{constructor(scroll,node){super(scroll,node),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(childNode=>{this.contentNode.appendChild(childNode)}),this.leftGuard=document.createTextNode(GUARD_TEXT),this.rightGuard=document.createTextNode(GUARD_TEXT),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(node,offset){return node===this.leftGuard?0:node===this.rightGuard?1:super.index(node,offset)}restore(node){let range=null,textNode,text=node.data.split(GUARD_TEXT).join("");if(node===this.leftGuard)if(this.prev instanceof Text2){let prevLength=this.prev.length();this.prev.insertAt(prevLength,text),range={startNode:this.prev.domNode,startOffset:prevLength+text.length}}else textNode=document.createTextNode(text),this.parent.insertBefore(this.scroll.create(textNode),this),range={startNode:textNode,startOffset:text.length};else node===this.rightGuard&&(this.next instanceof Text2?(this.next.insertAt(0,text),range={startNode:this.next.domNode,startOffset:text.length}):(textNode=document.createTextNode(text),this.parent.insertBefore(this.scroll.create(textNode),this.next),range={startNode:textNode,startOffset:text.length}));return node.data=GUARD_TEXT,range}update(mutations,context){mutations.forEach(mutation=>{if(mutation.type==="characterData"&&(mutation.target===this.leftGuard||mutation.target===this.rightGuard)){let range=this.restore(mutation.target);range&&(context.range=range)}})}},embed_default=Embed;var Composition=class{constructor(scroll,emitter){__publicField(this,"isComposing",!1);this.scroll=scroll,this.emitter=emitter,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",event=>{this.isComposing||this.handleCompositionStart(event)}),this.scroll.domNode.addEventListener("compositionend",event=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(event)})})}handleCompositionStart(event){let blot=event.target instanceof Node?this.scroll.find(event.target,!0):null;blot&&!(blot instanceof embed_default)&&(this.emitter.emit(emitter_default.events.COMPOSITION_BEFORE_START,event),this.scroll.batchStart(),this.emitter.emit(emitter_default.events.COMPOSITION_START,event),this.isComposing=!0)}handleCompositionEnd(event){this.emitter.emit(emitter_default.events.COMPOSITION_BEFORE_END,event),this.scroll.batchEnd(),this.emitter.emit(emitter_default.events.COMPOSITION_END,event),this.isComposing=!1}},composition_default=Composition;var Theme=(()=>{let _Theme=class _Theme{constructor(quill,options){__publicField(this,"modules",{});this.quill=quill,this.options=options}init(){Object.keys(this.options.modules).forEach(name=>{this.modules[name]==null&&this.addModule(name)})}addModule(name){let ModuleClass=this.quill.constructor.import(`modules/${name}`);return this.modules[name]=new ModuleClass(this.quill,this.options.modules[name]||{}),this.modules[name]}};__publicField(_Theme,"DEFAULTS",{modules:{}}),__publicField(_Theme,"themes",{default:_Theme});let Theme2=_Theme;return Theme2})(),theme_default=Theme;var getParentElement=element=>element.parentElement||element.getRootNode().host||null,getElementRect=element=>{let rect=element.getBoundingClientRect(),scaleX="offsetWidth"in element&&Math.abs(rect.width)/element.offsetWidth||1,scaleY="offsetHeight"in element&&Math.abs(rect.height)/element.offsetHeight||1;return{top:rect.top,right:rect.left+element.clientWidth*scaleX,bottom:rect.top+element.clientHeight*scaleY,left:rect.left}},paddingValueToInt=value=>{let number=parseInt(value,10);return Number.isNaN(number)?0:number},getScrollDistance=(targetStart,targetEnd,scrollStart,scrollEnd,scrollPaddingStart,scrollPaddingEnd)=>targetStart<scrollStart&&targetEnd>scrollEnd?0:targetStart<scrollStart?-(scrollStart-targetStart+scrollPaddingStart):targetEnd>scrollEnd?targetEnd-targetStart>scrollEnd-scrollStart?targetStart+scrollPaddingStart-scrollStart:targetEnd-scrollEnd+scrollPaddingEnd:0,scrollRectIntoView=(root,targetRect)=>{let document2=root.ownerDocument,rect=targetRect,current=root;for(;current;){let isDocumentBody=current===document2.body,bounding=isDocumentBody?{top:0,right:window.visualViewport?.width??document2.documentElement.clientWidth,bottom:window.visualViewport?.height??document2.documentElement.clientHeight,left:0}:getElementRect(current),style=getComputedStyle(current),scrollDistanceX=getScrollDistance(rect.left,rect.right,bounding.left,bounding.right,paddingValueToInt(style.scrollPaddingLeft),paddingValueToInt(style.scrollPaddingRight)),scrollDistanceY=getScrollDistance(rect.top,rect.bottom,bounding.top,bounding.bottom,paddingValueToInt(style.scrollPaddingTop),paddingValueToInt(style.scrollPaddingBottom));if(scrollDistanceX||scrollDistanceY)if(isDocumentBody)document2.defaultView?.scrollBy(scrollDistanceX,scrollDistanceY);else{let{scrollLeft,scrollTop}=current;scrollDistanceY&&(current.scrollTop+=scrollDistanceY),scrollDistanceX&&(current.scrollLeft+=scrollDistanceX);let scrolledLeft=current.scrollLeft-scrollLeft,scrolledTop=current.scrollTop-scrollTop;rect={left:rect.left-scrolledLeft,top:rect.top-scrolledTop,right:rect.right-scrolledLeft,bottom:rect.bottom-scrolledTop}}current=isDocumentBody||style.position==="fixed"?null:getParentElement(current)}},scrollRectIntoView_default=scrollRectIntoView;var MAX_REGISTER_ITERATIONS=100,CORE_FORMATS=["block","break","cursor","inline","scroll","text"],createRegistryWithFormats=(formats,sourceRegistry,debug8)=>{let registry=new Registry;return CORE_FORMATS.forEach(name=>{let coreBlot=sourceRegistry.query(name);coreBlot&&registry.register(coreBlot)}),formats.forEach(name=>{let format=sourceRegistry.query(name);format||debug8.error(`Cannot register "${name}" specified in "formats" config. Are you sure it was registered?`);let iterations=0;for(;format;)if(registry.register(format),format="blotName"in format?format.requiredContainer??null:null,iterations+=1,iterations>MAX_REGISTER_ITERATIONS){debug8.error(`Cycle detected in registering blot requiredContainer: "${name}"`);break}}),registry},createRegistryWithFormats_default=createRegistryWithFormats;var debug4=logger_default("quill"),globalRegistry=new Registry;ParentBlot$1.uiClass="ql-ui";var _Quill=class _Quill{static debug(limit){limit===!0&&(limit="log"),logger_default.level(limit)}static find(node){let bubble=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return instances_default.get(node)||globalRegistry.find(node,bubble)}static import(name){return this.imports[name]==null&&debug4.error(`Cannot import ${name}. Are you sure it was registered?`),this.imports[name]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){let target=arguments.length<=0?void 0:arguments[0],overwrite=!!(!(arguments.length<=1)&&arguments[1]),name="attrName"in target?target.attrName:target.blotName;typeof name=="string"?this.register(`formats/${name}`,target,overwrite):Object.keys(target).forEach(key=>{this.register(key,target[key],overwrite)})}else{let path=arguments.length<=0?void 0:arguments[0],target=arguments.length<=1?void 0:arguments[1],overwrite=!!(!(arguments.length<=2)&&arguments[2]);this.imports[path]!=null&&!overwrite&&debug4.warn(`Overwriting ${path} with`,target),this.imports[path]=target,(path.startsWith("blots/")||path.startsWith("formats/"))&&target&&typeof target!="boolean"&&target.blotName!=="abstract"&&globalRegistry.register(target),typeof target.register=="function"&&target.register(globalRegistry)}}constructor(container){let options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=expandConfig(container,options),this.container=this.options.container,this.container==null){debug4.error("Invalid Quill container",container);return}this.options.debug&&_Quill.debug(this.options.debug);let html=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",instances_default.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new emitter_default;let scrollBlotName=ScrollBlot$1.blotName,ScrollBlot2=this.options.registry.query(scrollBlotName);if(!ScrollBlot2||!("blotName"in ScrollBlot2))throw new Error(`Cannot initialize Quill without "${scrollBlotName}" blot`);if(this.scroll=new ScrollBlot2(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new editor_default(this.scroll),this.selection=new selection_default(this.scroll,this.emitter),this.composition=new composition_default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(emitter_default.events.EDITOR_CHANGE,type=>{type===emitter_default.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(emitter_default.events.SCROLL_UPDATE,(source,mutations)=>{let oldRange=this.selection.lastRange,[newRange]=this.selection.getRange(),selectionInfo=oldRange&&newRange?{oldRange,newRange}:void 0;modify.call(this,()=>this.editor.update(null,mutations,selectionInfo),source)}),this.emitter.on(emitter_default.events.SCROLL_EMBED_UPDATE,(blot,delta)=>{let oldRange=this.selection.lastRange,[newRange]=this.selection.getRange(),selectionInfo=oldRange&&newRange?{oldRange,newRange}:void 0;modify.call(this,()=>{let change=new import_quill_delta3.default().retain(blot.offset(this)).retain({[blot.statics.blotName]:delta});return this.editor.update(change,[],selectionInfo)},_Quill.sources.USER)}),html){let contents=this.clipboard.convert({html:`${html}<p><br></p>`,text:`
15
- `});this.setContents(contents)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(container){let refNode=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof container=="string"){let className=container;container=document.createElement("div"),container.classList.add(className)}return this.container.insertBefore(container,refNode),container}blur(){this.selection.setRange(null)}deleteText(index,length,source){return[index,length,,source]=overload(index,length,source),modify.call(this,()=>this.editor.deleteText(index,length),source,index,-1*length)}disable(){this.enable(!1)}editReadOnly(modifier){this.allowReadOnlyEdits=!0;let value=modifier();return this.allowReadOnlyEdits=!1,value}enable(){let enabled=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(enabled),this.container.classList.toggle("ql-disabled",!enabled)}focus(){let options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),options.preventScroll||this.scrollSelectionIntoView()}format(name,value){let source=arguments.length>2&&arguments[2]!==void 0?arguments[2]:emitter_default.sources.API;return modify.call(this,()=>{let range=this.getSelection(!0),change=new import_quill_delta3.default;if(range==null)return change;if(this.scroll.query(name,Scope.BLOCK))change=this.editor.formatLine(range.index,range.length,{[name]:value});else{if(range.length===0)return this.selection.format(name,value),change;change=this.editor.formatText(range.index,range.length,{[name]:value})}return this.setSelection(range,emitter_default.sources.SILENT),change},source)}formatLine(index,length,name,value,source){let formats;return[index,length,formats,source]=overload(index,length,name,value,source),modify.call(this,()=>this.editor.formatLine(index,length,formats),source,index,0)}formatText(index,length,name,value,source){let formats;return[index,length,formats,source]=overload(index,length,name,value,source),modify.call(this,()=>this.editor.formatText(index,length,formats),source,index,0)}getBounds(index){let length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,bounds=null;if(typeof index=="number"?bounds=this.selection.getBounds(index,length):bounds=this.selection.getBounds(index.index,index.length),!bounds)return null;let containerBounds=this.container.getBoundingClientRect();return{bottom:bounds.bottom-containerBounds.top,height:bounds.height,left:bounds.left-containerBounds.left,right:bounds.right-containerBounds.left,top:bounds.top-containerBounds.top,width:bounds.width}}getContents(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-index;return[index,length]=overload(index,length),this.editor.getContents(index,length)}getFormat(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof index=="number"?this.editor.getFormat(index,length):this.editor.getFormat(index.index,index.length)}getIndex(blot){return blot.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(index){return this.scroll.leaf(index)}getLine(index){return this.scroll.line(index)}getLines(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof index!="number"?this.scroll.lines(index.index,index.length):this.scroll.lines(index,length)}getModule(name){return this.theme.modules[name]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,length=arguments.length>1?arguments[1]:void 0;return typeof index=="number"&&(length=length??this.getLength()-index),[index,length]=overload(index,length),this.editor.getHTML(index,length)}getText(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,length=arguments.length>1?arguments[1]:void 0;return typeof index=="number"&&(length=length??this.getLength()-index),[index,length]=overload(index,length),this.editor.getText(index,length)}hasFocus(){return this.selection.hasFocus()}insertEmbed(index,embed,value){let source=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_Quill.sources.API;return modify.call(this,()=>this.editor.insertEmbed(index,embed,value),source,index)}insertText(index,text,name,value,source){let formats;return[index,,formats,source]=overload(index,0,name,value,source),modify.call(this,()=>this.editor.insertText(index,text,formats),source,index,text.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(index,length,source){return[index,length,,source]=overload(index,length,source),modify.call(this,()=>this.editor.removeFormat(index,length),source,index)}scrollRectIntoView(rect){scrollRectIntoView_default(this.root,rect)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let range=this.selection.lastRange,bounds=range&&this.selection.getBounds(range.index,range.length);bounds&&this.scrollRectIntoView(bounds)}setContents(delta){let source=arguments.length>1&&arguments[1]!==void 0?arguments[1]:emitter_default.sources.API;return modify.call(this,()=>{delta=new import_quill_delta3.default(delta);let length=this.getLength(),delete1=this.editor.deleteText(0,length),applied=this.editor.insertContents(0,delta),delete2=this.editor.deleteText(this.getLength()-1,1);return delete1.compose(applied).compose(delete2)},source)}setSelection(index,length,source){index==null?this.selection.setRange(null,length||_Quill.sources.API):([index,length,,source]=overload(index,length,source),this.selection.setRange(new Range(Math.max(0,index),length),source),source!==emitter_default.sources.SILENT&&this.scrollSelectionIntoView())}setText(text){let source=arguments.length>1&&arguments[1]!==void 0?arguments[1]:emitter_default.sources.API,delta=new import_quill_delta3.default().insert(text);return this.setContents(delta,source)}update(){let source=arguments.length>0&&arguments[0]!==void 0?arguments[0]:emitter_default.sources.USER,change=this.scroll.update(source);return this.selection.update(source),change}updateContents(delta){let source=arguments.length>1&&arguments[1]!==void 0?arguments[1]:emitter_default.sources.API;return modify.call(this,()=>(delta=new import_quill_delta3.default(delta),this.editor.applyDelta(delta)),source,!0)}};__publicField(_Quill,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:globalRegistry,theme:"default"}),__publicField(_Quill,"events",emitter_default.events),__publicField(_Quill,"sources",emitter_default.sources),__publicField(_Quill,"version","2.0.2"),__publicField(_Quill,"imports",{delta:import_quill_delta3.default,parchment:parchment_exports,"core/module":module_default,"core/theme":theme_default});var Quill=_Quill;function resolveSelector(selector){return typeof selector=="string"?document.querySelector(selector):selector}function expandModuleConfig(config4){return Object.entries(config4??{}).reduce((expanded,_ref)=>{let[key,value]=_ref;return __spreadProps(__spreadValues({},expanded),{[key]:value===!0?{}:value})},{})}function omitUndefinedValuesFromOptions(obj){return Object.fromEntries(Object.entries(obj).filter(entry=>entry[1]!==void 0))}function expandConfig(containerOrSelector,options){let container=resolveSelector(containerOrSelector);if(!container)throw new Error("Invalid Quill container");let theme=!options.theme||options.theme===Quill.DEFAULTS.theme?theme_default:Quill.import(`themes/${options.theme}`);if(!theme)throw new Error(`Invalid theme ${options.theme}. Did you register it?`);let _a=Quill.DEFAULTS,{modules:quillModuleDefaults}=_a,quillDefaults=__objRest(_a,["modules"]),_b=theme.DEFAULTS,{modules:themeModuleDefaults}=_b,themeDefaults=__objRest(_b,["modules"]),userModuleOptions=expandModuleConfig(options.modules);userModuleOptions!=null&&userModuleOptions.toolbar&&userModuleOptions.toolbar.constructor!==Object&&(userModuleOptions=__spreadProps(__spreadValues({},userModuleOptions),{toolbar:{container:userModuleOptions.toolbar}}));let modules=merge_default({},expandModuleConfig(quillModuleDefaults),expandModuleConfig(themeModuleDefaults),userModuleOptions),config4=__spreadValues(__spreadValues(__spreadValues({},quillDefaults),omitUndefinedValuesFromOptions(themeDefaults)),omitUndefinedValuesFromOptions(options)),registry=options.registry;return registry?options.formats&&debug4.warn('Ignoring "formats" option because "registry" is specified'):registry=options.formats?createRegistryWithFormats_default(options.formats,config4.registry,debug4):config4.registry,__spreadProps(__spreadValues({},config4),{registry,container,theme,modules:Object.entries(modules).reduce((modulesWithDefaults,_ref2)=>{let[name,value]=_ref2;if(!value)return modulesWithDefaults;let moduleClass=Quill.import(`modules/${name}`);return moduleClass==null?(debug4.error(`Cannot load ${name} module. Are you sure you registered it?`),modulesWithDefaults):__spreadProps(__spreadValues({},modulesWithDefaults),{[name]:merge_default({},moduleClass.DEFAULTS||{},value)})},{}),bounds:resolveSelector(config4.bounds)})}function modify(modifier,source,index,shift){if(!this.isEnabled()&&source===emitter_default.sources.USER&&!this.allowReadOnlyEdits)return new import_quill_delta3.default;let range=index==null?null:this.getSelection(),oldDelta=this.editor.delta,change=modifier();if(range!=null&&(index===!0&&(index=range.index),shift==null?range=shiftRange2(range,change,source):shift!==0&&(range=shiftRange2(range,index,shift,source)),this.setSelection(range,emitter_default.sources.SILENT)),change.length()>0){let args=[emitter_default.events.TEXT_CHANGE,change,oldDelta,source];this.emitter.emit(emitter_default.events.EDITOR_CHANGE,...args),source!==emitter_default.sources.SILENT&&this.emitter.emit(...args)}return change}function overload(index,length,name,value,source){let formats={};return typeof index.index=="number"&&typeof index.length=="number"?typeof length!="number"?(source=value,value=name,name=length,length=index.length,index=index.index):(length=index.length,index=index.index):typeof length!="number"&&(source=value,value=name,name=length,length=0),typeof name=="object"?(formats=name,source=value):typeof name=="string"&&(value!=null?formats[name]=value:source=name),source=source||emitter_default.sources.API,[index,length,formats,source]}function shiftRange2(range,index,lengthOrSource,source){let length=typeof lengthOrSource=="number"?lengthOrSource:0;if(range==null)return null;let start,end;return index&&typeof index.transformPosition=="function"?[start,end]=[range.index,range.index+range.length].map(pos=>index.transformPosition(pos,source!==emitter_default.sources.USER)):[start,end]=[range.index,range.index+range.length].map(pos=>pos<index||pos===index&&source===emitter_default.sources.USER?pos:length>=0?pos+length:Math.max(index,pos+length)),new Range(start,end-start)}var Container=class extends ContainerBlot$1{},container_default=Container;var import_quill_delta4=__toESM(require_Delta(),1);function isLine(blot){return blot instanceof Block||blot instanceof BlockEmbed}function isUpdatable(blot){return typeof blot.updateContent=="function"}var Scroll=(()=>{class Scroll2 extends ScrollBlot$1{constructor(registry,domNode,_ref){let{emitter}=_ref;super(registry,domNode),this.emitter=emitter,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",e=>this.handleDragStart(e))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;let mutations=this.batch;this.batch=!1,this.update(mutations)}emitMount(blot){this.emitter.emit(emitter_default.events.SCROLL_BLOT_MOUNT,blot)}emitUnmount(blot){this.emitter.emit(emitter_default.events.SCROLL_BLOT_UNMOUNT,blot)}emitEmbedUpdate(blot,change){this.emitter.emit(emitter_default.events.SCROLL_EMBED_UPDATE,blot,change)}deleteAt(index,length){let[first,offset]=this.line(index),[last]=this.line(index+length);if(super.deleteAt(index,length),last!=null&&first!==last&&offset>0){if(first instanceof BlockEmbed||last instanceof BlockEmbed){this.optimize();return}let ref=last.children.head instanceof break_default?null:last.children.head;first.moveChildren(last,ref),first.remove()}this.optimize()}enable(){let enabled=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",enabled?"true":"false")}formatAt(index,length,format,value){super.formatAt(index,length,format,value),this.optimize()}insertAt(index,value,def){if(index>=this.length())if(def==null||this.scroll.query(value,Scope.BLOCK)==null){let blot=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(blot),def==null&&value.endsWith(`
16
- `)?blot.insertAt(0,value.slice(0,-1),def):blot.insertAt(0,value,def)}else{let embed=this.scroll.create(value,def);this.appendChild(embed)}else super.insertAt(index,value,def);this.optimize()}insertBefore(blot,ref){if(blot.statics.scope===Scope.INLINE_BLOT){let wrapper=this.scroll.create(this.statics.defaultChild.blotName);wrapper.appendChild(blot),super.insertBefore(wrapper,ref)}else super.insertBefore(blot,ref)}insertContents(index,delta){let renderBlocks=this.deltaToRenderBlocks(delta.concat(new import_quill_delta4.default().insert(`
17
- `))),last=renderBlocks.pop();if(last==null)return;this.batchStart();let first=renderBlocks.shift();if(first){let shouldInsertNewlineChar=first.type==="block"&&(first.delta.length()===0||!this.descendant(BlockEmbed,index)[0]&&index<this.length()),delta2=first.type==="block"?first.delta:new import_quill_delta4.default().insert({[first.key]:first.value});insertInlineContents(this,index,delta2);let newlineCharLength=first.type==="block"?1:0,lineEndIndex=index+delta2.length()+newlineCharLength;shouldInsertNewlineChar&&this.insertAt(lineEndIndex-1,`
18
- `);let formats=bubbleFormats(this.line(index)[0]),attributes=import_quill_delta4.AttributeMap.diff(formats,first.attributes)||{};Object.keys(attributes).forEach(name=>{this.formatAt(lineEndIndex-1,1,name,attributes[name])}),index=lineEndIndex}let[refBlot,refBlotOffset]=this.children.find(index);if(renderBlocks.length&&(refBlot&&(refBlot=refBlot.split(refBlotOffset),refBlotOffset=0),renderBlocks.forEach(renderBlock=>{if(renderBlock.type==="block"){let block=this.createBlock(renderBlock.attributes,refBlot||void 0);insertInlineContents(block,0,renderBlock.delta)}else{let blockEmbed=this.create(renderBlock.key,renderBlock.value);this.insertBefore(blockEmbed,refBlot||void 0),Object.keys(renderBlock.attributes).forEach(name=>{blockEmbed.format(name,renderBlock.attributes[name])})}})),last.type==="block"&&last.delta.length()){let offset=refBlot?refBlot.offset(refBlot.scroll)+refBlotOffset:this.length();insertInlineContents(this,offset,last.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(index){let last=this.path(index).pop();if(!last)return[null,-1];let[blot,offset]=last;return blot instanceof LeafBlot$1?[blot,offset]:[null,-1]}line(index){return index===this.length()?this.line(index-1):this.descendant(isLine,index)}lines(){let index=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,length=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,getLines=(blot,blotIndex,blotLength)=>{let lines=[],lengthLeft=blotLength;return blot.children.forEachAt(blotIndex,blotLength,(child,childIndex,childLength)=>{isLine(child)?lines.push(child):child instanceof ContainerBlot$1&&(lines=lines.concat(getLines(child,childIndex,lengthLeft))),lengthLeft-=childLength}),lines};return getLines(this,index,length)}optimize(){let mutations=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],context=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(mutations,context),mutations.length>0&&this.emitter.emit(emitter_default.events.SCROLL_OPTIMIZE,mutations,context))}path(index){return super.path(index).slice(1)}remove(){}update(mutations){if(this.batch){Array.isArray(mutations)&&(this.batch=this.batch.concat(mutations));return}let source=emitter_default.sources.USER;typeof mutations=="string"&&(source=mutations),Array.isArray(mutations)||(mutations=this.observer.takeRecords()),mutations=mutations.filter(_ref2=>{let{target}=_ref2,blot=this.find(target,!0);return blot&&!isUpdatable(blot)}),mutations.length>0&&this.emitter.emit(emitter_default.events.SCROLL_BEFORE_UPDATE,source,mutations),super.update(mutations.concat([])),mutations.length>0&&this.emitter.emit(emitter_default.events.SCROLL_UPDATE,source,mutations)}updateEmbedAt(index,key,change){let[blot]=this.descendant(b=>b instanceof BlockEmbed,index);blot&&blot.statics.blotName===key&&isUpdatable(blot)&&blot.updateContent(change)}handleDragStart(event){event.preventDefault()}deltaToRenderBlocks(delta){let renderBlocks=[],currentBlockDelta=new import_quill_delta4.default;return delta.forEach(op=>{let insert=op?.insert;if(insert)if(typeof insert=="string"){let splitted=insert.split(`
19
- `);splitted.slice(0,-1).forEach(text=>{currentBlockDelta.insert(text,op.attributes),renderBlocks.push({type:"block",delta:currentBlockDelta,attributes:op.attributes??{}}),currentBlockDelta=new import_quill_delta4.default});let last=splitted[splitted.length-1];last&&currentBlockDelta.insert(last,op.attributes)}else{let key=Object.keys(insert)[0];if(!key)return;this.query(key,Scope.INLINE)?currentBlockDelta.push(op):(currentBlockDelta.length()&&renderBlocks.push({type:"block",delta:currentBlockDelta,attributes:{}}),currentBlockDelta=new import_quill_delta4.default,renderBlocks.push({type:"blockEmbed",key,value:insert[key],attributes:op.attributes??{}}))}}),currentBlockDelta.length()&&renderBlocks.push({type:"block",delta:currentBlockDelta,attributes:{}}),renderBlocks}createBlock(attributes,refBlot){let blotName,formats={};Object.entries(attributes).forEach(_ref3=>{let[key,value]=_ref3;this.query(key,Scope.BLOCK&Scope.BLOT)!=null?blotName=key:formats[key]=value});let block=this.create(blotName||this.statics.defaultChild.blotName,blotName?attributes[blotName]:void 0);this.insertBefore(block,refBlot||void 0);let length=block.length();return Object.entries(formats).forEach(_ref4=>{let[key,value]=_ref4;block.formatAt(0,length,key,value)}),block}}return __publicField(Scroll2,"blotName","scroll"),__publicField(Scroll2,"className","ql-editor"),__publicField(Scroll2,"tagName","DIV"),__publicField(Scroll2,"defaultChild",Block),__publicField(Scroll2,"allowedChildren",[Block,BlockEmbed,container_default]),Scroll2})();function insertInlineContents(parent,index,inlineContents){inlineContents.reduce((index2,op)=>{let length=import_quill_delta4.Op.length(op),attributes=op.attributes||{};if(op.insert!=null){if(typeof op.insert=="string"){let text=op.insert;parent.insertAt(index2,text);let[leaf]=parent.descendant(LeafBlot$1,index2),formats=bubbleFormats(leaf);attributes=import_quill_delta4.AttributeMap.diff(formats,attributes)||{}}else if(typeof op.insert=="object"){let key=Object.keys(op.insert)[0];if(key==null)return index2;if(parent.insertAt(index2,key,op.insert[key]),parent.scroll.query(key,Scope.INLINE)!=null){let[leaf]=parent.descendant(LeafBlot$1,index2),formats=bubbleFormats(leaf);attributes=import_quill_delta4.AttributeMap.diff(formats,attributes)||{}}}}return Object.keys(attributes).forEach(key=>{parent.formatAt(index2,length,key,attributes[key])}),index2+length},index)}var scroll_default=Scroll;var import_quill_delta6=__toESM(require_Delta(),1);var config={scope:Scope.BLOCK,whitelist:["right","center","justify"]},AlignAttribute=new Attributor("align","align",config),AlignClass=new ClassAttributor$1("align","ql-align",config),AlignStyle=new StyleAttributor$1("align","text-align",config);var ColorAttributor=class extends StyleAttributor$1{value(domNode){let value=super.value(domNode);return value.startsWith("rgb(")?(value=value.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${value.split(",").map(component=>`00${parseInt(component,10).toString(16)}`.slice(-2)).join("")}`):value}},ColorClass=new ClassAttributor$1("color","ql-color",{scope:Scope.INLINE}),ColorStyle=new ColorAttributor("color","color",{scope:Scope.INLINE});var BackgroundClass=new ClassAttributor$1("background","ql-bg",{scope:Scope.INLINE}),BackgroundStyle=new ColorAttributor("background","background-color",{scope:Scope.INLINE});var CodeBlockContainer=class extends container_default{static create(value){let domNode=super.create(value);return domNode.setAttribute("spellcheck","false"),domNode}code(index,length){return this.children.map(child=>child.length()<=1?"":child.domNode.innerText).join(`
20
- `).slice(index,index+length)}html(index,length){return`<pre>
21
- ${escapeText(this.code(index,length))}
22
- </pre>`}},CodeBlock=(()=>{class CodeBlock2 extends Block{static register(){Quill.register(CodeBlockContainer)}}return __publicField(CodeBlock2,"TAB"," "),CodeBlock2})(),Code=(()=>{class Code2 extends inline_default{}return Code2.blotName="code",Code2.tagName="CODE",Code2})();CodeBlock.blotName="code-block";CodeBlock.className="ql-code-block";CodeBlock.tagName="DIV";CodeBlockContainer.blotName="code-block-container";CodeBlockContainer.className="ql-code-block-container";CodeBlockContainer.tagName="DIV";CodeBlockContainer.allowedChildren=[CodeBlock];CodeBlock.allowedChildren=[Text2,break_default,cursor_default];CodeBlock.requiredContainer=CodeBlockContainer;var config2={scope:Scope.BLOCK,whitelist:["rtl"]},DirectionAttribute=new Attributor("direction","dir",config2),DirectionClass=new ClassAttributor$1("direction","ql-direction",config2),DirectionStyle=new StyleAttributor$1("direction","direction",config2);var config3={scope:Scope.INLINE,whitelist:["serif","monospace"]},FontClass=new ClassAttributor$1("font","ql-font",config3),FontStyleAttributor=class extends StyleAttributor$1{value(node){return super.value(node).replace(/["']/g,"")}},FontStyle=new FontStyleAttributor("font","font-family",config3);var SizeClass=new ClassAttributor$1("size","ql-size",{scope:Scope.INLINE,whitelist:["small","large","huge"]}),SizeStyle=new StyleAttributor$1("size","font-size",{scope:Scope.INLINE,whitelist:["10px","18px","32px"]});var import_quill_delta5=__toESM(require_Delta(),1);var debug5=logger_default("quill:keyboard"),SHORTKEY=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Keyboard=class _Keyboard extends module_default{static match(evt,binding){return["altKey","ctrlKey","metaKey","shiftKey"].some(key=>!!binding[key]!==evt[key]&&binding[key]!==null)?!1:binding.key===evt.key||binding.key===evt.which}constructor(quill,options){super(quill,options),this.bindings={},Object.keys(this.options.bindings).forEach(name=>{this.options.bindings[name]&&this.addBinding(this.options.bindings[name])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(keyBinding){let context=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},handler=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},binding=normalize(keyBinding);if(binding==null){debug5.warn("Attempted to add invalid keyboard binding",binding);return}typeof context=="function"&&(context={handler:context}),typeof handler=="function"&&(handler={handler}),(Array.isArray(binding.key)?binding.key:[binding.key]).forEach(key=>{let singleBinding=__spreadValues(__spreadValues(__spreadProps(__spreadValues({},binding),{key}),context),handler);this.bindings[singleBinding.key]=this.bindings[singleBinding.key]||[],this.bindings[singleBinding.key].push(singleBinding)})}listen(){this.quill.root.addEventListener("keydown",evt=>{if(evt.defaultPrevented||evt.isComposing||evt.keyCode===229&&(evt.key==="Enter"||evt.key==="Backspace"))return;let matches=(this.bindings[evt.key]||[]).concat(this.bindings[evt.which]||[]).filter(binding=>_Keyboard.match(evt,binding));if(matches.length===0)return;let blot=Quill.find(evt.target,!0);if(blot&&blot.scroll!==this.quill.scroll)return;let range=this.quill.getSelection();if(range==null||!this.quill.hasFocus())return;let[line,offset]=this.quill.getLine(range.index),[leafStart,offsetStart]=this.quill.getLeaf(range.index),[leafEnd,offsetEnd]=range.length===0?[leafStart,offsetStart]:this.quill.getLeaf(range.index+range.length),prefixText=leafStart instanceof TextBlot$1?leafStart.value().slice(0,offsetStart):"",suffixText=leafEnd instanceof TextBlot$1?leafEnd.value().slice(offsetEnd):"",curContext={collapsed:range.length===0,empty:range.length===0&&line.length()<=1,format:this.quill.getFormat(range),line,offset,prefix:prefixText,suffix:suffixText,event:evt};matches.some(binding=>{if(binding.collapsed!=null&&binding.collapsed!==curContext.collapsed||binding.empty!=null&&binding.empty!==curContext.empty||binding.offset!=null&&binding.offset!==curContext.offset)return!1;if(Array.isArray(binding.format)){if(binding.format.every(name=>curContext.format[name]==null))return!1}else if(typeof binding.format=="object"&&!Object.keys(binding.format).every(name=>binding.format[name]===!0?curContext.format[name]!=null:binding.format[name]===!1?curContext.format[name]==null:isEqual_default(binding.format[name],curContext.format[name])))return!1;return binding.prefix!=null&&!binding.prefix.test(curContext.prefix)||binding.suffix!=null&&!binding.suffix.test(curContext.suffix)?!1:binding.handler.call(this,range,curContext,binding)!==!0})&&evt.preventDefault()})}handleBackspace(range,context){let length=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix)?2:1;if(range.index===0||this.quill.getLength()<=1)return;let formats={},[line]=this.quill.getLine(range.index),delta=new import_quill_delta5.default().retain(range.index-length).delete(length);if(context.offset===0){let[prev]=this.quill.getLine(range.index-1);if(prev&&!(prev.statics.blotName==="block"&&prev.length()<=1)){let curFormats=line.formats(),prevFormats=this.quill.getFormat(range.index-1,1);if(formats=import_quill_delta5.AttributeMap.diff(curFormats,prevFormats)||{},Object.keys(formats).length>0){let formatDelta=new import_quill_delta5.default().retain(range.index+line.length()-2).retain(1,formats);delta=delta.compose(formatDelta)}}}this.quill.updateContents(delta,Quill.sources.USER),this.quill.focus()}handleDelete(range,context){let length=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix)?2:1;if(range.index>=this.quill.getLength()-length)return;let formats={},[line]=this.quill.getLine(range.index),delta=new import_quill_delta5.default().retain(range.index).delete(length);if(context.offset>=line.length()-1){let[next]=this.quill.getLine(range.index+1);if(next){let curFormats=line.formats(),nextFormats=this.quill.getFormat(range.index,1);formats=import_quill_delta5.AttributeMap.diff(curFormats,nextFormats)||{},Object.keys(formats).length>0&&(delta=delta.retain(next.length()-1).retain(1,formats))}}this.quill.updateContents(delta,Quill.sources.USER),this.quill.focus()}handleDeleteRange(range){deleteRange({range,quill:this.quill}),this.quill.focus()}handleEnter(range,context){let lineFormats=Object.keys(context.format).reduce((formats,format)=>(this.quill.scroll.query(format,Scope.BLOCK)&&!Array.isArray(context.format[format])&&(formats[format]=context.format[format]),formats),{}),delta=new import_quill_delta5.default().retain(range.index).delete(range.length).insert(`
23
- `,lineFormats);this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index+1,Quill.sources.SILENT),this.quill.focus()}},defaultOptions={bindings:{bold:makeFormatHandler("bold"),italic:makeFormatHandler("italic"),underline:makeFormatHandler("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(range,context){return context.collapsed&&context.offset!==0?!0:(this.quill.format("indent","+1",Quill.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(range,context){return context.collapsed&&context.offset!==0?!0:(this.quill.format("indent","-1",Quill.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(range,context){context.format.indent!=null?this.quill.format("indent","-1",Quill.sources.USER):context.format.list!=null&&this.quill.format("list",!1,Quill.sources.USER)}},"indent code-block":makeCodeBlockHandler(!0),"outdent code-block":makeCodeBlockHandler(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(range){this.quill.deleteText(range.index-1,1,Quill.sources.USER)}},tab:{key:"Tab",handler(range,context){if(context.format.table)return!0;this.quill.history.cutoff();let delta=new import_quill_delta5.default().retain(range.index).delete(range.length).insert(" ");return this.quill.updateContents(delta,Quill.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(range.index+1,Quill.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Quill.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(range,context){let formats={list:!1};context.format.indent&&(formats.indent=!1),this.quill.formatLine(range.index,range.length,formats,Quill.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(range){let[line,offset]=this.quill.getLine(range.index),formats=__spreadProps(__spreadValues({},line.formats()),{list:"checked"}),delta=new import_quill_delta5.default().retain(range.index).insert(`
24
- `,formats).retain(line.length()-offset-1).retain(1,{list:"unchecked"});this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index+1,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(range,context){let[line,offset]=this.quill.getLine(range.index),delta=new import_quill_delta5.default().retain(range.index).insert(`
25
- `,context.format).retain(line.length()-offset-1).retain(1,{header:null});this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index+1,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(range){let module=this.quill.getModule("table");if(module){let[table,row,cell,offset]=module.getTable(range),shift=tableSide(table,row,cell,offset);if(shift==null)return;let index=table.offset();if(shift<0){let delta=new import_quill_delta5.default().retain(index).insert(`
26
- `);this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index+1,range.length,Quill.sources.SILENT)}else if(shift>0){index+=table.length();let delta=new import_quill_delta5.default().retain(index).insert(`
27
- `);this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(index,Quill.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(range,context){let{event,line:cell}=context,offset=cell.offset(this.quill.scroll);event.shiftKey?this.quill.setSelection(offset-1,Quill.sources.USER):this.quill.setSelection(offset+cell.length(),Quill.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(range,context){if(this.quill.scroll.query("list")==null)return!0;let{length}=context.prefix,[line,offset]=this.quill.getLine(range.index);if(offset>length)return!0;let value;switch(context.prefix.trim()){case"[]":case"[ ]":value="unchecked";break;case"[x]":value="checked";break;case"-":case"*":value="bullet";break;default:value="ordered"}this.quill.insertText(range.index," ",Quill.sources.USER),this.quill.history.cutoff();let delta=new import_quill_delta5.default().retain(range.index-offset).delete(length+1).retain(line.length()-2-offset).retain(1,{list:value});return this.quill.updateContents(delta,Quill.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(range.index-length,Quill.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(range){let[line,offset]=this.quill.getLine(range.index),numLines=2,cur=line;for(;cur!=null&&cur.length()<=1&&cur.formats()["code-block"];)if(cur=cur.prev,numLines-=1,numLines<=0){let delta=new import_quill_delta5.default().retain(range.index+line.length()-offset-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index-1,Quill.sources.SILENT),!1}return!0}},"embed left":makeEmbedArrowHandler("ArrowLeft",!1),"embed left shift":makeEmbedArrowHandler("ArrowLeft",!0),"embed right":makeEmbedArrowHandler("ArrowRight",!1),"embed right shift":makeEmbedArrowHandler("ArrowRight",!0),"table down":makeTableArrowHandler(!1),"table up":makeTableArrowHandler(!0)}};Keyboard.DEFAULTS=defaultOptions;function makeCodeBlockHandler(indent){return{key:"Tab",shiftKey:!indent,format:{"code-block":!0},handler(range,_ref){let{event}=_ref,CodeBlock2=this.quill.scroll.query("code-block"),{TAB}=CodeBlock2;if(range.length===0&&!event.shiftKey){this.quill.insertText(range.index,TAB,Quill.sources.USER),this.quill.setSelection(range.index+TAB.length,Quill.sources.SILENT);return}let lines=range.length===0?this.quill.getLines(range.index,1):this.quill.getLines(range),{index,length}=range;lines.forEach((line,i)=>{indent?(line.insertAt(0,TAB),i===0?index+=TAB.length:length+=TAB.length):line.domNode.textContent.startsWith(TAB)&&(line.deleteAt(0,TAB.length),i===0?index-=TAB.length:length-=TAB.length)}),this.quill.update(Quill.sources.USER),this.quill.setSelection(index,length,Quill.sources.SILENT)}}}function makeEmbedArrowHandler(key,shiftKey){return{key,shiftKey,altKey:null,[key==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(range){let{index}=range;key==="ArrowRight"&&(index+=range.length+1);let[leaf]=this.quill.getLeaf(index);return leaf instanceof EmbedBlot$1?(key==="ArrowLeft"?shiftKey?this.quill.setSelection(range.index-1,range.length+1,Quill.sources.USER):this.quill.setSelection(range.index-1,Quill.sources.USER):shiftKey?this.quill.setSelection(range.index,range.length+1,Quill.sources.USER):this.quill.setSelection(range.index+range.length+1,Quill.sources.USER),!1):!0}}}function makeFormatHandler(format){return{key:format[0],shortKey:!0,handler(range,context){this.quill.format(format,!context.format[format],Quill.sources.USER)}}}function makeTableArrowHandler(up){return{key:up?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(range,context){let key=up?"prev":"next",cell=context.line,targetRow=cell.parent[key];if(targetRow!=null){if(targetRow.statics.blotName==="table-row"){let targetCell=targetRow.children.head,cur=cell;for(;cur.prev!=null;)cur=cur.prev,targetCell=targetCell.next;let index=targetCell.offset(this.quill.scroll)+Math.min(context.offset,targetCell.length()-1);this.quill.setSelection(index,0,Quill.sources.USER)}}else{let targetLine=cell.table()[key];targetLine!=null&&(up?this.quill.setSelection(targetLine.offset(this.quill.scroll)+targetLine.length()-1,0,Quill.sources.USER):this.quill.setSelection(targetLine.offset(this.quill.scroll),0,Quill.sources.USER))}return!1}}}function normalize(binding){if(typeof binding=="string"||typeof binding=="number")binding={key:binding};else if(typeof binding=="object")binding=cloneDeep_default(binding);else return null;return binding.shortKey&&(binding[SHORTKEY]=binding.shortKey,delete binding.shortKey),binding}function deleteRange(_ref2){let{quill,range}=_ref2,lines=quill.getLines(range),formats={};if(lines.length>1){let firstFormats=lines[0].formats(),lastFormats=lines[lines.length-1].formats();formats=import_quill_delta5.AttributeMap.diff(lastFormats,firstFormats)||{}}quill.deleteText(range,Quill.sources.USER),Object.keys(formats).length>0&&quill.formatLine(range.index,1,formats,Quill.sources.USER),quill.setSelection(range.index,Quill.sources.SILENT)}function tableSide(_table,row,cell,offset){return row.prev==null&&row.next==null?cell.prev==null&&cell.next==null?offset===0?-1:1:cell.prev==null?-1:1:row.prev==null?-1:row.next==null?1:null}var normalWeightRegexp=/font-weight:\s*normal/,blockTagNames=["P","OL","UL"],isBlockElement=element=>element&&blockTagNames.includes(element.tagName),normalizeEmptyLines=doc=>{Array.from(doc.querySelectorAll("br")).filter(br=>isBlockElement(br.previousElementSibling)&&isBlockElement(br.nextElementSibling)).forEach(br=>{br.parentNode?.removeChild(br)})},normalizeFontWeight=doc=>{Array.from(doc.querySelectorAll('b[style*="font-weight"]')).filter(node=>node.getAttribute("style")?.match(normalWeightRegexp)).forEach(node=>{let fragment=doc.createDocumentFragment();fragment.append(...node.childNodes),node.parentNode?.replaceChild(fragment,node)})};function normalize2(doc){doc.querySelector('[id^="docs-internal-guid-"]')&&(normalizeFontWeight(doc),normalizeEmptyLines(doc))}var ignoreRegexp=/\bmso-list:[^;]*ignore/i,idRegexp=/\bmso-list:[^;]*\bl(\d+)/i,indentRegexp=/\bmso-list:[^;]*\blevel(\d+)/i,parseListItem=(element,html)=>{let style=element.getAttribute("style"),idMatch=style?.match(idRegexp);if(!idMatch)return null;let id=Number(idMatch[1]),indentMatch=style?.match(indentRegexp),indent=indentMatch?Number(indentMatch[1]):1,typeRegexp=new RegExp(`@list l${id}:level${indent}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),typeMatch=html.match(typeRegexp),type=typeMatch&&typeMatch[1]==="bullet"?"bullet":"ordered";return{id,indent,type,element}},normalizeListItem=doc=>{let msoList=Array.from(doc.querySelectorAll("[style*=mso-list]")),ignored=[],others=[];msoList.forEach(node=>{(node.getAttribute("style")||"").match(ignoreRegexp)?ignored.push(node):others.push(node)}),ignored.forEach(node=>node.parentNode?.removeChild(node));let html=doc.documentElement.innerHTML,listItems=others.map(element=>parseListItem(element,html)).filter(parsed=>parsed);for(;listItems.length;){let childListItems=[],current=listItems.shift();for(;current;)childListItems.push(current),current=listItems.length&&listItems[0]?.element===current.element.nextElementSibling&&listItems[0].id===current.id?listItems.shift():null;let ul=document.createElement("ul");childListItems.forEach(listItem=>{let li=document.createElement("li");li.setAttribute("data-list",listItem.type),listItem.indent>1&&li.setAttribute("class",`ql-indent-${listItem.indent-1}`),li.innerHTML=listItem.element.innerHTML,ul.appendChild(li)});let element=childListItems[0]?.element,{parentNode}=element??{};element&&parentNode?.replaceChild(ul,element),childListItems.slice(1).forEach(_ref=>{let{element:e}=_ref;parentNode?.removeChild(e)})}};function normalize3(doc){doc.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&normalizeListItem(doc)}var NORMALIZERS=[normalize3,normalize2],normalizeExternalHTML=doc=>{doc.documentElement&&NORMALIZERS.forEach(normalize4=>{normalize4(doc)})},normalizeExternalHTML_default=normalizeExternalHTML;var debug6=logger_default("quill:clipboard"),CLIPBOARD_CONFIG=[[Node.TEXT_NODE,matchText],[Node.TEXT_NODE,matchNewline],["br",matchBreak],[Node.ELEMENT_NODE,matchNewline],[Node.ELEMENT_NODE,matchBlot],[Node.ELEMENT_NODE,matchAttributor],[Node.ELEMENT_NODE,matchStyles],["li",matchIndent],["ol, ul",matchList],["pre",matchCodeBlock],["tr",matchTable],["b",createMatchAlias("bold")],["i",createMatchAlias("italic")],["strike",createMatchAlias("strike")],["style",matchIgnore]],ATTRIBUTE_ATTRIBUTORS=[AlignAttribute,DirectionAttribute].reduce((memo,attr)=>(memo[attr.keyName]=attr,memo),{}),STYLE_ATTRIBUTORS=[AlignStyle,BackgroundStyle,ColorStyle,DirectionStyle,FontStyle,SizeStyle].reduce((memo,attr)=>(memo[attr.keyName]=attr,memo),{}),Clipboard=(()=>{class Clipboard2 extends module_default{constructor(quill,options){super(quill,options),this.quill.root.addEventListener("copy",e=>this.onCaptureCopy(e,!1)),this.quill.root.addEventListener("cut",e=>this.onCaptureCopy(e,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],CLIPBOARD_CONFIG.concat(this.options.matchers??[]).forEach(_ref=>{let[selector,matcher]=_ref;this.addMatcher(selector,matcher)})}addMatcher(selector,matcher){this.matchers.push([selector,matcher])}convert(_ref2){let{html,text}=_ref2,formats=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(formats[CodeBlock.blotName])return new import_quill_delta6.default().insert(text||"",{[CodeBlock.blotName]:formats[CodeBlock.blotName]});if(!html)return new import_quill_delta6.default().insert(text||"",formats);let delta=this.convertHTML(html);return deltaEndsWith(delta,`
28
- `)&&(delta.ops[delta.ops.length-1].attributes==null||formats.table)?delta.compose(new import_quill_delta6.default().retain(delta.length()-1).delete(1)):delta}normalizeHTML(doc){normalizeExternalHTML_default(doc)}convertHTML(html){let doc=new DOMParser().parseFromString(html,"text/html");this.normalizeHTML(doc);let container=doc.body,nodeMatches=new WeakMap,[elementMatchers,textMatchers]=this.prepareMatching(container,nodeMatches);return traverse(this.quill.scroll,container,elementMatchers,textMatchers,nodeMatches)}dangerouslyPasteHTML(index,html){let source=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Quill.sources.API;if(typeof index=="string"){let delta=this.convert({html:index,text:""});this.quill.setContents(delta,html),this.quill.setSelection(0,Quill.sources.SILENT)}else{let paste=this.convert({html,text:""});this.quill.updateContents(new import_quill_delta6.default().retain(index).concat(paste),source),this.quill.setSelection(index+paste.length(),Quill.sources.SILENT)}}onCaptureCopy(e){let isCut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();let[range]=this.quill.selection.getRange();if(range==null)return;let{html,text}=this.onCopy(range,isCut);e.clipboardData?.setData("text/plain",text),e.clipboardData?.setData("text/html",html),isCut&&deleteRange({range,quill:this.quill})}normalizeURIList(urlList){return urlList.split(/\r?\n/).filter(url=>url[0]!=="#").join(`
29
- `)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let range=this.quill.getSelection(!0);if(range==null)return;let html=e.clipboardData?.getData("text/html"),text=e.clipboardData?.getData("text/plain");if(!html&&!text){let urlList=e.clipboardData?.getData("text/uri-list");urlList&&(text=this.normalizeURIList(urlList))}let files=Array.from(e.clipboardData?.files||[]);if(!html&&files.length>0){this.quill.uploader.upload(range,files);return}if(html&&files.length>0){let doc=new DOMParser().parseFromString(html,"text/html");if(doc.body.childElementCount===1&&doc.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(range,files);return}}this.onPaste(range,{html,text})}onCopy(range){let text=this.quill.getText(range);return{html:this.quill.getSemanticHTML(range),text}}onPaste(range,_ref3){let{text,html}=_ref3,formats=this.quill.getFormat(range.index),pastedDelta=this.convert({text,html},formats);debug6.log("onPaste",pastedDelta,{text,html});let delta=new import_quill_delta6.default().retain(range.index).delete(range.length).concat(pastedDelta);this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(delta.length()-range.length,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(container,nodeMatches){let elementMatchers=[],textMatchers=[];return this.matchers.forEach(pair=>{let[selector,matcher]=pair;switch(selector){case Node.TEXT_NODE:textMatchers.push(matcher);break;case Node.ELEMENT_NODE:elementMatchers.push(matcher);break;default:Array.from(container.querySelectorAll(selector)).forEach(node=>{nodeMatches.has(node)?nodeMatches.get(node)?.push(matcher):nodeMatches.set(node,[matcher])});break}}),[elementMatchers,textMatchers]}}return __publicField(Clipboard2,"DEFAULTS",{matchers:[]}),Clipboard2})();function applyFormat(delta,format,value,scroll){return scroll.query(format)?delta.reduce((newDelta,op)=>{if(!op.insert)return newDelta;if(op.attributes&&op.attributes[format])return newDelta.push(op);let formats=value?{[format]:value}:{};return newDelta.insert(op.insert,__spreadValues(__spreadValues({},formats),op.attributes))},new import_quill_delta6.default):delta}function deltaEndsWith(delta,text){let endText="";for(let i=delta.ops.length-1;i>=0&&endText.length<text.length;--i){let op=delta.ops[i];if(typeof op.insert!="string")break;endText=op.insert+endText}return endText.slice(-1*text.length)===text}function isLine2(node,scroll){if(!(node instanceof Element))return!1;let match2=scroll.query(node);return match2&&match2.prototype instanceof EmbedBlot$1?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(node.tagName.toLowerCase())}function isBetweenInlineElements(node,scroll){return node.previousElementSibling&&node.nextElementSibling&&!isLine2(node.previousElementSibling,scroll)&&!isLine2(node.nextElementSibling,scroll)}var preNodes=new WeakMap;function isPre(node){return node==null?!1:(preNodes.has(node)||(node.tagName==="PRE"?preNodes.set(node,!0):preNodes.set(node,isPre(node.parentNode))),preNodes.get(node))}function traverse(scroll,node,elementMatchers,textMatchers,nodeMatches){return node.nodeType===node.TEXT_NODE?textMatchers.reduce((delta,matcher)=>matcher(node,delta,scroll),new import_quill_delta6.default):node.nodeType===node.ELEMENT_NODE?Array.from(node.childNodes||[]).reduce((delta,childNode)=>{let childrenDelta=traverse(scroll,childNode,elementMatchers,textMatchers,nodeMatches);return childNode.nodeType===node.ELEMENT_NODE&&(childrenDelta=elementMatchers.reduce((reducedDelta,matcher)=>matcher(childNode,reducedDelta,scroll),childrenDelta),childrenDelta=(nodeMatches.get(childNode)||[]).reduce((reducedDelta,matcher)=>matcher(childNode,reducedDelta,scroll),childrenDelta)),delta.concat(childrenDelta)},new import_quill_delta6.default):new import_quill_delta6.default}function createMatchAlias(format){return(_node,delta,scroll)=>applyFormat(delta,format,!0,scroll)}function matchAttributor(node,delta,scroll){let attributes=Attributor.keys(node),classes=ClassAttributor$1.keys(node),styles=StyleAttributor$1.keys(node),formats={};return attributes.concat(classes).concat(styles).forEach(name=>{let attr=scroll.query(name,Scope.ATTRIBUTE);attr!=null&&(formats[attr.attrName]=attr.value(node),formats[attr.attrName])||(attr=ATTRIBUTE_ATTRIBUTORS[name],attr!=null&&(attr.attrName===name||attr.keyName===name)&&(formats[attr.attrName]=attr.value(node)||void 0),attr=STYLE_ATTRIBUTORS[name],attr!=null&&(attr.attrName===name||attr.keyName===name)&&(attr=STYLE_ATTRIBUTORS[name],formats[attr.attrName]=attr.value(node)||void 0))}),Object.entries(formats).reduce((newDelta,_ref4)=>{let[name,value]=_ref4;return applyFormat(newDelta,name,value,scroll)},delta)}function matchBlot(node,delta,scroll){let match2=scroll.query(node);if(match2==null)return delta;if(match2.prototype instanceof EmbedBlot$1){let embed={},value=match2.value(node);if(value!=null)return embed[match2.blotName]=value,new import_quill_delta6.default().insert(embed,match2.formats(node,scroll))}else if(match2.prototype instanceof BlockBlot$1&&!deltaEndsWith(delta,`
30
- `)&&delta.insert(`
31
- `),"blotName"in match2&&"formats"in match2&&typeof match2.formats=="function")return applyFormat(delta,match2.blotName,match2.formats(node,scroll),scroll);return delta}function matchBreak(node,delta){return deltaEndsWith(delta,`
32
- `)||delta.insert(`
33
- `),delta}function matchCodeBlock(node,delta,scroll){let match2=scroll.query("code-block"),language=match2&&"formats"in match2&&typeof match2.formats=="function"?match2.formats(node,scroll):!0;return applyFormat(delta,"code-block",language,scroll)}function matchIgnore(){return new import_quill_delta6.default}function matchIndent(node,delta,scroll){let match2=scroll.query(node);if(match2==null||match2.blotName!=="list"||!deltaEndsWith(delta,`
34
- `))return delta;let indent=-1,parent=node.parentNode;for(;parent!=null;)["OL","UL"].includes(parent.tagName)&&(indent+=1),parent=parent.parentNode;return indent<=0?delta:delta.reduce((composed,op)=>op.insert?op.attributes&&typeof op.attributes.indent=="number"?composed.push(op):composed.insert(op.insert,__spreadValues({indent},op.attributes||{})):composed,new import_quill_delta6.default)}function matchList(node,delta,scroll){let element=node,list=element.tagName==="OL"?"ordered":"bullet",checkedAttr=element.getAttribute("data-checked");return checkedAttr&&(list=checkedAttr==="true"?"checked":"unchecked"),applyFormat(delta,"list",list,scroll)}function matchNewline(node,delta,scroll){if(!deltaEndsWith(delta,`
35
- `)){if(isLine2(node,scroll)&&(node.childNodes.length>0||node instanceof HTMLParagraphElement))return delta.insert(`
36
- `);if(delta.length()>0&&node.nextSibling){let nextSibling=node.nextSibling;for(;nextSibling!=null;){if(isLine2(nextSibling,scroll))return delta.insert(`
37
- `);let match2=scroll.query(nextSibling);if(match2&&match2.prototype instanceof BlockEmbed)return delta.insert(`
38
- `);nextSibling=nextSibling.firstChild}}}return delta}function matchStyles(node,delta,scroll){let formats={},style=node.style||{};return style.fontStyle==="italic"&&(formats.italic=!0),style.textDecoration==="underline"&&(formats.underline=!0),style.textDecoration==="line-through"&&(formats.strike=!0),(style.fontWeight?.startsWith("bold")||parseInt(style.fontWeight,10)>=700)&&(formats.bold=!0),delta=Object.entries(formats).reduce((newDelta,_ref5)=>{let[name,value]=_ref5;return applyFormat(newDelta,name,value,scroll)},delta),parseFloat(style.textIndent||0)>0?new import_quill_delta6.default().insert(" ").concat(delta):delta}function matchTable(node,delta,scroll){let table=node.parentElement?.tagName==="TABLE"?node.parentElement:node.parentElement?.parentElement;if(table!=null){let row=Array.from(table.querySelectorAll("tr")).indexOf(node)+1;return applyFormat(delta,"table",row,scroll)}return delta}function matchText(node,delta,scroll){let text=node.data;if(node.parentElement?.tagName==="O:P")return delta.insert(text.trim());if(!isPre(node)){if(text.trim().length===0&&text.includes(`
39
- `)&&!isBetweenInlineElements(node,scroll))return delta;let replacer=(collapse,match2)=>{let replaced=match2.replace(/[^\u00a0]/g,"");return replaced.length<1&&collapse?" ":replaced};text=text.replace(/\r\n/g," ").replace(/\n/g," "),text=text.replace(/\s\s+/g,replacer.bind(replacer,!0)),(node.previousSibling==null&&node.parentElement!=null&&isLine2(node.parentElement,scroll)||node.previousSibling instanceof Element&&isLine2(node.previousSibling,scroll))&&(text=text.replace(/^\s+/,replacer.bind(replacer,!1))),(node.nextSibling==null&&node.parentElement!=null&&isLine2(node.parentElement,scroll)||node.nextSibling instanceof Element&&isLine2(node.nextSibling,scroll))&&(text=text.replace(/\s+$/,replacer.bind(replacer,!1)))}return delta.insert(text)}var History=(()=>{class History2 extends module_default{constructor(quill,options){super(quill,options);__publicField(this,"lastRecorded",0);__publicField(this,"ignoreChange",!1);__publicField(this,"stack",{undo:[],redo:[]});__publicField(this,"currentRange",null);this.quill.on(Quill.events.EDITOR_CHANGE,(eventName,value,oldValue,source)=>{eventName===Quill.events.SELECTION_CHANGE?value&&source!==Quill.sources.SILENT&&(this.currentRange=value):eventName===Quill.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||source===Quill.sources.USER?this.record(value,oldValue):this.transform(value)),this.currentRange=transformRange(this.currentRange,value))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",event=>{event.inputType==="historyUndo"?(this.undo(),event.preventDefault()):event.inputType==="historyRedo"&&(this.redo(),event.preventDefault())})}change(source,dest){if(this.stack[source].length===0)return;let item=this.stack[source].pop();if(!item)return;let base=this.quill.getContents(),inverseDelta=item.delta.invert(base);this.stack[dest].push({delta:inverseDelta,range:transformRange(item.range,inverseDelta)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(item.delta,Quill.sources.USER),this.ignoreChange=!1,this.restoreSelection(item)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(changeDelta,oldDelta){if(changeDelta.ops.length===0)return;this.stack.redo=[];let undoDelta=changeDelta.invert(oldDelta),undoRange=this.currentRange,timestamp=Date.now();if(this.lastRecorded+this.options.delay>timestamp&&this.stack.undo.length>0){let item=this.stack.undo.pop();item&&(undoDelta=undoDelta.compose(item.delta),undoRange=item.range)}else this.lastRecorded=timestamp;undoDelta.length()!==0&&(this.stack.undo.push({delta:undoDelta,range:undoRange}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(delta){transformStack(this.stack.undo,delta),transformStack(this.stack.redo,delta)}undo(){this.change("undo","redo")}restoreSelection(stackItem){if(stackItem.range)this.quill.setSelection(stackItem.range,Quill.sources.USER);else{let index=getLastChangeIndex(this.quill.scroll,stackItem.delta);this.quill.setSelection(index,Quill.sources.USER)}}}return __publicField(History2,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1}),History2})();function transformStack(stack,delta){let remoteDelta=delta;for(let i=stack.length-1;i>=0;i-=1){let oldItem=stack[i];stack[i]={delta:remoteDelta.transform(oldItem.delta,!0),range:oldItem.range&&transformRange(oldItem.range,remoteDelta)},remoteDelta=oldItem.delta.transform(remoteDelta),stack[i].delta.length()===0&&stack.splice(i,1)}}function endsWithNewlineChange(scroll,delta){let lastOp=delta.ops[delta.ops.length-1];return lastOp==null?!1:lastOp.insert!=null?typeof lastOp.insert=="string"&&lastOp.insert.endsWith(`
40
- `):lastOp.attributes!=null?Object.keys(lastOp.attributes).some(attr=>scroll.query(attr,Scope.BLOCK)!=null):!1}function getLastChangeIndex(scroll,delta){let deleteLength=delta.reduce((length,op)=>length+(op.delete||0),0),changeIndex=delta.length()-deleteLength;return endsWithNewlineChange(scroll,delta)&&(changeIndex-=1),changeIndex}function transformRange(range,delta){if(!range)return range;let start=delta.transformPosition(range.index),end=delta.transformPosition(range.index+range.length);return{index:start,length:end-start}}var import_quill_delta7=__toESM(require_Delta(),1);var Uploader=(()=>{class Uploader2 extends module_default{constructor(quill,options){super(quill,options),quill.root.addEventListener("drop",e=>{e.preventDefault();let native=null;if(document.caretRangeFromPoint)native=document.caretRangeFromPoint(e.clientX,e.clientY);else if(document.caretPositionFromPoint){let position=document.caretPositionFromPoint(e.clientX,e.clientY);native=document.createRange(),native.setStart(position.offsetNode,position.offset),native.setEnd(position.offsetNode,position.offset)}let normalized=native&&quill.selection.normalizeNative(native);if(normalized){let range=quill.selection.normalizedToRange(normalized);e.dataTransfer?.files&&this.upload(range,e.dataTransfer.files)}})}upload(range,files){let uploads=[];Array.from(files).forEach(file=>{file&&this.options.mimetypes?.includes(file.type)&&uploads.push(file)}),uploads.length>0&&this.options.handler.call(this,range,uploads)}}return Uploader2.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(range,files){if(!this.quill.scroll.query("image"))return;let promises=files.map(file=>new Promise(resolve=>{let reader=new FileReader;reader.onload=()=>{resolve(reader.result)},reader.readAsDataURL(file)}));Promise.all(promises).then(images=>{let update=images.reduce((delta,image)=>delta.insert({image}),new import_quill_delta7.default().retain(range.index).delete(range.length));this.quill.updateContents(update,emitter_default.sources.USER),this.quill.setSelection(range.index+images.length,emitter_default.sources.SILENT)})}},Uploader2})(),uploader_default=Uploader;var import_quill_delta9=__toESM(require_Delta(),1);var import_quill_delta8=__toESM(require_Delta(),1);var INSERT_TYPES=["insertText","insertReplacementText"],Input=class extends module_default{constructor(quill,options){super(quill,options),quill.root.addEventListener("beforeinput",event=>{this.handleBeforeInput(event)}),/Android/i.test(navigator.userAgent)||quill.on(Quill.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(range){deleteRange({range,quill:this.quill})}replaceText(range){let text=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(range.length===0)return!1;if(text){let formats=this.quill.getFormat(range.index,1);this.deleteRange(range),this.quill.updateContents(new import_quill_delta8.default().retain(range.index).insert(text,formats),Quill.sources.USER)}else this.deleteRange(range);return this.quill.setSelection(range.index+text.length,0,Quill.sources.SILENT),!0}handleBeforeInput(event){if(this.quill.composition.isComposing||event.defaultPrevented||!INSERT_TYPES.includes(event.inputType))return;let staticRange=event.getTargetRanges?event.getTargetRanges()[0]:null;if(!staticRange||staticRange.collapsed===!0)return;let text=getPlainTextFromInputEvent(event);if(text==null)return;let normalized=this.quill.selection.normalizeNative(staticRange),range=normalized?this.quill.selection.normalizedToRange(normalized):null;range&&this.replaceText(range,text)&&event.preventDefault()}handleCompositionStart(){let range=this.quill.getSelection();range&&this.replaceText(range)}};function getPlainTextFromInputEvent(event){return typeof event.data=="string"?event.data:event.dataTransfer?.types.includes("text/plain")?event.dataTransfer.getData("text/plain"):null}var input_default=Input;var isMac=/Mac/i.test(navigator.platform),TTL_FOR_VALID_SELECTION_CHANGE=100,canMoveCaretBeforeUINode=event=>!!(event.key==="ArrowLeft"||event.key==="ArrowRight"||event.key==="ArrowUp"||event.key==="ArrowDown"||event.key==="Home"||isMac&&event.key==="a"&&event.ctrlKey===!0),UINode=class extends module_default{constructor(quill,options){super(quill,options);__publicField(this,"isListening",!1);__publicField(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(range,_ref){let{line,event}=_ref;if(!(line instanceof ParentBlot$1)||!line.uiNode)return!0;let isRTL=getComputedStyle(line.domNode).direction==="rtl";return isRTL&&event.key!=="ArrowRight"||!isRTL&&event.key!=="ArrowLeft"?!0:(this.quill.setSelection(range.index-1,range.length+(event.shiftKey?1:0),Quill.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",event=>{!event.defaultPrevented&&canMoveCaretBeforeUINode(event)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+TTL_FOR_VALID_SELECTION_CHANGE,this.isListening)return;this.isListening=!0;let listener=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",listener,{once:!0})}handleSelectionChange(){let selection=document.getSelection();if(!selection)return;let range=selection.getRangeAt(0);if(range.collapsed!==!0||range.startOffset!==0)return;let line=this.quill.scroll.find(range.startContainer);if(!(line instanceof ParentBlot$1)||!line.uiNode)return;let newRange=document.createRange();newRange.setStartAfter(line.uiNode),newRange.setEndAfter(line.uiNode),selection.removeAllRanges(),selection.addRange(newRange)}},uiNode_default=UINode;Quill.register({"blots/block":Block,"blots/block/embed":BlockEmbed,"blots/break":break_default,"blots/container":container_default,"blots/cursor":cursor_default,"blots/embed":embed_default,"blots/inline":inline_default,"blots/scroll":scroll_default,"blots/text":Text2,"modules/clipboard":Clipboard,"modules/history":History,"modules/keyboard":Keyboard,"modules/uploader":uploader_default,"modules/input":input_default,"modules/uiNode":uiNode_default});var core_default=Quill;var IndentAttributor=class extends ClassAttributor$1{add(node,value){let normalizedValue=0;if(value==="+1"||value==="-1"){let indent=this.value(node)||0;normalizedValue=value==="+1"?indent+1:indent-1}else typeof value=="number"&&(normalizedValue=value);return normalizedValue===0?(this.remove(node),!0):super.add(node,normalizedValue.toString())}canAdd(node,value){return super.canAdd(node,value)||super.canAdd(node,parseInt(value,10))}value(node){return parseInt(super.value(node),10)||void 0}},IndentClass=new IndentAttributor("indent","ql-indent",{scope:Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),indent_default=IndentClass;var Blockquote=(()=>{class Blockquote2 extends Block{}return __publicField(Blockquote2,"blotName","blockquote"),__publicField(Blockquote2,"tagName","blockquote"),Blockquote2})(),blockquote_default=Blockquote;var Header=(()=>{class Header2 extends Block{static formats(domNode){return this.tagName.indexOf(domNode.tagName)+1}}return __publicField(Header2,"blotName","header"),__publicField(Header2,"tagName",["H1","H2","H3","H4","H5","H6"]),Header2})(),header_default=Header;var ListContainer=(()=>{class ListContainer2 extends container_default{}return ListContainer2.blotName="list-container",ListContainer2.tagName="OL",ListContainer2})(),ListItem=(()=>{class ListItem2 extends Block{static create(value){let node=super.create();return node.setAttribute("data-list",value),node}static formats(domNode){return domNode.getAttribute("data-list")||void 0}static register(){Quill.register(ListContainer)}constructor(scroll,domNode){super(scroll,domNode);let ui=domNode.ownerDocument.createElement("span"),listEventHandler=e=>{if(!scroll.isEnabled())return;let format=this.statics.formats(domNode,scroll);format==="checked"?(this.format("list","unchecked"),e.preventDefault()):format==="unchecked"&&(this.format("list","checked"),e.preventDefault())};ui.addEventListener("mousedown",listEventHandler),ui.addEventListener("touchstart",listEventHandler),this.attachUI(ui)}format(name,value){name===this.statics.blotName&&value?this.domNode.setAttribute("data-list",value):super.format(name,value)}}return ListItem2.blotName="list",ListItem2.tagName="LI",ListItem2})();ListContainer.allowedChildren=[ListItem];ListItem.requiredContainer=ListContainer;var Bold=(()=>{class Bold2 extends inline_default{static create(){return super.create()}static formats(){return!0}optimize(context){super.optimize(context),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}return __publicField(Bold2,"blotName","bold"),__publicField(Bold2,"tagName",["STRONG","B"]),Bold2})(),bold_default=Bold;var Italic=(()=>{class Italic2 extends bold_default{}return __publicField(Italic2,"blotName","italic"),__publicField(Italic2,"tagName",["EM","I"]),Italic2})(),italic_default=Italic;var Link=(()=>{class Link2 extends inline_default{static create(value){let node=super.create(value);return node.setAttribute("href",this.sanitize(value)),node.setAttribute("rel","noopener noreferrer"),node.setAttribute("target","_blank"),node}static formats(domNode){return domNode.getAttribute("href")}static sanitize(url){return sanitize(url,this.PROTOCOL_WHITELIST)?url:this.SANITIZED_URL}format(name,value){name!==this.statics.blotName||!value?super.format(name,value):this.domNode.setAttribute("href",this.constructor.sanitize(value))}}return __publicField(Link2,"blotName","link"),__publicField(Link2,"tagName","A"),__publicField(Link2,"SANITIZED_URL","about:blank"),__publicField(Link2,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]),Link2})();function sanitize(url,protocols){let anchor=document.createElement("a");anchor.href=url;let protocol=anchor.href.slice(0,anchor.href.indexOf(":"));return protocols.indexOf(protocol)>-1}var Script=(()=>{class Script2 extends inline_default{static create(value){return value==="super"?document.createElement("sup"):value==="sub"?document.createElement("sub"):super.create(value)}static formats(domNode){if(domNode.tagName==="SUB")return"sub";if(domNode.tagName==="SUP")return"super"}}return __publicField(Script2,"blotName","script"),__publicField(Script2,"tagName",["SUB","SUP"]),Script2})(),script_default=Script;var Strike=(()=>{class Strike2 extends bold_default{}return __publicField(Strike2,"blotName","strike"),__publicField(Strike2,"tagName",["S","STRIKE"]),Strike2})(),strike_default=Strike;var Underline=(()=>{class Underline2 extends inline_default{}return __publicField(Underline2,"blotName","underline"),__publicField(Underline2,"tagName","U"),Underline2})(),underline_default=Underline;var Formula=(()=>{class Formula2 extends embed_default{static create(value){if(window.katex==null)throw new Error("Formula module requires KaTeX.");let node=super.create(value);return typeof value=="string"&&(window.katex.render(value,node,{throwOnError:!1,errorColor:"#f00"}),node.setAttribute("data-value",value)),node}static value(domNode){return domNode.getAttribute("data-value")}html(){let{formula}=this.value();return`<span>${formula}</span>`}}return __publicField(Formula2,"blotName","formula"),__publicField(Formula2,"className","ql-formula"),__publicField(Formula2,"tagName","SPAN"),Formula2})(),formula_default=Formula;var ATTRIBUTES=["alt","height","width"],Image=(()=>{class Image2 extends EmbedBlot$1{static create(value){let node=super.create(value);return typeof value=="string"&&node.setAttribute("src",this.sanitize(value)),node}static formats(domNode){return ATTRIBUTES.reduce((formats,attribute)=>(domNode.hasAttribute(attribute)&&(formats[attribute]=domNode.getAttribute(attribute)),formats),{})}static match(url){return/\.(jpe?g|gif|png)$/.test(url)||/^data:image\/.+;base64/.test(url)}static sanitize(url){return sanitize(url,["http","https","data"])?url:"//:0"}static value(domNode){return domNode.getAttribute("src")}format(name,value){ATTRIBUTES.indexOf(name)>-1?value?this.domNode.setAttribute(name,value):this.domNode.removeAttribute(name):super.format(name,value)}}return __publicField(Image2,"blotName","image"),__publicField(Image2,"tagName","IMG"),Image2})(),image_default=Image;var ATTRIBUTES2=["height","width"],Video=(()=>{class Video2 extends BlockEmbed{static create(value){let node=super.create(value);return node.setAttribute("frameborder","0"),node.setAttribute("allowfullscreen","true"),node.setAttribute("src",this.sanitize(value)),node}static formats(domNode){return ATTRIBUTES2.reduce((formats,attribute)=>(domNode.hasAttribute(attribute)&&(formats[attribute]=domNode.getAttribute(attribute)),formats),{})}static sanitize(url){return Link.sanitize(url)}static value(domNode){return domNode.getAttribute("src")}format(name,value){ATTRIBUTES2.indexOf(name)>-1?value?this.domNode.setAttribute(name,value):this.domNode.removeAttribute(name):super.format(name,value)}html(){let{video}=this.value();return`<a href="${video}">${video}</a>`}}return __publicField(Video2,"blotName","video"),__publicField(Video2,"className","ql-video"),__publicField(Video2,"tagName","IFRAME"),Video2})(),video_default=Video;var import_quill_delta10=__toESM(require_Delta(),1);var TokenAttributor=new ClassAttributor$1("code-token","hljs",{scope:Scope.INLINE}),CodeToken=(()=>{class CodeToken2 extends inline_default{static formats(node,scroll){for(;node!=null&&node!==scroll.domNode;){if(node.classList&&node.classList.contains(CodeBlock.className))return super.formats(node,scroll);node=node.parentNode}}constructor(scroll,domNode,value){super(scroll,domNode,value),TokenAttributor.add(this.domNode,value)}format(format,value){format!==CodeToken2.blotName?super.format(format,value):value?TokenAttributor.add(this.domNode,value):(TokenAttributor.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),TokenAttributor.value(this.domNode)||this.unwrap()}}return CodeToken2.blotName="code-token",CodeToken2.className="ql-token",CodeToken2})(),SyntaxCodeBlock=class extends CodeBlock{static create(value){let domNode=super.create(value);return typeof value=="string"&&domNode.setAttribute("data-language",value),domNode}static formats(domNode){return domNode.getAttribute("data-language")||"plain"}static register(){}format(name,value){name===this.statics.blotName&&value?this.domNode.setAttribute("data-language",value):super.format(name,value)}replaceWith(name,value){return this.formatAt(0,this.length(),CodeToken.blotName,!1),super.replaceWith(name,value)}},SyntaxCodeBlockContainer=(()=>{class SyntaxCodeBlockContainer2 extends CodeBlockContainer{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(name,value){name===SyntaxCodeBlock.blotName&&(this.forceNext=!0,this.children.forEach(child=>{child.format(name,value)}))}formatAt(index,length,name,value){name===SyntaxCodeBlock.blotName&&(this.forceNext=!0),super.formatAt(index,length,name,value)}highlight(highlight2){let forced=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;let text=`${Array.from(this.domNode.childNodes).filter(node=>node!==this.uiNode).map(node=>node.textContent).join(`
41
- `)}
42
- `,language=SyntaxCodeBlock.formats(this.children.head.domNode);if(forced||this.forceNext||this.cachedText!==text){if(text.trim().length>0||this.cachedText==null){let oldDelta=this.children.reduce((delta2,child)=>delta2.concat(blockDelta(child,!1)),new import_quill_delta10.default),delta=highlight2(text,language);oldDelta.diff(delta).reduce((index,_ref)=>{let{retain,attributes}=_ref;return retain?(attributes&&Object.keys(attributes).forEach(format=>{[SyntaxCodeBlock.blotName,CodeToken.blotName].includes(format)&&this.formatAt(index,retain,format,attributes[format])}),index+retain):index},0)}this.cachedText=text,this.forceNext=!1}}html(index,length){let[codeBlock]=this.children.find(index);return`<pre data-language="${codeBlock?SyntaxCodeBlock.formats(codeBlock.domNode):"plain"}">
43
- ${escapeText(this.code(index,length))}
44
- </pre>`}optimize(context){if(super.optimize(context),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let language=SyntaxCodeBlock.formats(this.children.head.domNode);language!==this.uiNode.value&&(this.uiNode.value=language)}}}return SyntaxCodeBlockContainer2.allowedChildren=[SyntaxCodeBlock],SyntaxCodeBlockContainer2})();SyntaxCodeBlock.requiredContainer=SyntaxCodeBlockContainer;SyntaxCodeBlock.allowedChildren=[CodeToken,cursor_default,Text2,break_default];var highlight=(lib,language,text)=>{if(typeof lib.versionString=="string"){let majorVersion=lib.versionString.split(".")[0];if(parseInt(majorVersion,10)>=11)return lib.highlight(text,{language}).value}return lib.highlight(language,text).value},Syntax=class extends module_default{static register(){Quill.register(CodeToken,!0),Quill.register(SyntaxCodeBlock,!0),Quill.register(SyntaxCodeBlockContainer,!0)}constructor(quill,options){if(super(quill,options),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((memo,_ref2)=>{let{key}=_ref2;return memo[key]=!0,memo},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Quill.events.SCROLL_BLOT_MOUNT,blot=>{if(!(blot instanceof SyntaxCodeBlockContainer))return;let select=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(_ref3=>{let{key,label}=_ref3,option=select.ownerDocument.createElement("option");option.textContent=label,option.setAttribute("value",key),select.appendChild(option)}),select.addEventListener("change",()=>{blot.format(SyntaxCodeBlock.blotName,select.value),this.quill.root.focus(),this.highlight(blot,!0)}),blot.uiNode==null&&(blot.attachUI(select),blot.children.head&&(select.value=SyntaxCodeBlock.formats(blot.children.head.domNode)))})}initTimer(){let timer=null;this.quill.on(Quill.events.SCROLL_OPTIMIZE,()=>{timer&&clearTimeout(timer),timer=setTimeout(()=>{this.highlight(),timer=null},this.options.interval)})}highlight(){let blot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,force=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(Quill.sources.USER);let range=this.quill.getSelection();(blot==null?this.quill.scroll.descendants(SyntaxCodeBlockContainer):[blot]).forEach(container=>{container.highlight(this.highlightBlot,force)}),this.quill.update(Quill.sources.SILENT),range!=null&&this.quill.setSelection(range,Quill.sources.SILENT)}highlightBlot(text){let language=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(language=this.languages[language]?language:"plain",language==="plain")return escapeText(text).split(`
45
- `).reduce((delta,line,i)=>(i!==0&&delta.insert(`
46
- `,{[CodeBlock.blotName]:language}),delta.insert(line)),new import_quill_delta10.default);let container=this.quill.root.ownerDocument.createElement("div");return container.classList.add(CodeBlock.className),container.innerHTML=highlight(this.options.hljs,language,text),traverse(this.quill.scroll,container,[(node,delta)=>{let value=TokenAttributor.value(node);return value?delta.compose(new import_quill_delta10.default().retain(delta.length(),{[CodeToken.blotName]:value})):delta}],[(node,delta)=>node.data.split(`
47
- `).reduce((memo,nodeText,i)=>(i!==0&&memo.insert(`
48
- `,{[CodeBlock.blotName]:language}),memo.insert(nodeText)),delta)],new WeakMap)}};Syntax.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};var import_quill_delta11=__toESM(require_Delta(),1);var TableCell=(()=>{let _TableCell=class _TableCell extends Block{static create(value){let node=super.create();return value?node.setAttribute("data-row",value):node.setAttribute("data-row",tableId()),node}static formats(domNode){if(domNode.hasAttribute("data-row"))return domNode.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(name,value){name===_TableCell.blotName&&value?this.domNode.setAttribute("data-row",value):super.format(name,value)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};__publicField(_TableCell,"blotName","table"),__publicField(_TableCell,"tagName","TD");let TableCell2=_TableCell;return TableCell2})(),TableRow=(()=>{class TableRow2 extends container_default{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let thisHead=this.children.head.formats(),thisTail=this.children.tail.formats(),nextHead=this.next.children.head.formats(),nextTail=this.next.children.tail.formats();return thisHead.table===thisTail.table&&thisHead.table===nextHead.table&&thisHead.table===nextTail.table}return!1}optimize(context){super.optimize(context),this.children.forEach(child=>{if(child.next==null)return;let childFormats=child.formats(),nextFormats=child.next.formats();if(childFormats.table!==nextFormats.table){let next=this.splitAfter(child);next&&next.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}return __publicField(TableRow2,"blotName","table-row"),__publicField(TableRow2,"tagName","TR"),TableRow2})(),TableBody=(()=>{class TableBody2 extends container_default{}return __publicField(TableBody2,"blotName","table-body"),__publicField(TableBody2,"tagName","TBODY"),TableBody2})(),TableContainer=(()=>{class TableContainer2 extends container_default{balanceCells(){let rows=this.descendants(TableRow),maxColumns=rows.reduce((max,row)=>Math.max(row.children.length,max),0);rows.forEach(row=>{new Array(maxColumns-row.children.length).fill(0).forEach(()=>{let value;row.children.head!=null&&(value=TableCell.formats(row.children.head.domNode));let blot=this.scroll.create(TableCell.blotName,value);row.appendChild(blot),blot.optimize()})})}cells(column){return this.rows().map(row=>row.children.at(column))}deleteColumn(index){let[body]=this.descendant(TableBody);body==null||body.children.head==null||body.children.forEach(row=>{let cell=row.children.at(index);cell?.remove()})}insertColumn(index){let[body]=this.descendant(TableBody);body==null||body.children.head==null||body.children.forEach(row=>{let ref=row.children.at(index),value=TableCell.formats(row.children.head.domNode),cell=this.scroll.create(TableCell.blotName,value);row.insertBefore(cell,ref)})}insertRow(index){let[body]=this.descendant(TableBody);if(body==null||body.children.head==null)return;let id=tableId(),row=this.scroll.create(TableRow.blotName);body.children.head.children.forEach(()=>{let cell=this.scroll.create(TableCell.blotName,id);row.appendChild(cell)});let ref=body.children.at(index);body.insertBefore(row,ref)}rows(){let body=this.children.head;return body==null?[]:body.children.map(row=>row)}}return __publicField(TableContainer2,"blotName","table-container"),__publicField(TableContainer2,"tagName","TABLE"),TableContainer2.allowedChildren=[TableBody],TableContainer2})();TableBody.requiredContainer=TableContainer;TableBody.allowedChildren=[TableRow];TableRow.requiredContainer=TableBody;TableRow.allowedChildren=[TableCell];TableCell.requiredContainer=TableRow;function tableId(){return`row-${Math.random().toString(36).slice(2,6)}`}var Table=class extends module_default{static register(){Quill.register(TableCell),Quill.register(TableRow),Quill.register(TableBody),Quill.register(TableContainer)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(TableContainer).forEach(table=>{table.balanceCells()})}deleteColumn(){let[table,,cell]=this.getTable();cell!=null&&(table.deleteColumn(cell.cellOffset()),this.quill.update(Quill.sources.USER))}deleteRow(){let[,row]=this.getTable();row!=null&&(row.remove(),this.quill.update(Quill.sources.USER))}deleteTable(){let[table]=this.getTable();if(table==null)return;let offset=table.offset();table.remove(),this.quill.update(Quill.sources.USER),this.quill.setSelection(offset,Quill.sources.SILENT)}getTable(){let range=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(range==null)return[null,null,null,-1];let[cell,offset]=this.quill.getLine(range.index);if(cell==null||cell.statics.blotName!==TableCell.blotName)return[null,null,null,-1];let row=cell.parent;return[row.parent.parent,row,cell,offset]}insertColumn(offset){let range=this.quill.getSelection();if(!range)return;let[table,row,cell]=this.getTable(range);if(cell==null)return;let column=cell.cellOffset();table.insertColumn(column+offset),this.quill.update(Quill.sources.USER);let shift=row.rowOffset();offset===0&&(shift+=1),this.quill.setSelection(range.index+shift,range.length,Quill.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(offset){let range=this.quill.getSelection();if(!range)return;let[table,row,cell]=this.getTable(range);if(cell==null)return;let index=row.rowOffset();table.insertRow(index+offset),this.quill.update(Quill.sources.USER),offset>0?this.quill.setSelection(range,Quill.sources.SILENT):this.quill.setSelection(range.index+row.children.length,range.length,Quill.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(rows,columns){let range=this.quill.getSelection();if(range==null)return;let delta=new Array(rows).fill(0).reduce(memo=>{let text=new Array(columns).fill(`
49
- `).join("");return memo.insert(text,{table:tableId()})},new import_quill_delta11.default().retain(range.index));this.quill.updateContents(delta,Quill.sources.USER),this.quill.setSelection(range.index,Quill.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Quill.events.SCROLL_OPTIMIZE,mutations=>{mutations.some(mutation=>["TD","TR","TBODY","TABLE"].includes(mutation.target.tagName)?(this.quill.once(Quill.events.TEXT_CHANGE,(delta,old,source)=>{source===Quill.sources.USER&&this.balanceTables()}),!0):!1)})}},table_default=Table;var import_quill_delta12=__toESM(require_Delta(),1);var debug7=logger_default("quill:toolbar"),Toolbar=(()=>{class Toolbar2 extends module_default{constructor(quill,options){if(super(quill,options),Array.isArray(this.options.container)){let container=document.createElement("div");container.setAttribute("role","toolbar"),addControls(container,this.options.container),quill.container?.parentNode?.insertBefore(container,quill.container),this.container=container}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){debug7.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(format=>{let handler=this.options.handlers?.[format];handler&&this.addHandler(format,handler)}),Array.from(this.container.querySelectorAll("button, select")).forEach(input=>{this.attach(input)}),this.quill.on(Quill.events.EDITOR_CHANGE,()=>{let[range]=this.quill.selection.getRange();this.update(range)})}addHandler(format,handler){this.handlers[format]=handler}attach(input){let format=Array.from(input.classList).find(className=>className.indexOf("ql-")===0);if(!format)return;if(format=format.slice(3),input.tagName==="BUTTON"&&input.setAttribute("type","button"),this.handlers[format]==null&&this.quill.scroll.query(format)==null){debug7.warn("ignoring attaching to nonexistent format",format,input);return}let eventName=input.tagName==="SELECT"?"change":"click";input.addEventListener(eventName,e=>{let value;if(input.tagName==="SELECT"){if(input.selectedIndex<0)return;let selected=input.options[input.selectedIndex];selected.hasAttribute("selected")?value=!1:value=selected.value||!1}else input.classList.contains("ql-active")?value=!1:value=input.value||!input.hasAttribute("value"),e.preventDefault();this.quill.focus();let[range]=this.quill.selection.getRange();if(this.handlers[format]!=null)this.handlers[format].call(this,value);else if(this.quill.scroll.query(format).prototype instanceof EmbedBlot$1){if(value=prompt(`Enter ${format}`),!value)return;this.quill.updateContents(new import_quill_delta12.default().retain(range.index).delete(range.length).insert({[format]:value}),Quill.sources.USER)}else this.quill.format(format,value,Quill.sources.USER);this.update(range)}),this.controls.push([format,input])}update(range){let formats=range==null?{}:this.quill.getFormat(range);this.controls.forEach(pair=>{let[format,input]=pair;if(input.tagName==="SELECT"){let option=null;if(range==null)option=null;else if(formats[format]==null)option=input.querySelector("option[selected]");else if(!Array.isArray(formats[format])){let value=formats[format];typeof value=="string"&&(value=value.replace(/"/g,'\\"')),option=input.querySelector(`option[value="${value}"]`)}option==null?(input.value="",input.selectedIndex=-1):option.selected=!0}else if(range==null)input.classList.remove("ql-active"),input.setAttribute("aria-pressed","false");else if(input.hasAttribute("value")){let value=formats[format],isActive=value===input.getAttribute("value")||value!=null&&value.toString()===input.getAttribute("value")||value==null&&!input.getAttribute("value");input.classList.toggle("ql-active",isActive),input.setAttribute("aria-pressed",isActive.toString())}else{let isActive=formats[format]!=null;input.classList.toggle("ql-active",isActive),input.setAttribute("aria-pressed",isActive.toString())}})}}return Toolbar2.DEFAULTS={},Toolbar2})();function addButton(container,format,value){let input=document.createElement("button");input.setAttribute("type","button"),input.classList.add(`ql-${format}`),input.setAttribute("aria-pressed","false"),value!=null?(input.value=value,input.setAttribute("aria-label",`${format}: ${value}`)):input.setAttribute("aria-label",format),container.appendChild(input)}function addControls(container,groups){Array.isArray(groups[0])||(groups=[groups]),groups.forEach(controls=>{let group=document.createElement("span");group.classList.add("ql-formats"),controls.forEach(control=>{if(typeof control=="string")addButton(group,control);else{let format=Object.keys(control)[0],value=control[format];Array.isArray(value)?addSelect(group,format,value):addButton(group,format,value)}}),container.appendChild(group)})}function addSelect(container,format,values){let input=document.createElement("select");input.classList.add(`ql-${format}`),values.forEach(value=>{let option=document.createElement("option");value!==!1?option.setAttribute("value",String(value)):option.setAttribute("selected","selected"),input.appendChild(option)}),container.appendChild(input)}Toolbar.DEFAULTS={container:null,handlers:{clean(){let range=this.quill.getSelection();if(range!=null)if(range.length===0){let formats=this.quill.getFormat();Object.keys(formats).forEach(name=>{this.quill.scroll.query(name,Scope.INLINE)!=null&&this.quill.format(name,!1,Quill.sources.USER)})}else this.quill.removeFormat(range.index,range.length,Quill.sources.USER)},direction(value){let{align}=this.quill.getFormat();value==="rtl"&&align==null?this.quill.format("align","right",Quill.sources.USER):!value&&align==="right"&&this.quill.format("align",!1,Quill.sources.USER),this.quill.format("direction",value,Quill.sources.USER)},indent(value){let range=this.quill.getSelection(),formats=this.quill.getFormat(range),indent=parseInt(formats.indent||0,10);if(value==="+1"||value==="-1"){let modifier=value==="+1"?1:-1;formats.direction==="rtl"&&(modifier*=-1),this.quill.format("indent",indent+modifier,Quill.sources.USER)}},link(value){value===!0&&(value=prompt("Enter link URL:")),this.quill.format("link",value,Quill.sources.USER)},list(value){let range=this.quill.getSelection(),formats=this.quill.getFormat(range);value==="check"?formats.list==="checked"||formats.list==="unchecked"?this.quill.format("list",!1,Quill.sources.USER):this.quill.format("list","unchecked",Quill.sources.USER):this.quill.format("list",value,Quill.sources.USER)}}};var alignLeftIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',alignCenterIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',alignRightIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',alignJustifyIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',backgroundIcon='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',blockquoteIcon='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',boldIcon='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',cleanIcon='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',codeIcon='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',colorIcon='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',directionLeftToRightIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',directionRightToLeftIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',formulaIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',headerIcon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',header2Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header3Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header4Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',header5Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header6Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',italicIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',imageIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indentIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',outdentIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',linkIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',listBulletIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',listCheckIcon='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',listOrderedIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',subscriptIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',superscriptIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',strikeIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',tableIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underlineIcon='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',videoIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',icons_default={align:{"":alignLeftIcon,center:alignCenterIcon,right:alignRightIcon,justify:alignJustifyIcon},background:backgroundIcon,blockquote:blockquoteIcon,bold:boldIcon,clean:cleanIcon,code:codeIcon,"code-block":codeIcon,color:colorIcon,direction:{"":directionLeftToRightIcon,rtl:directionRightToLeftIcon},formula:formulaIcon,header:{1:headerIcon,2:header2Icon,3:header3Icon,4:header4Icon,5:header5Icon,6:header6Icon},italic:italicIcon,image:imageIcon,indent:{"+1":indentIcon,"-1":outdentIcon},link:linkIcon,list:{bullet:listBulletIcon,check:listCheckIcon,ordered:listOrderedIcon},script:{sub:subscriptIcon,super:superscriptIcon},strike:strikeIcon,table:tableIcon,underline:underlineIcon,video:videoIcon};var DropdownIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>',optionsCounter=0;function toggleAriaAttribute(element,attribute){element.setAttribute(attribute,`${element.getAttribute(attribute)!=="true"}`)}var Picker=class{constructor(select){this.select=select,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",event=>{switch(event.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),event.preventDefault();break;default:}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),toggleAriaAttribute(this.label,"aria-expanded"),toggleAriaAttribute(this.options,"aria-hidden")}buildItem(option){let item=document.createElement("span");item.tabIndex="0",item.setAttribute("role","button"),item.classList.add("ql-picker-item");let value=option.getAttribute("value");return value&&item.setAttribute("data-value",value),option.textContent&&item.setAttribute("data-label",option.textContent),item.addEventListener("click",()=>{this.selectItem(item,!0)}),item.addEventListener("keydown",event=>{switch(event.key){case"Enter":this.selectItem(item,!0),event.preventDefault();break;case"Escape":this.escape(),event.preventDefault();break;default:}}),item}buildLabel(){let label=document.createElement("span");return label.classList.add("ql-picker-label"),label.innerHTML=DropdownIcon,label.tabIndex="0",label.setAttribute("role","button"),label.setAttribute("aria-expanded","false"),this.container.appendChild(label),label}buildOptions(){let options=document.createElement("span");options.classList.add("ql-picker-options"),options.setAttribute("aria-hidden","true"),options.tabIndex="-1",options.id=`ql-picker-options-${optionsCounter}`,optionsCounter+=1,this.label.setAttribute("aria-controls",options.id),this.options=options,Array.from(this.select.options).forEach(option=>{let item=this.buildItem(option);options.appendChild(item),option.selected===!0&&this.selectItem(item)}),this.container.appendChild(options)}buildPicker(){Array.from(this.select.attributes).forEach(item=>{this.container.setAttribute(item.name,item.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(item){let trigger=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,selected=this.container.querySelector(".ql-selected");item!==selected&&(selected?.classList.remove("ql-selected"),item!=null&&(item.classList.add("ql-selected"),this.select.selectedIndex=Array.from(item.parentNode.children).indexOf(item),item.hasAttribute("data-value")?this.label.setAttribute("data-value",item.getAttribute("data-value")):this.label.removeAttribute("data-value"),item.hasAttribute("data-label")?this.label.setAttribute("data-label",item.getAttribute("data-label")):this.label.removeAttribute("data-label"),trigger&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let option;if(this.select.selectedIndex>-1){let item=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];option=this.select.options[this.select.selectedIndex],this.selectItem(item)}else this.selectItem(null);let isActive=option!=null&&option!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",isActive)}},picker_default=Picker;var ColorPicker=class extends picker_default{constructor(select,label){super(select),this.label.innerHTML=label,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(item=>{item.classList.add("ql-primary")})}buildItem(option){let item=super.buildItem(option);return item.style.backgroundColor=option.getAttribute("value")||"",item}selectItem(item,trigger){super.selectItem(item,trigger);let colorLabel=this.label.querySelector(".ql-color-label"),value=item&&item.getAttribute("data-value")||"";colorLabel&&(colorLabel.tagName==="line"?colorLabel.style.stroke=value:colorLabel.style.fill=value)}},color_picker_default=ColorPicker;var IconPicker=class extends picker_default{constructor(select,icons){super(select),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(item=>{item.innerHTML=icons[item.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(target,trigger){super.selectItem(target,trigger);let item=target||this.defaultItem;if(item!=null){if(this.label.innerHTML===item.innerHTML)return;this.label.innerHTML=item.innerHTML}}},icon_picker_default=IconPicker;var isScrollable=el=>{let{overflowY}=getComputedStyle(el,null);return overflowY!=="visible"&&overflowY!=="clip"},Tooltip=class{constructor(quill,boundsContainer){this.quill=quill,this.boundsContainer=boundsContainer||document.body,this.root=quill.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,isScrollable(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(reference){let left=reference.left+reference.width/2-this.root.offsetWidth/2,top=reference.bottom+this.quill.root.scrollTop;this.root.style.left=`${left}px`,this.root.style.top=`${top}px`,this.root.classList.remove("ql-flip");let containerBounds=this.boundsContainer.getBoundingClientRect(),rootBounds=this.root.getBoundingClientRect(),shift=0;if(rootBounds.right>containerBounds.right&&(shift=containerBounds.right-rootBounds.right,this.root.style.left=`${left+shift}px`),rootBounds.left<containerBounds.left&&(shift=containerBounds.left-rootBounds.left,this.root.style.left=`${left+shift}px`),rootBounds.bottom>containerBounds.bottom){let height=rootBounds.bottom-rootBounds.top,verticalShift=reference.bottom-reference.top+height;this.root.style.top=`${top-verticalShift}px`,this.root.classList.add("ql-flip")}return shift}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}},tooltip_default=Tooltip;var ALIGNS=[!1,"center","right","justify"],COLORS=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],FONTS=[!1,"serif","monospace"],HEADERS=["1","2","3",!1],SIZES=["small",!1,"large","huge"],BaseTheme=class extends theme_default{constructor(quill,options){super(quill,options);let listener=e=>{if(!document.body.contains(quill.root)){document.body.removeEventListener("click",listener);return}this.tooltip!=null&&!this.tooltip.root.contains(e.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(picker=>{picker.container.contains(e.target)||picker.close()})};quill.emitter.listenDOM("click",document.body,listener)}addModule(name){let module=super.addModule(name);return name==="toolbar"&&this.extendToolbar(module),module}buildButtons(buttons,icons){Array.from(buttons).forEach(button=>{(button.getAttribute("class")||"").split(/\s+/).forEach(name=>{if(name.startsWith("ql-")&&(name=name.slice(3),icons[name]!=null))if(name==="direction")button.innerHTML=icons[name][""]+icons[name].rtl;else if(typeof icons[name]=="string")button.innerHTML=icons[name];else{let value=button.value||"";value!=null&&icons[name][value]&&(button.innerHTML=icons[name][value])}})})}buildPickers(selects,icons){this.pickers=Array.from(selects).map(select=>{if(select.classList.contains("ql-align")&&(select.querySelector("option")==null&&fillSelect(select,ALIGNS),typeof icons.align=="object"))return new icon_picker_default(select,icons.align);if(select.classList.contains("ql-background")||select.classList.contains("ql-color")){let format=select.classList.contains("ql-background")?"background":"color";return select.querySelector("option")==null&&fillSelect(select,COLORS,format==="background"?"#ffffff":"#000000"),new color_picker_default(select,icons[format])}return select.querySelector("option")==null&&(select.classList.contains("ql-font")?fillSelect(select,FONTS):select.classList.contains("ql-header")?fillSelect(select,HEADERS):select.classList.contains("ql-size")&&fillSelect(select,SIZES)),new picker_default(select)});let update=()=>{this.pickers.forEach(picker=>{picker.update()})};this.quill.on(emitter_default.events.EDITOR_CHANGE,update)}};BaseTheme.DEFAULTS=merge_default({},theme_default.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let fileInput=this.container.querySelector("input.ql-image[type=file]");fileInput==null&&(fileInput=document.createElement("input"),fileInput.setAttribute("type","file"),fileInput.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),fileInput.classList.add("ql-image"),fileInput.addEventListener("change",()=>{let range=this.quill.getSelection(!0);this.quill.uploader.upload(range,fileInput.files),fileInput.value=""}),this.container.appendChild(fileInput)),fileInput.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});var BaseTooltip=class extends tooltip_default{constructor(quill,boundsContainer){super(quill,boundsContainer),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",event=>{event.key==="Enter"?(this.save(),event.preventDefault()):event.key==="Escape"&&(this.cancel(),event.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let mode=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",preview=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;preview!=null?this.textbox.value=preview:mode!==this.root.getAttribute("data-mode")&&(this.textbox.value="");let bounds=this.quill.getBounds(this.quill.selection.savedRange);bounds!=null&&this.position(bounds),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${mode}`)||""),this.root.setAttribute("data-mode",mode)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{let{scrollTop}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",value,emitter_default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",value,emitter_default.sources.USER)),this.quill.root.scrollTop=scrollTop;break}case"video":value=extractVideoUrl(value);case"formula":{if(!value)break;let range=this.quill.getSelection(!0);if(range!=null){let index=range.index+range.length;this.quill.insertEmbed(index,this.root.getAttribute("data-mode"),value,emitter_default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(index+1," ",emitter_default.sources.USER),this.quill.setSelection(index+2,emitter_default.sources.USER)}break}default:}this.textbox.value="",this.hide()}};function extractVideoUrl(url){let match2=url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return match2?`${match2[1]||"https"}://www.youtube.com/embed/${match2[2]}?showinfo=0`:(match2=url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${match2[1]||"https"}://player.vimeo.com/video/${match2[2]}/`:url}function fillSelect(select,values){let defaultValue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;values.forEach(value=>{let option=document.createElement("option");value===defaultValue?option.setAttribute("selected","selected"):option.setAttribute("value",String(value)),select.appendChild(option)})}var TOOLBAR_CONFIG=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],BubbleTooltip=class extends BaseTooltip{constructor(quill,bounds){super(quill,bounds),this.quill.on(emitter_default.events.EDITOR_CHANGE,(type,range,oldRange,source)=>{if(type===emitter_default.events.SELECTION_CHANGE)if(range!=null&&range.length>0&&source===emitter_default.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;let lines=this.quill.getLines(range.index,range.length);if(lines.length===1){let bounds2=this.quill.getBounds(range);bounds2!=null&&this.position(bounds2)}else{let lastLine=lines[lines.length-1],index=this.quill.getIndex(lastLine),length=Math.min(lastLine.length()-1,range.index+range.length-index),indexBounds=this.quill.getBounds(new Range(index,length));indexBounds!=null&&this.position(indexBounds)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(emitter_default.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;let range=this.quill.getSelection();if(range!=null){let bounds=this.quill.getBounds(range);bounds!=null&&this.position(bounds)}},1)})}cancel(){this.show()}position(reference){let shift=super.position(reference),arrow=this.root.querySelector(".ql-tooltip-arrow");return arrow.style.marginLeft="",shift!==0&&(arrow.style.marginLeft=`${-1*shift-arrow.offsetWidth/2}px`),shift}};__publicField(BubbleTooltip,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));var BubbleTheme=class extends BaseTheme{constructor(quill,options){options.modules.toolbar!=null&&options.modules.toolbar.container==null&&(options.modules.toolbar.container=TOOLBAR_CONFIG),super(quill,options),this.quill.container.classList.add("ql-bubble")}extendToolbar(toolbar){this.tooltip=new BubbleTooltip(this.quill,this.options.bounds),toolbar.container!=null&&(this.tooltip.root.appendChild(toolbar.container),this.buildButtons(toolbar.container.querySelectorAll("button"),icons_default),this.buildPickers(toolbar.container.querySelectorAll("select"),icons_default))}};BubbleTheme.DEFAULTS=merge_default({},BaseTheme.DEFAULTS,{modules:{toolbar:{handlers:{link(value){value?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Quill.sources.USER)}}}}});var TOOLBAR_CONFIG2=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],SnowTooltip=class extends BaseTooltip{constructor(){super(...arguments);__publicField(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",event=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),event.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",event=>{if(this.linkRange!=null){let range=this.linkRange;this.restoreFocus(),this.quill.formatText(range,"link",!1,emitter_default.sources.USER),delete this.linkRange}event.preventDefault(),this.hide()}),this.quill.on(emitter_default.events.SELECTION_CHANGE,(range,oldRange,source)=>{if(range!=null){if(range.length===0&&source===emitter_default.sources.USER){let[link,offset]=this.quill.scroll.descendant(Link,range.index);if(link!=null){this.linkRange=new Range(range.index-offset,link.length());let preview=Link.formats(link.domNode);this.preview.textContent=preview,this.preview.setAttribute("href",preview),this.show();let bounds=this.quill.getBounds(this.linkRange);bounds!=null&&this.position(bounds);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}};__publicField(SnowTooltip,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));var SnowTheme=class extends BaseTheme{constructor(quill,options){options.modules.toolbar!=null&&options.modules.toolbar.container==null&&(options.modules.toolbar.container=TOOLBAR_CONFIG2),super(quill,options),this.quill.container.classList.add("ql-snow")}extendToolbar(toolbar){toolbar.container!=null&&(toolbar.container.classList.add("ql-snow"),this.buildButtons(toolbar.container.querySelectorAll("button"),icons_default),this.buildPickers(toolbar.container.querySelectorAll("select"),icons_default),this.tooltip=new SnowTooltip(this.quill,this.options.bounds),toolbar.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(_range,context)=>{toolbar.handlers.link.call(toolbar,!context.format.link)}))}};SnowTheme.DEFAULTS=merge_default({},BaseTheme.DEFAULTS,{modules:{toolbar:{handlers:{link(value){if(value){let range=this.quill.getSelection();if(range==null||range.length===0)return;let preview=this.quill.getText(range);/^\S+@\S+\.\S+$/.test(preview)&&preview.indexOf("mailto:")!==0&&(preview=`mailto:${preview}`);let{tooltip}=this.quill.theme;tooltip.edit("link",preview)}else this.quill.format("link",!1,Quill.sources.USER)}}}}});var snow_default=SnowTheme;core_default.register({"attributors/attribute/direction":DirectionAttribute,"attributors/class/align":AlignClass,"attributors/class/background":BackgroundClass,"attributors/class/color":ColorClass,"attributors/class/direction":DirectionClass,"attributors/class/font":FontClass,"attributors/class/size":SizeClass,"attributors/style/align":AlignStyle,"attributors/style/background":BackgroundStyle,"attributors/style/color":ColorStyle,"attributors/style/direction":DirectionStyle,"attributors/style/font":FontStyle,"attributors/style/size":SizeStyle},!0);core_default.register({"formats/align":AlignClass,"formats/direction":DirectionClass,"formats/indent":indent_default,"formats/background":BackgroundStyle,"formats/color":ColorStyle,"formats/font":FontClass,"formats/size":SizeClass,"formats/blockquote":blockquote_default,"formats/code-block":CodeBlock,"formats/header":header_default,"formats/list":ListItem,"formats/bold":bold_default,"formats/code":Code,"formats/italic":italic_default,"formats/link":Link,"formats/script":script_default,"formats/strike":strike_default,"formats/underline":underline_default,"formats/formula":formula_default,"formats/image":image_default,"formats/video":video_default,"modules/syntax":Syntax,"modules/table":table_default,"modules/toolbar":Toolbar,"themes/bubble":BubbleTheme,"themes/snow":snow_default,"ui/icons":icons_default,"ui/picker":picker_default,"ui/icon-picker":icon_picker_default,"ui/color-picker":color_picker_default,"ui/tooltip":tooltip_default},!0);var quill_default=core_default;export{parchment_exports,Range,module_default,quill_default};