@ixon-cdk/simulator 1.19.0 → 1.20.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,4 +1,4 @@
1
- import{cloneDeep_default,isEqual_default,merge_default}from"./chunk-B66ZPH3R.js";import{__commonJS,__export,__objRest,__spreadProps,__spreadValues,__toESM}from"./chunk-IHZVASS3.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=`
1
+ import{cloneDeep_default,isEqual_default,merge_default}from"./chunk-W3TLLCWQ.js";import{__commonJS,__export,__objRest,__spreadProps,__spreadValues,__toESM}from"./chunk-EFEL2YQJ.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
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=(()=>{class Inline2 extends InlineBlot$1{static allowedChildren=[Inline2,break_default,EmbedBlot$1,Text2];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(self2,other){let selfIndex=Inline2.order.indexOf(self2),otherIndex=Inline2.order.indexOf(other);return selfIndex>=0||otherIndex>=0?selfIndex-otherIndex:self2===other?0:self2<other?-1:1}formatAt(index,length,name,value){if(Inline2.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 Inline2&&Inline2.compare(this.statics.blotName,this.parent.statics.blotName)>0){let parent=this.parent.isolate(this.offset(),this.length());this.moveChildren(parent),parent.wrap(this)}}}return Inline2})(),inline_default=Inline;var NEWLINE_LENGTH=1,Block=(()=>{class Block2 extends BlockBlot$1{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
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
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(`
@@ -46,4 +46,4 @@ ${escapeText(this.code(index,length))}
46
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
47
  `).reduce((memo,nodeText,i)=>(i!==0&&memo.insert(`
48
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=(()=>{class TableCell2 extends Block{static blotName="table";static tagName="TD";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===TableCell2.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()}}return TableCell2})(),TableRow=(()=>{class TableRow2 extends container_default{static blotName="table-row";static tagName="TR";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 TableRow2})(),TableBody=(()=>{class TableBody2 extends container_default{static blotName="table-body";static tagName="TBODY"}return TableBody2})(),TableContainer=(()=>{class TableContainer2 extends container_default{static blotName="table-container";static tagName="TABLE";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 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{static 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("");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}},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{static 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("");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")}},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};
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{static 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("");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}},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{static 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("");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")}},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{quill_default};